https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d2bbf54b6f6f8ffdc3fd4…
commit d2bbf54b6f6f8ffdc3fd4a0d91c836dd7e5a135f
Author: Joachim Henze <Joachim.Henze(a)reactos.org>
AuthorDate: Wed Sep 30 13:08:58 2020 +0200
Commit: Joachim Henze <Joachim.Henze(a)reactos.org>
CommitDate: Wed Sep 30 13:08:58 2020 +0200
[MSGINA] Allow to pair FriendlyShutDownDlg with 'Server' CORE-17282
A ros specific addition that does not exist on Windows.
Default for Server is still the classic shutdown dlg,
no change on that.
But interested users can manually now create the registry setting
"EnforceFriendlyShutdown" REG_DWORD to "1"
within "SYSTEM\\CurrentControlSet\\Control\\Windows"
to allow overriding the Windows default behavior
without relying on changing the product version number, because
that would not be side-effect-free.
Addendum to 0.4.15-dev-650-g
2edcb58e6550fd6283cf3a7d332ee61849704f3d
---
dll/win32/msgina/shutdown.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/dll/win32/msgina/shutdown.c b/dll/win32/msgina/shutdown.c
index 88f1036d5dd..bc6e97949d6 100644
--- a/dll/win32/msgina/shutdown.c
+++ b/dll/win32/msgina/shutdown.c
@@ -100,7 +100,6 @@ IsFriendlyUIActive(VOID)
HKEY hKey;
LONG lRet;
- /* Check product version number first */
lRet = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
L"SYSTEM\\CurrentControlSet\\Control\\Windows",
0,
@@ -109,6 +108,25 @@ IsFriendlyUIActive(VOID)
if (lRet != ERROR_SUCCESS)
return FALSE;
+ /* CORE-17282 First check an optional ReactOS specific override, that Windows does not check.
+ We use this to allow users pairing 'Server'-configuration with FriendlyShutdown.
+ Otherwise users would have to change CSDVersion or LogonType (side-effects AppCompat) */
+ dwValue = 0;
+ dwSize = sizeof(dwValue);
+ lRet = RegQueryValueExW(hKey,
+ L"EnforceFriendlyShutdown",
+ NULL,
+ &dwType,
+ (LPBYTE)&dwValue,
+ &dwSize);
+
+ if (lRet == ERROR_SUCCESS && dwType == REG_DWORD && dwValue == 0x1)
+ {
+ RegCloseKey(hKey);
+ return TRUE;
+ }
+
+ /* Check product version number */
dwValue = 0;
dwSize = sizeof(dwValue);
lRet = RegQueryValueExW(hKey,