Home
Archives
|
Troubleshooting COM Error 0x8000401a
I Recently ran into this issue when troubleshooting a remote COM object bug where
the CoCreateInstanceEx call was returning this error code. In detail it says:
"The server process could not be started because the configured identity is incorrect...".
This was only happening when the remote credentials for this object contained a
"%" character in the password. I figured that the password was being mashed
together somewhere due to this formatting character for a "printf".
Sure enough, I found that in the code that when it was setting the "Run As" options
for this COM server, the password was being destroyed during a copy statement.
//Offending code
printf(newPasswordString, OldPasswordString);
The coder for this line must have been lazy and used the printf function for a string
copy function. Changing this to a proper string copy statement fixed the issue.
Bottom line, when troubleshooting this issue, go to the machine, run dcomcnfg, and
make sure that the credentials for the COM server match the credentials you are
trying to use in your code to authenticate.
The other issue you might run into with this error is if your COM server is set
to run as the interactive user. If there are no interactive users logged in
to the machine, you might also see this error code. Use the dcomcnfg utility
(start->run->dcomcnfg) to change this setting so that it runs as a specified
user account with the appropriate permissions.
-JP
|
|