From cd2a543f3ea074f38d1293d93a2b9d7ea40b0480 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Fri, 20 Aug 2021 01:27:17 +0300 Subject: [PATCH] Bug fix for installer/uninstaller not working and small improvements. --- ExplorerPatcher/main.c | 3 ++- ExplorerPatcherLibrary/dllmain.c | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ExplorerPatcher/main.c b/ExplorerPatcher/main.c index 3ea6650..8df9a31 100644 --- a/ExplorerPatcher/main.c +++ b/ExplorerPatcher/main.c @@ -109,7 +109,6 @@ int install_uninstall() szReadName, (LPDWORD)(&dwReadBytes) ); - RegCloseKey(hKey); if (!wcscmp(szFileName, szReadName)) { if (RegDeleteValue( @@ -151,8 +150,10 @@ int install_uninstall() MB_ICONINFORMATION ); } + RegCloseKey(hKey); return 1; error_setup: + RegCloseKey(hKey); #ifdef UNICODE swprintf(buffer, 200, #else diff --git a/ExplorerPatcherLibrary/dllmain.c b/ExplorerPatcherLibrary/dllmain.c index c32df55..1e07380 100644 --- a/ExplorerPatcherLibrary/dllmain.c +++ b/ExplorerPatcherLibrary/dllmain.c @@ -559,8 +559,6 @@ INT64 CTray_HandleGlobalHotkeyHook( return 0; } - InterlockedExchange64(&lockEnsureWinXHotkeyOnlyOnce, 1); - HWND hWnd = GetForegroundWindow(); HWND g_ProgWin = FindWindowEx( NULL, @@ -595,6 +593,7 @@ INT64 CTray_HandleGlobalHotkeyHook( ip[3].ki.dwExtraInfo = 0; ip[3].ki.wVk = VK_LWIN; ip[3].ki.dwFlags = KEYEVENTF_KEYUP; + InterlockedExchange64(&lockEnsureWinXHotkeyOnlyOnce, 1); SendInput(4, ip, sizeof(INPUT)); SetForegroundWindow(hWnd);