Skip to content

Commit 915a7cc

Browse files
utam-1miss-islington
authored andcommitted
gh-159118: Use multithreaded COM initialization in _wmi (GH-159463)
(cherry picked from commit 99799a9) Co-authored-by: Uttam Bhadauriya <uttamsinghbhadoriya23@gmail.com>
1 parent 828861f commit 915a7cc

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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).

‎PC/_wmimodule.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ _query_thread(LPVOID param)
6767
}
6868

6969
if (SUCCEEDED(hr)) {
70-
hr = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
70+
hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
7171
}
7272

7373
if (FAILED(hr)) {

0 commit comments

Comments
 (0)