mirror of
https://github.com/reactos/reactos.git
synced 2024-09-29 14:09:10 +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";
|
static const WCHAR ProductOptions[] = L"SYSTEM\\CurrentControlSet\\Control\\ProductOptions";
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
LONG error;
|
LONG error;
|
||||||
WCHAR szValue[32];
|
WCHAR szValue[9];
|
||||||
DWORD cbValue, dwType;
|
DWORD cbValue;
|
||||||
static DWORD s_dwProductType = 0;
|
static DWORD s_dwProductType = 0;
|
||||||
|
|
||||||
if (s_dwProductType != 0)
|
if (s_dwProductType != 0)
|
||||||
|
@ -87,8 +87,8 @@ DoGetProductType(PNT_PRODUCT_TYPE ProductType)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
cbValue = sizeof(szValue);
|
cbValue = sizeof(szValue);
|
||||||
error = RegQueryValueExW(hKey, L"ProductType", NULL, &dwType, (LPBYTE)szValue, &cbValue);
|
error = RegGetValueW(hKey, NULL, L"ProductType", RRF_RT_REG_SZ, NULL, (PVOID)szValue, &cbValue);
|
||||||
if (!error && dwType == REG_SZ)
|
if (!error)
|
||||||
{
|
{
|
||||||
if (lstrcmpW(szValue, L"WinNT") == 0)
|
if (lstrcmpW(szValue, L"WinNT") == 0)
|
||||||
*ProductType = NtProductWinNt;
|
*ProductType = NtProductWinNt;
|
||||||
|
|
Loading…
Reference in a new issue