From abf0d38cb418d6613b93d4dee5a3666b7e877c48 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Mon, 15 Nov 2021 05:54:54 +0200 Subject: [PATCH] Closed handles when ShellExecuteExW with SEE_MASK_NOCLOSEPROCESS --- ExplorerPatcher/GUI.c | 1 + ep_setup/ep_setup.c | 1 + ep_setup_patch/ep_setup_patch.c | 1 + 3 files changed, 3 insertions(+) diff --git a/ExplorerPatcher/GUI.c b/ExplorerPatcher/GUI.c index 66e7f62..784f667 100644 --- a/ExplorerPatcher/GUI.c +++ b/ExplorerPatcher/GUI.c @@ -974,6 +974,7 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) { } + CloseHandle(sei.hProcess); } else { diff --git a/ep_setup/ep_setup.c b/ep_setup/ep_setup.c index a551226..838bbfb 100644 --- a/ep_setup/ep_setup.c +++ b/ep_setup/ep_setup.c @@ -431,6 +431,7 @@ int WINAPI wWinMain( DWORD dwExitCode = 0; GetExitCodeProcess(sei.hProcess, &dwExitCode); SetLastError(dwExitCode); + CloseHandle(sei.hProcess); } } } diff --git a/ep_setup_patch/ep_setup_patch.c b/ep_setup_patch/ep_setup_patch.c index 9703f9e..4c1fb49 100644 --- a/ep_setup_patch/ep_setup_patch.c +++ b/ep_setup_patch/ep_setup_patch.c @@ -61,6 +61,7 @@ int main(int argc, char** argv) WaitForSingleObject(ShExecInfo.hProcess, INFINITE); DWORD dwExitCode = 0; GetExitCodeProcess(ShExecInfo.hProcess, &dwExitCode); + CloseHandle(ShExecInfo.hProcess); return dwExitCode; } }