Common (Windows): fixes random failures of WMI initialization
This commit is contained in:
1 file changed
+5
-2
@@ -17,7 +17,8 @@ static const char* doInitCom()
|
||||
return "CoInitializeEx() failed";
|
||||
|
||||
// Set general COM security levels
|
||||
if (FAILED(CoInitializeSecurity(
|
||||
|
||||
HRESULT hRes = CoInitializeSecurity(
|
||||
NULL,
|
||||
-1, // COM authentication
|
||||
NULL, // Authentication services
|
||||
@@ -27,7 +28,9 @@ static const char* doInitCom()
|
||||
NULL, // Authentication info
|
||||
EOAC_NONE, // Additional capabilities
|
||||
NULL // Reserved
|
||||
)))
|
||||
);
|
||||
|
||||
if (FAILED(hRes) && hRes != RPC_E_TOO_LATE /* Has been set by a random dll */)
|
||||
{
|
||||
CoUninitialize();
|
||||
return "CoInitializeSecurity() failed";
|
||||
|
||||
Reference in new issue
Block a user