mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 18:01:07 +00:00
[SHELL32] DoGetProductType(): Use RegGetValueW()
instead of RegQueryValueExW(), to enforce a null terminator.
Addendum to 9f4e8ef25b
.
This commit is contained in:
parent
2505bd3a43
commit
a7e4d66be5
|
@ -70,8 +70,8 @@ DoGetProductType(PNT_PRODUCT_TYPE ProductType)
|
|||
static const WCHAR ProductOptions[] = L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions";
|
||||
HKEY hKey;
|
||||
LONG error;
|
||||
WCHAR szValue[32];
|
||||
DWORD cbValue, dwType;
|
||||
WCHAR szValue[9];
|
||||
DWORD cbValue;
|
||||
static DWORD s_dwProductType = 0;
|
||||
|
||||
if (s_dwProductType != 0)
|
||||
|
@ -87,8 +87,8 @@ DoGetProductType(PNT_PRODUCT_TYPE ProductType)
|
|||
return FALSE;
|
||||
|
||||
cbValue = sizeof(szValue);
|
||||
error = RegQueryValueExW(hKey, L"ProductType", NULL, &dwType, (LPBYTE)szValue, &cbValue);
|
||||
if (!error && dwType == REG_SZ)
|
||||
error = RegGetValueW(hKey, NULL, L"ProductType", RRF_RT_REG_SZ, NULL, (PVOID)szValue, &cbValue);
|
||||
if (!error)
|
||||
{
|
||||
if (lstrcmpW(szValue, L"WinNT") == 0)
|
||||
*ProductType = NtProductWinNt;
|
||||
|
|
Loading…
Reference in a new issue