mirror of
https://github.com/reactos/wine.git
synced 2024-11-29 06:30:37 +00:00
setupapi: SetupDiGetDeviceRegistryProperty should return ERROR_INVALID_DATA when buffer size is not 0 but buffer is NULL.
This commit is contained in:
parent
85861a4999
commit
af5e168f16
@ -3110,6 +3110,11 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyA(
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
if (PropertyBufferSize && PropertyBuffer == NULL)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_DATA);
|
||||
return FALSE;
|
||||
}
|
||||
devInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
|
||||
if (Property < sizeof(PropertyMap) / sizeof(PropertyMap[0])
|
||||
&& PropertyMap[Property].nameA)
|
||||
@ -3166,6 +3171,11 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
if (PropertyBufferSize && PropertyBuffer == NULL)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_DATA);
|
||||
return FALSE;
|
||||
}
|
||||
devInfo = (struct DeviceInfo *)DeviceInfoData->Reserved;
|
||||
if (Property < sizeof(PropertyMap) / sizeof(PropertyMap[0])
|
||||
&& PropertyMap[Property].nameW)
|
||||
|
@ -917,7 +917,6 @@ static void testDeviceRegistryPropertyA()
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = pSetupDiGetDeviceRegistryPropertyA(set, &devInfo, SPDRP_FRIENDLYNAME,
|
||||
NULL, NULL, buflen, NULL);
|
||||
todo_wine
|
||||
ok(!ret && GetLastError() == ERROR_INVALID_DATA,
|
||||
"Expected ERROR_INVALID_DATA, got %08x\n", GetLastError());
|
||||
SetLastError(0xdeadbeef);
|
||||
@ -1011,7 +1010,6 @@ static void testDeviceRegistryPropertyW()
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = pSetupDiGetDeviceRegistryPropertyW(set, &devInfo, SPDRP_FRIENDLYNAME,
|
||||
NULL, NULL, buflen, NULL);
|
||||
todo_wine
|
||||
ok(!ret && GetLastError() == ERROR_INVALID_DATA,
|
||||
"Expected ERROR_INVALID_DATA, got %08x\n", GetLastError());
|
||||
SetLastError(0xdeadbeef);
|
||||
|
Loading…
Reference in New Issue
Block a user