fix #10446
This commit is contained in:
parent
15def36dd6
commit
9fe1ff0165
@ -385,11 +385,13 @@ LONG RegQueryValueExW(HKEY hKey, LPCWSTR lpValueName, LPDWORD lpReserved, LPDWOR
|
||||
case REG_DWORD_BIG_ENDIAN:
|
||||
case REG_QWORD:
|
||||
case REG_DWORD:
|
||||
return reg_read_int(pValue, lpData, lpcbData);
|
||||
status = reg_read_int(pValue, lpData, lpcbData);
|
||||
goto end;
|
||||
case REG_SZ:
|
||||
{
|
||||
const size_t length = strnlen(pValue->data.string, UINT32_MAX) * sizeof(WCHAR);
|
||||
|
||||
status = ERROR_SUCCESS;
|
||||
if (lpData != NULL)
|
||||
{
|
||||
DWORD size = 0;
|
||||
@ -404,14 +406,13 @@ LONG RegQueryValueExW(HKEY hKey, LPCWSTR lpValueName, LPDWORD lpReserved, LPDWOR
|
||||
size = *lpcbData;
|
||||
*lpcbData = (DWORD)length;
|
||||
if (size < length)
|
||||
return ERROR_MORE_DATA;
|
||||
status = ERROR_MORE_DATA;
|
||||
if (ConvertUtf8NToWChar(pValue->data.string, length, cnv.wc, length) < 0)
|
||||
return ERROR_OUTOFMEMORY;
|
||||
status = ERROR_OUTOFMEMORY;
|
||||
}
|
||||
else if (lpcbData)
|
||||
*lpcbData = (UINT32)length;
|
||||
|
||||
status = ERROR_SUCCESS;
|
||||
goto end;
|
||||
}
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user