DEV9: Don't enforce MTA requirement

Also CoUninitialize() needs to be called for all successful calls to CoInitialize/Ex(), not just those that return S_OK
This commit is contained in:
TheLastRar 2022-02-13 19:30:41 +00:00 committed by lightningterror
parent dc376ab161
commit 4eba400170
1 changed files with 4 additions and 3 deletions

View File

@ -417,7 +417,9 @@ bool TAPGetWin32Adapter(const std::string& name, PIP_ADAPTER_ADDRESSES adapter,
//Step 2
//Init COM
const HRESULT cohr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
HRESULT cohr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
if (cohr == RPC_E_CHANGED_MODE)
cohr = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
if (!SUCCEEDED(cohr))
return false;
@ -514,8 +516,7 @@ bool TAPGetWin32Adapter(const std::string& name, PIP_ADAPTER_ADDRESSES adapter,
}
}
if (cohr == S_OK)
CoUninitialize();
CoUninitialize();
if (bridgeAdapter != nullptr)
{