https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9f4e8ef25b53d27494efa…
commit 9f4e8ef25b53d27494efab569288452fbaa1cdfa
Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Tue Feb 11 17:36:12 2020 +0100
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Feb 11 17:36:12 2020 +0100
[SHELL32] DoGetProductType(): Check RegQueryValueExW() dwType (#2331)
---
dll/win32/shell32/wine/shellpath.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dll/win32/shell32/wine/shellpath.c b/dll/win32/shell32/wine/shellpath.c
index 3c7ee6a3529..b65b37438d5 100644
--- a/dll/win32/shell32/wine/shellpath.c
+++ b/dll/win32/shell32/wine/shellpath.c
@@ -67,11 +67,11 @@ typedef enum _NT_PRODUCT_TYPE
static BOOL
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;
LONG error;
WCHAR szValue[32];
- DWORD cbValue;
+ DWORD cbValue, dwType;
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, NULL, (LPBYTE)szValue,
&cbValue);
- if (!error)
+ error = RegQueryValueExW(hKey, L"ProductType", NULL, &dwType,
(LPBYTE)szValue, &cbValue);
+ if (!error && dwType == REG_SZ)
{
if (lstrcmpW(szValue, L"WinNT") == 0)
*ProductType = NtProductWinNt;