mirror of
https://github.com/reactos/wine.git
synced 2024-11-29 14:40:56 +00:00
setupapi: Fix a structure size check for 64-bit.
This commit is contained in:
parent
fdf191a9e0
commit
aaf908ab32
@ -2916,8 +2916,7 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailA(
|
||||
{
|
||||
struct DeviceInfoSet *set = DeviceInfoSet;
|
||||
struct InterfaceInfo *info;
|
||||
DWORD bytesNeeded = offsetof(SP_DEVICE_INTERFACE_DETAIL_DATA_A, DevicePath)
|
||||
+ 1;
|
||||
DWORD bytesNeeded = FIELD_OFFSET(SP_DEVICE_INTERFACE_DETAIL_DATA_A, DevicePath[1]);
|
||||
BOOL ret = FALSE;
|
||||
|
||||
TRACE("(%p, %p, %p, %d, %p, %p)\n", DeviceInfoSet,
|
||||
@ -2937,8 +2936,8 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailA(
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
if (DeviceInterfaceDetailData && (DeviceInterfaceDetailData->cbSize !=
|
||||
offsetof(SP_DEVICE_INTERFACE_DETAIL_DATA_A, DevicePath) + sizeof(char)))
|
||||
if (DeviceInterfaceDetailData &&
|
||||
DeviceInterfaceDetailData->cbSize != sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A))
|
||||
{
|
||||
SetLastError(ERROR_INVALID_USER_BUFFER);
|
||||
return FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user