From 431a98923de24e0a101fbd9ce82e3f78825fe8fa Mon Sep 17 00:00:00 2001 From: Joachim Henze Date: Sun, 17 Jan 2021 22:41:37 +0100 Subject: [PATCH] [0.4.11][APPWIZ] Don't hung up in Gecko download cancellation #3049 CORE-14538 Do not call EndDialog outside the dialog procedure. fix picked from commit 0.4.15-dev-511-g 90456e54a42604909bf2d93cb74abbbf6574268f This hang/crash in 2nd stage setup did *not* affect our official carrier-releaser isos that we host on sourceforge, because those come bundled with Gecko already and therefore always skipped the download. Most users were safe in the past therefore. Still everyone that would like to build an iso by himself could potentially run into those crashes, and it did not only happen upon user-driven cancellation, but also often crashed upon network failure / timeout. A very important fix therefore. For some unknown reason the likelihood of this crash gradually increased from 0.4.7 where it happened almost never, until 0.4.14 where it crashed much more likely. Not well understood, maybe depends on memory layout or something similar. --- dll/cpl/appwiz/addons.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/cpl/appwiz/addons.c b/dll/cpl/appwiz/addons.c index 238348d0dce..32e29f9a46f 100644 --- a/dll/cpl/appwiz/addons.c +++ b/dll/cpl/appwiz/addons.c @@ -59,7 +59,7 @@ static const addon_info_t addons_info[] = { static const addon_info_t *addon; static HWND install_dialog = NULL; -static IBinding *download_binding; +static IBinding *download_binding = NULL; static WCHAR GeckoUrl[] = L"https://svn.reactos.org/amine/wine_gecko-2.40-x86.msi"; @@ -382,7 +382,7 @@ static DWORD WINAPI download_proc(PVOID arg) } DeleteFileW(tmp_file); - EndDialog(install_dialog, 0); + PostMessageW(install_dialog, WM_COMMAND, IDCANCEL, 0); return 0; }