Browse Source

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

pull/886/head
Valentin Radu 4 years ago
parent
commit
79b6f98c6c
  1. 9
      ExplorerPatcher/dllmain.c

9
ExplorerPatcher/dllmain.c

@ -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,

Loading…
Cancel
Save