https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0a7a747d87c861fc8c7c5c9545935b2c0b48348a

commit 0a7a747d87c861fc8c7c5c9545935b2c0b48348a
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Wed Feb 12 09:03:14 2020 +0900
Commit:     GitHub <[email protected]>
CommitDate: Wed Feb 12 09:03:14 2020 +0900

    [SYSSETUP] Plan A: Also write ReportAsWorkstation value (#2326)
    
    Write the ReportAsWorkstation value of the registry key 
HKLM\SYSTEM\CurrentControlSet\Control\ReactOS\Settings\Version.
    The reason is shown at CORE-6611.
    CORE-13795
---
 dll/win32/syssetup/wizard.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/dll/win32/syssetup/wizard.c b/dll/win32/syssetup/wizard.c
index ba2403e6667..a6f83bd280f 100644
--- a/dll/win32/syssetup/wizard.c
+++ b/dll/win32/syssetup/wizard.c
@@ -380,11 +380,12 @@ AckPageDlgProc(HWND hwndDlg,
 static BOOL
 DoWriteProductOption(PRODUCT_OPTION nOption)
 {
-    static const WCHAR s_szProductOptions[] = 
L"System\\CurrentControlSet\\Control\\ProductOptions";
+    static const WCHAR s_szProductOptions[] = 
L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions";
+    static const WCHAR s_szRosVersion[] = 
L"SYSTEM\\CurrentControlSet\\Control\\ReactOS\\Settings\\Version";
     HKEY hKey;
     LONG error;
     LPCWSTR pData;
-    DWORD cbData;
+    DWORD cbData, dwValue;
 
     error = RegOpenKeyExW(HKEY_LOCAL_MACHINE, s_szProductOptions, 0, 
KEY_WRITE, &hKey);
     if (error)
@@ -422,6 +423,18 @@ DoWriteProductOption(PRODUCT_OPTION nOption)
     }
 
     RegCloseKey(hKey);
+
+    error = RegOpenKeyExW(HKEY_LOCAL_MACHINE, s_szRosVersion, 0, KEY_WRITE, 
&hKey);
+    if (error)
+        return FALSE;
+
+    /* write ReportAsWorkstation value */
+    dwValue = (nOption == PRODUCT_OPTION_WORKSTATION);
+    cbData = sizeof(dwValue);
+    error = RegSetValueExW(hKey, L"ReportAsWorkstation", 0, REG_DWORD, (BYTE 
*)&dwValue, cbData);
+
+    RegCloseKey(hKey);
+
     return error == ERROR_SUCCESS;
 }
 

Reply via email to