Last active
September 3, 2016 00:34
-
-
Save drojf/ac923314ba3bf11e4de0c92b045453a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Make sure this device is of Setup Class "HIDClass" and has a driver bound to it. */ | |
i = device_index | |
char driver_name[256]; | |
/* Populate devinfo_data. This function will return failure | |
when there are no more interfaces left. */ | |
res = SetupDiEnumDeviceInfo(device_info_set, i, &devinfo_data); | |
if (!res) | |
goto cont; | |
res = SetupDiGetDeviceRegistryPropertyA(device_info_set, &devinfo_data, | |
SPDRP_CLASS, NULL, (PBYTE)driver_name, sizeof(driver_name), NULL); | |
if (!res) | |
goto cont; | |
if (strcmp(driver_name, "HIDClass") != 0) { | |
goto cont; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment