setupapi: Always return device info from SetupDiGetDeviceInterfaceDetail() if requested.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
26dd015fdd
commit
2d6704ba99
|
@ -2702,9 +2702,6 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailA(HDEVINFO devinfo, SP_DEVICE_INTERFA
|
||||||
else
|
else
|
||||||
DeviceInterfaceDetailData->DevicePath[0] = '\0';
|
DeviceInterfaceDetailData->DevicePath[0] = '\0';
|
||||||
|
|
||||||
if (device_data && device_data->cbSize == sizeof(SP_DEVINFO_DATA))
|
|
||||||
copy_device_data(device_data, iface->device);
|
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2713,6 +2710,10 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailA(HDEVINFO devinfo, SP_DEVICE_INTERFA
|
||||||
*RequiredSize = bytesNeeded;
|
*RequiredSize = bytesNeeded;
|
||||||
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device_data && device_data->cbSize == sizeof(SP_DEVINFO_DATA))
|
||||||
|
copy_device_data(device_data, iface->device);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2757,9 +2758,6 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailW(HDEVINFO devinfo, SP_DEVICE_INTERFA
|
||||||
else
|
else
|
||||||
DeviceInterfaceDetailData->DevicePath[0] = '\0';
|
DeviceInterfaceDetailData->DevicePath[0] = '\0';
|
||||||
|
|
||||||
if (device_data && device_data->cbSize == sizeof(SP_DEVINFO_DATA))
|
|
||||||
copy_device_data(device_data, iface->device);
|
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2768,6 +2766,10 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailW(HDEVINFO devinfo, SP_DEVICE_INTERFA
|
||||||
*RequiredSize = bytesNeeded;
|
*RequiredSize = bytesNeeded;
|
||||||
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device_data && device_data->cbSize == sizeof(SP_DEVINFO_DATA))
|
||||||
|
copy_device_data(device_data, iface->device);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -752,6 +752,13 @@ static void test_device_iface_detail(void)
|
||||||
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got unexpected error %#x.\n", GetLastError());
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got unexpected error %#x.\n", GetLastError());
|
||||||
ok(size == expectedsize, "Got unexpected size %d.\n", size);
|
ok(size == expectedsize, "Got unexpected size %d.\n", size);
|
||||||
|
|
||||||
|
memset(&device, 0, sizeof(device));
|
||||||
|
device.cbSize = sizeof(device);
|
||||||
|
ret = SetupDiGetDeviceInterfaceDetailW(set, &iface, NULL, 0, &size, &device);
|
||||||
|
ok(!ret, "Expected failure.\n");
|
||||||
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got unexpected error %#x.\n", GetLastError());
|
||||||
|
ok(IsEqualGUID(&device.ClassGuid, &guid), "Got unexpected class %s.\n", wine_dbgstr_guid(&device.ClassGuid));
|
||||||
|
|
||||||
heap_free(detail);
|
heap_free(detail);
|
||||||
SetupDiDestroyDeviceInfoList(set);
|
SetupDiDestroyDeviceInfoList(set);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue