mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2024-11-12 01:10:49 +01:00
Fix incorrect SetupDiGetClassDevs error checking
This commit is contained in:
parent
f8b2f5f40d
commit
09b3a6c24a
@ -20,7 +20,7 @@ void dev_list_init(struct dev_list *devs, const GUID *class_guid)
|
||||
devs->infolist = SetupDiGetClassDevs(
|
||||
devs->class_guid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
|
||||
|
||||
if (devs->infolist == NULL) {
|
||||
if (devs->infolist == INVALID_HANDLE_VALUE) {
|
||||
log_fatal(
|
||||
"SetupDiGetClassDevs failed: %08x", (unsigned int) GetLastError());
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ static HANDLE mm_open_device(void)
|
||||
dev_info = SetupDiGetClassDevsW(
|
||||
&hid_guid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
|
||||
|
||||
if (dev_info == NULL) {
|
||||
if (dev_info == INVALID_HANDLE_VALUE) {
|
||||
log_fatal("SetupDiGetClassDevs failed");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user