mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2025-02-21 12:52:07 +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->infolist = SetupDiGetClassDevs(
|
||||||
devs->class_guid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
|
devs->class_guid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
|
||||||
|
|
||||||
if (devs->infolist == NULL) {
|
if (devs->infolist == INVALID_HANDLE_VALUE) {
|
||||||
log_fatal(
|
log_fatal(
|
||||||
"SetupDiGetClassDevs failed: %08x", (unsigned int) GetLastError());
|
"SetupDiGetClassDevs failed: %08x", (unsigned int) GetLastError());
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ static HANDLE mm_open_device(void)
|
|||||||
dev_info = SetupDiGetClassDevsW(
|
dev_info = SetupDiGetClassDevsW(
|
||||||
&hid_guid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
|
&hid_guid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
|
||||||
|
|
||||||
if (dev_info == NULL) {
|
if (dev_info == INVALID_HANDLE_VALUE) {
|
||||||
log_fatal("SetupDiGetClassDevs failed");
|
log_fatal("SetupDiGetClassDevs failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user