mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[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:
parent
9f4e8ef25b
commit
0a7a747d87
1 changed files with 15 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue