22 Nov
2022
22 Nov
'22
12:41 p.m.
Piotr Caban (@piotr) commented about dlls/imm32/imm.c:
TRACE("implicit COM initialization\n");
+ if (!pCoRevokeInitializeSpy) + { + HMODULE module_ole32 = GetModuleHandleA("ole32"); + pCoRevokeInitializeSpy = (void*)GetProcAddress(module_ole32, "CoRevokeInitializeSpy"); + pCoUninitialize = (void*)GetProcAddress(module_ole32, "CoUninitialize"); + }
Please use e.g. InitOnceExecuteOnce to initialize the variables. In theory, one thread may set pCoRevokeInitializeSpy, second thread may assume at this point that pCoUninitialize is already set while it's not. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/1456#note_16938