四種DCOM錯誤的區別
Differences between the following DCOM error
Differences between the following DCOM error
0x80080005
0x800706be
0x80010105
0x800706ba
0x80080005:CO_E_Server_Exec_Failure
Server execution failed
Server execution failed
It is usually quite clear: COM (really, RPCSS) tried to launch a particular server process and either it failed to start, or it died after being started without registering (via CoRegisterClassObject), or it failed to register within a timely manner after being started (usually ~2 minutes are allowed, but the time limit can vary by server type).
Repro:比如你有一個程序叫做SimpleDCOM.exe,作為DCOM服務器一切運行正常。如果你把notepad.exe改名為SimpleDCOM.exe,替代掉原先的文件,客戶端在調用DCOM的時候就會出這個錯。SOX050427700068
0x800706be:PRC_S_CALL_FAILED
The remote procedure call failed.
The Server crashes before finishing the call.
Repro:重現這個問題很簡單。在DCOM的方法中顯示一個MessageBox。在dismiss掉這個MessageBox,讓DCOM call返回以前,從任務管理器殺死DCOM Server,然后客戶端就會看到這個錯了。
0x80010105:RPC_E_SERVERFAULT
The server threw an exception
The server threw an exception
Very straight forward, the server throws an exception.
Repro:DCOM方法中直接拋出一個C++ exception就可以重現這個問題。聰明的你可能會問,為啥米C++ exception不會導致DCOM Server crash吶,那是因為:
"Normally, an exception that happens in a DCOM server during execution of a method call is caught by an exception handler in OLE32.DLL, and the method call returns RPC_E_SERVERFAULT."
如果要改變這個行為,可以參考IgnoreServerExceptions這個注冊表鍵:
http://support.microsoft.com/kb/198623/en-us
http://support.microsoft.com/kb/198623/en-us
0x800706ba:RPC_S_SERVER_UNAVAILABLE
The PRC server is unavaliable
The server stub is disconnected.
Repro:在客戶段new一個DCOM object, 暫時不使用。然后重任務管理器中殺死DCOM Server, 然后調用這個DCOM object的方法,錯誤就出來了