Use consistent concurrency model with CoInitializeEx

This commit is contained in:
Thomas greenwood 2021-06-28 22:21:59 +01:00 committed by Adam Honse
parent 710a079a9a
commit 2e540e2c6f
2 changed files with 2 additions and 2 deletions

View file

@ -83,7 +83,7 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
if(result == CO_E_NOTINITIALIZED)
{
weInitialised = true;
CoInitializeEx(NULL, 2u);
CoInitializeEx(NULL, COINIT_MULTITHREADED);
result = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_ALL, IID_IShellLinkW, (void**)&shellLink);
}

View file

@ -103,7 +103,7 @@ static bool OpenNotebook()
bool AsWMI_Open()
{
HRESULT init = CoInitializeEx(0, 2u);
HRESULT init = CoInitializeEx(0, COINIT_MULTITHREADED);
if ( init < 0 && init != -2147417850 )
return 0;
coInitialized = 1;