mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[APPWIZ] Don't forget to CoInitializeEx on COM thread (#5551)
- Do CoInitializeEx and CoUninitialize in download_proc. CORE-19110, CORE-15786
This commit is contained in:
parent
485c03ad03
commit
9e6b3f4bbd
1 changed files with 7 additions and 1 deletions
|
@ -358,7 +358,9 @@ static DWORD WINAPI download_proc(PVOID arg)
|
||||||
{
|
{
|
||||||
WCHAR message[256];
|
WCHAR message[256];
|
||||||
WCHAR tmp_dir[MAX_PATH], tmp_file[MAX_PATH];
|
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);
|
GetTempPathW(sizeof(tmp_dir)/sizeof(WCHAR), tmp_dir);
|
||||||
GetTempFileNameW(tmp_dir, NULL, 0, tmp_file);
|
GetTempFileNameW(tmp_dir, NULL, 0, tmp_file);
|
||||||
|
@ -388,6 +390,10 @@ static DWORD WINAPI download_proc(PVOID arg)
|
||||||
|
|
||||||
DeleteFileW(tmp_file);
|
DeleteFileW(tmp_file);
|
||||||
PostMessageW(install_dialog, WM_COMMAND, IDCANCEL, 0);
|
PostMessageW(install_dialog, WM_COMMAND, IDCANCEL, 0);
|
||||||
|
|
||||||
|
if (SUCCEEDED(hrCoInit))
|
||||||
|
CoUninitialize();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue