Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-159118: Use MTA COM initialization in _wmi to avoid crashes under …
…load

Initialize COM with COINIT_MULTITHREADED instead of COINIT_APARTMENTTHREADED in _wmimodule.cpp to prevent hidden window registration contention and RPC_NT_INTERNAL_ERROR crashes under high concurrency.
  • Loading branch information
utam-1 committed Oct 15, 2026
commit 3ad4bef38b5b459f9cd85b18aa8a569bdc8be452
Original file line number Diff line number Diff line change
@@ -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).
2 changes: 1 addition & 1 deletion PC/_wmimodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ _query_thread(LPVOID param)
}

if (SUCCEEDED(hr)) {
hr = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
}

if (FAILED(hr)) {
Expand Down
Loading