1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2025-02-07 14:51:28 +01:00

Protect classic theme mitigations state variable from changing once its setting is read from the registry

This commit is contained in:
Valentin Radu 2022-01-04 02:01:44 +02:00
parent 065acae2c4
commit 79b6f98c6c

View File

@ -64,6 +64,7 @@ DWORD bOpenAtLogon = FALSE;
DWORD bClockFlyoutOnWinC = FALSE; DWORD bClockFlyoutOnWinC = FALSE;
DWORD bDisableImmersiveContextMenu = FALSE; DWORD bDisableImmersiveContextMenu = FALSE;
DWORD bClassicThemeMitigations = FALSE; DWORD bClassicThemeMitigations = FALSE;
DWORD bWasClassicThemeMitigationsSet = FALSE;
DWORD bHookStartMenu = TRUE; DWORD bHookStartMenu = TRUE;
DWORD bPropertiesInWinX = FALSE; DWORD bPropertiesInWinX = FALSE;
DWORD bNoMenuAccelerator = FALSE; DWORD bNoMenuAccelerator = FALSE;
@ -4094,15 +4095,21 @@ void WINAPI LoadSettings(LPARAM lParam)
&bDisableImmersiveContextMenu, &bDisableImmersiveContextMenu,
&dwSize &dwSize
); );
dwTemp = FALSE;
dwSize = sizeof(DWORD); dwSize = sizeof(DWORD);
RegQueryValueExW( RegQueryValueExW(
hKey, hKey,
TEXT("ClassicThemeMitigations"), TEXT("ClassicThemeMitigations"),
0, 0,
NULL, NULL,
&bClassicThemeMitigations, &dwTemp,
&dwSize &dwSize
); );
if (!bWasClassicThemeMitigationsSet)
{
bClassicThemeMitigations = dwTemp;
bWasClassicThemeMitigationsSet = TRUE;
}
dwSize = sizeof(DWORD); dwSize = sizeof(DWORD);
RegQueryValueExW( RegQueryValueExW(
hKey, hKey,