From 9bfef43934fea8bb505a7d7a4b9f7fd45af5b607 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Sun, 12 Dec 2021 20:33:22 +0200 Subject: [PATCH] Fixed a stack corruption (#546) --- ExplorerPatcher/GUI.c | 2 +- ep_setup/ep_setup.c | 17 ++++++++++------- libs/sws | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ExplorerPatcher/GUI.c b/ExplorerPatcher/GUI.c index 40a981d..a45a302 100644 --- a/ExplorerPatcher/GUI.c +++ b/ExplorerPatcher/GUI.c @@ -774,7 +774,7 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) { WCHAR wszPath[MAX_PATH]; ZeroMemory(wszPath, MAX_PATH * sizeof(WCHAR)); - INT64 res = -1; + PDWORD_PTR res = -1; if (!SendMessageTimeoutW(hShellTrayWnd, 1460, 0, 0, SMTO_ABORTIFHUNG, 2000, &res) && res) { HANDLE hExplorerRestartThread = CreateThread(NULL, 0, BeginExplorerRestart, NULL, 0, NULL); diff --git a/ep_setup/ep_setup.c b/ep_setup/ep_setup.c index 09972e0..de9e59e 100644 --- a/ep_setup/ep_setup.c +++ b/ep_setup/ep_setup.c @@ -441,7 +441,7 @@ int WINAPI wWinMain( HWND hShellTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL); if (hShellTrayWnd) { - INT res = -1; + PDWORD_PTR res = -1; if (!SendMessageTimeoutW(hShellTrayWnd, 1460, 0, 0, SMTO_ABORTIFHUNG, 2000, &res) && res) { HANDLE hExplorerRestartThread = CreateThread(NULL, 0, BeginExplorerRestart, NULL, 0, NULL); @@ -721,12 +721,15 @@ int WINAPI wWinMain( { if (!hShellTrayWnd) { - MessageBoxW( - NULL, - L"" _T(PRODUCT_NAME) L" has been installed successfully. Start Explorer to have it load up.", - _T(PRODUCT_NAME), - MB_ICONINFORMATION | MB_OK | MB_DEFBUTTON1 - ); + if (bOk) + { + MessageBoxW( + NULL, + L"" _T(PRODUCT_NAME) L" has been installed successfully. Start File Explorer to have it load up.", + _T(PRODUCT_NAME), + MB_ICONINFORMATION | MB_OK | MB_DEFBUTTON1 + ); + } } else { diff --git a/libs/sws b/libs/sws index c3a6fea..812529c 160000 --- a/libs/sws +++ b/libs/sws @@ -1 +1 @@ -Subproject commit c3a6fea725426910b0b60ea8228aafe9a5d4368d +Subproject commit 812529c4f04378b6009f6deb7f8a85a46aa1de05