https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0aa2e82c06656aa59f04f…
commit 0aa2e82c06656aa59f04f0f96c4298bd26d5ad64
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Aug 10 22:16:30 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Aug 10 22:16:30 2023 +0900
[BROWSEUI] Don't forget to CoInitializeEx on COM thread (#5552)
Use CoInitializeEx and CoUninitialize in
CFindFolder::SearchThreadProc.
CORE-19110
---
dll/win32/browseui/shellfind/CFindFolder.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dll/win32/browseui/shellfind/CFindFolder.cpp
b/dll/win32/browseui/shellfind/CFindFolder.cpp
index faa71f4c528..6108970fb55 100644
--- a/dll/win32/browseui/shellfind/CFindFolder.cpp
+++ b/dll/win32/browseui/shellfind/CFindFolder.cpp
@@ -455,6 +455,8 @@ DWORD WINAPI CFindFolder::SearchThreadProc(LPVOID lpParameter)
{
_SearchData *data = static_cast<_SearchData*>(lpParameter);
+ HRESULT hrCoInit = CoInitializeEx(NULL, COINIT_MULTITHREADED);
+
data->pFindFolder->NotifyConnections(DISPID_SEARCHSTART);
UINT uTotalFound = RecursiveFind(data->szPath, data);
@@ -469,6 +471,9 @@ DWORD WINAPI CFindFolder::SearchThreadProc(LPVOID lpParameter)
CloseHandle(data->hStopEvent);
delete data;
+ if (SUCCEEDED(hrCoInit))
+ CoUninitialize();
+
return 0;
}