mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 22:47:28 +00:00
[SHELL32] DoGetProductType(): Check RegQueryValueExW() dwType (#2331)
This commit is contained in:
parent
9199c90328
commit
9f4e8ef25b
|
@ -67,11 +67,11 @@ typedef enum _NT_PRODUCT_TYPE
|
||||||
static BOOL
|
static BOOL
|
||||||
DoGetProductType(PNT_PRODUCT_TYPE ProductType)
|
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[32];
|
||||||
DWORD cbValue;
|
DWORD cbValue, dwType;
|
||||||
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, NULL, (LPBYTE)szValue, &cbValue);
|
error = RegQueryValueExW(hKey, L"ProductType", NULL, &dwType, (LPBYTE)szValue, &cbValue);
|
||||||
if (!error)
|
if (!error && dwType == REG_SZ)
|
||||||
{
|
{
|
||||||
if (lstrcmpW(szValue, L"WinNT") == 0)
|
if (lstrcmpW(szValue, L"WinNT") == 0)
|
||||||
*ProductType = NtProductWinNt;
|
*ProductType = NtProductWinNt;
|
||||||
|
|
Loading…
Reference in a new issue