diff options
Diffstat (limited to 'src/libirecovery.c')
-rw-r--r-- | src/libirecovery.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index 0babf1d..7ddb2b5 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
@@ -1089,15 +1089,14 @@ static irecv_error_t win32_open_with_ecid(irecv_client_t* client, uint64_t ecid) | |||
1089 | { | 1089 | { |
1090 | int found = 0; | 1090 | int found = 0; |
1091 | const GUID *guids[] = { &GUID_DEVINTERFACE_DFU, &GUID_DEVINTERFACE_IBOOT, NULL }; | 1091 | const GUID *guids[] = { &GUID_DEVINTERFACE_DFU, &GUID_DEVINTERFACE_IBOOT, NULL }; |
1092 | SP_DEVICE_INTERFACE_DATA currentInterface; | ||
1093 | HDEVINFO usbDevices; | ||
1094 | DWORD i; | ||
1095 | irecv_client_t _client = (irecv_client_t) malloc(sizeof(struct irecv_client_private)); | 1092 | irecv_client_t _client = (irecv_client_t) malloc(sizeof(struct irecv_client_private)); |
1096 | memset(_client, 0, sizeof(struct irecv_client_private)); | 1093 | memset(_client, 0, sizeof(struct irecv_client_private)); |
1097 | 1094 | ||
1098 | int k; | 1095 | int k; |
1099 | for (k = 0; !found && guids[k]; k++) { | 1096 | for (k = 0; !found && guids[k]; k++) { |
1100 | usbDevices = SetupDiGetClassDevs(guids[k], NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); | 1097 | DWORD i; |
1098 | SP_DEVICE_INTERFACE_DATA currentInterface; | ||
1099 | HDEVINFO usbDevices = SetupDiGetClassDevs(guids[k], NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); | ||
1101 | memset(¤tInterface, '\0', sizeof(SP_DEVICE_INTERFACE_DATA)); | 1100 | memset(¤tInterface, '\0', sizeof(SP_DEVICE_INTERFACE_DATA)); |
1102 | currentInterface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); | 1101 | currentInterface.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); |
1103 | for (i = 0; usbDevices && SetupDiEnumDeviceInterfaces(usbDevices, NULL, guids[k], i, ¤tInterface); i++) { | 1102 | for (i = 0; usbDevices && SetupDiEnumDeviceInterfaces(usbDevices, NULL, guids[k], i, ¤tInterface); i++) { |
@@ -1193,8 +1192,8 @@ static irecv_error_t win32_open_with_ecid(irecv_client_t* client, uint64_t ecid) | |||
1193 | found = 1; | 1192 | found = 1; |
1194 | break; | 1193 | break; |
1195 | } | 1194 | } |
1195 | SetupDiDestroyDeviceInfoList(usbDevices); | ||
1196 | } | 1196 | } |
1197 | SetupDiDestroyDeviceInfoList(usbDevices); | ||
1198 | 1197 | ||
1199 | if (!found) { | 1198 | if (!found) { |
1200 | irecv_close(_client); | 1199 | irecv_close(_client); |