Created
August 23, 2018 09:20
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c | |
index 3487cca572..f3dac68bde 100644 | |
--- a/dlls/ole32/compobj.c | |
+++ b/dlls/ole32/compobj.c | |
@@ -3314,17 +3314,23 @@ HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstanceEx( | |
init_multi_qi(cmq, pResults, E_NOINTERFACE); | |
- hres = CoGetTreatAsClass(rclsid, &clsid); | |
- if(FAILED(hres)) | |
- clsid = *rclsid; | |
- | |
if (!(apt = apartment_get_current_or_mta())) | |
{ | |
- ERR("apartment not initialised\n"); | |
- return CO_E_NOTINITIALIZED; | |
+ WARN("apartment not initialised; initializing now\n"); | |
+ CoInitialize(NULL); | |
+ | |
+ if (!(apt = apartment_get_current_or_mta())) | |
+ { | |
+ ERR("apartment still not initialised\n"); | |
+ return CO_E_NOTINITIALIZED; | |
+ } | |
} | |
apartment_release(apt); | |
+ hres = CoGetTreatAsClass(rclsid, &clsid); | |
+ if(FAILED(hres)) | |
+ clsid = *rclsid; | |
+ | |
/* | |
* The Standard Global Interface Table (GIT) object is a process-wide singleton. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment