[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
This commit is contained in:
Katayama Hirofumi MZ 2020-02-12 09:03:14 +09:00 committed by GitHub
parent 9f4e8ef25b
commit 0a7a747d87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}