diff --git a/Misc/NEWS.d/next/Windows/2026-10-15-18-45-00.gh-issue-159118.wmiMTA.rst b/Misc/NEWS.d/next/Windows/2026-10-15-18-45-00.gh-issue-159118.wmiMTA.rst new file mode 100644 index 00000000000000..561a5005b75975 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2026-10-15-18-45-00.gh-issue-159118.wmiMTA.rst @@ -0,0 +1 @@ +Fix a crash (``RPC_NT_INTERNAL_ERROR``) and intermittent window class failures in :mod:`!_wmi` under high concurrency and load by initializing COM as multi-threaded (MTA) instead of apartment-threaded (STA). diff --git a/PC/_wmimodule.cpp b/PC/_wmimodule.cpp index b9a229b1398ec8..a546313529fd1b 100644 --- a/PC/_wmimodule.cpp +++ b/PC/_wmimodule.cpp @@ -67,7 +67,7 @@ _query_thread(LPVOID param) } if (SUCCEEDED(hr)) { - hr = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); } if (FAILED(hr)) {