From 4eba400170d2b9fbac3b58d5cea331ae708ecc4c Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Sun, 13 Feb 2022 19:30:41 +0000 Subject: [PATCH] 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 --- pcsx2/DEV9/Win32/tap-win32.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pcsx2/DEV9/Win32/tap-win32.cpp b/pcsx2/DEV9/Win32/tap-win32.cpp index f2e90a99d7..c16e150ae3 100644 --- a/pcsx2/DEV9/Win32/tap-win32.cpp +++ b/pcsx2/DEV9/Win32/tap-win32.cpp @@ -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) {