1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2025-02-20 20:41:26 +01:00

Merge pull request #51 from justanotheranonymoususer/RegCloseKey-fix

Fixing RegCloseKey invalid handle
This commit is contained in:
Valentin-Gabriel Radu 2021-10-10 19:24:12 +03:00 committed by GitHub
commit 12e0733c56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -723,6 +723,7 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
if (hKey)
{
RegCloseKey(hKey);
hKey = NULL;
RegDeleteKeyExW(
HKEY_CURRENT_USER,
wcschr(section, L'\\') + 1,
@ -799,7 +800,10 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
}
InvalidateRect(hwnd, NULL, FALSE);
}
RegCloseKey(hKey);
if (hKey)
{
RegCloseKey(hKey);
}
if (bChoice)
{
for (unsigned int i = 0; i < numChoices; ++i)