https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9e6b3f4bbd4ca9a812465…
commit 9e6b3f4bbd4ca9a8124650a55a4690fdf8851fe2
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Aug 14 21:06:40 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Aug 14 21:06:40 2023 +0900
[APPWIZ] Don't forget to CoInitializeEx on COM thread (#5551)
- Do CoInitializeEx and CoUninitialize in download_proc.
CORE-19110, CORE-15786
---
dll/cpl/appwiz/addons.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dll/cpl/appwiz/addons.c b/dll/cpl/appwiz/addons.c
index 5fdfc999f1e..614bd2ab3e8 100644
--- a/dll/cpl/appwiz/addons.c
+++ b/dll/cpl/appwiz/addons.c
@@ -358,7 +358,9 @@ static DWORD WINAPI download_proc(PVOID arg)
{
WCHAR message[256];
WCHAR tmp_dir[MAX_PATH], tmp_file[MAX_PATH];
- HRESULT hres;
+ HRESULT hres, hrCoInit;
+
+ hrCoInit = CoInitializeEx(NULL, COINIT_MULTITHREADED);
GetTempPathW(sizeof(tmp_dir)/sizeof(WCHAR), tmp_dir);
GetTempFileNameW(tmp_dir, NULL, 0, tmp_file);
@@ -388,6 +390,10 @@ static DWORD WINAPI download_proc(PVOID arg)
DeleteFileW(tmp_file);
PostMessageW(install_dialog, WM_COMMAND, IDCANCEL, 0);
+
+ if (SUCCEEDED(hrCoInit))
+ CoUninitialize();
+
return 0;
}