1
0
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:
ahnada 2023-11-12 17:44:01 -08:00 committed by icex2
parent f8b2f5f40d
commit 09b3a6c24a
2 changed files with 2 additions and 2 deletions

View File

@ -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());
}

View File

@ -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");
}