mirror of
https://github.com/reactos/reactos
synced 2025-10-06 00:12:51 +02:00
[MSGINA] ReadRegDwordValue(): Return valid errors on data validation (#8370)
This commit is contained in:
@@ -53,13 +53,15 @@ ReadRegDwordValue(
|
||||
|
||||
cbData = sizeof(dwValue);
|
||||
rc = RegQueryValueExW(hKey, pszValue, NULL, &dwType, (PBYTE)&dwValue, &cbData);
|
||||
if ((rc == ERROR_SUCCESS) && (dwType == REG_DWORD) && (cbData == sizeof(dwValue)))
|
||||
{
|
||||
*pValue = dwValue;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
if (rc != ERROR_SUCCESS)
|
||||
return rc;
|
||||
if (dwType != REG_DWORD)
|
||||
return ERROR_UNSUPPORTED_TYPE;
|
||||
if (cbData != sizeof(dwValue))
|
||||
return ERROR_INVALID_DATA; // ERROR_DATATYPE_MISMATCH;
|
||||
|
||||
return rc;
|
||||
*pValue = dwValue;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
PWSTR
|
||||
|
Reference in New Issue
Block a user