Skip to content

Commit 0aa2e82

Browse files
authored
[BROWSEUI] Don't forget to CoInitializeEx on COM thread (reactos#5552)
Use CoInitializeEx and CoUninitialize in CFindFolder::SearchThreadProc. CORE-19110
1 parent b9958c7 commit 0aa2e82

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dll/win32/browseui/shellfind/CFindFolder.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,8 @@ DWORD WINAPI CFindFolder::SearchThreadProc(LPVOID lpParameter)
455455
{
456456
_SearchData *data = static_cast<_SearchData*>(lpParameter);
457457

458+
HRESULT hrCoInit = CoInitializeEx(NULL, COINIT_MULTITHREADED);
459+
458460
data->pFindFolder->NotifyConnections(DISPID_SEARCHSTART);
459461

460462
UINT uTotalFound = RecursiveFind(data->szPath, data);
@@ -469,6 +471,9 @@ DWORD WINAPI CFindFolder::SearchThreadProc(LPVOID lpParameter)
469471
CloseHandle(data->hStopEvent);
470472
delete data;
471473

474+
if (SUCCEEDED(hrCoInit))
475+
CoUninitialize();
476+
472477
return 0;
473478
}
474479

0 commit comments

Comments
 (0)