diff options
Diffstat (limited to 'src/libirecovery.c')
| -rw-r--r-- | src/libirecovery.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index f8292d1..29a0494 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
| @@ -47,7 +47,7 @@ struct irecv_client_private { | |||
| 47 | int config; | 47 | int config; |
| 48 | int interface; | 48 | int interface; |
| 49 | int alt_interface; | 49 | int alt_interface; |
| 50 | unsigned short mode; | 50 | unsigned int mode; |
| 51 | char serial[256]; | 51 | char serial[256]; |
| 52 | #ifndef WIN32 | 52 | #ifndef WIN32 |
| 53 | libusb_device_handle* handle; | 53 | libusb_device_handle* handle; |
| @@ -206,7 +206,6 @@ irecv_error_t mobiledevice_openpipes(irecv_client_t client); | |||
| 206 | void mobiledevice_closepipes(irecv_client_t client); | 206 | void mobiledevice_closepipes(irecv_client_t client); |
| 207 | 207 | ||
| 208 | irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ecid) { | 208 | irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ecid) { |
| 209 | irecv_error_t ret; | ||
| 210 | int found = 0; | 209 | int found = 0; |
| 211 | SP_DEVICE_INTERFACE_DATA currentInterface; | 210 | SP_DEVICE_INTERFACE_DATA currentInterface; |
| 212 | HDEVINFO usbDevices; | 211 | HDEVINFO usbDevices; |
| @@ -468,12 +467,11 @@ int irecv_usb_control_transfer(irecv_client_t client, uint8_t bm_request_type, u | |||
| 468 | return libusb_control_transfer(client->handle, bm_request_type, b_request, w_value, w_index, data, w_length, timeout); | 467 | return libusb_control_transfer(client->handle, bm_request_type, b_request, w_value, w_index, data, w_length, timeout); |
| 469 | #else | 468 | #else |
| 470 | DWORD count = 0; | 469 | DWORD count = 0; |
| 471 | DWORD ret; | ||
| 472 | BOOL bRet; | 470 | BOOL bRet; |
| 473 | OVERLAPPED overlapped; | 471 | OVERLAPPED overlapped; |
| 474 | 472 | ||
| 475 | if (data == NULL) | 473 | if (data == NULL) |
| 476 | wLength = 0; | 474 | w_length = 0; |
| 477 | 475 | ||
| 478 | usb_control_request* packet = (usb_control_request*) malloc(sizeof(usb_control_request) + w_length); | 476 | usb_control_request* packet = (usb_control_request*) malloc(sizeof(usb_control_request) + w_length); |
| 479 | packet->bmRequestType = bm_request_type; | 477 | packet->bmRequestType = bm_request_type; |
| @@ -489,7 +487,7 @@ int irecv_usb_control_transfer(irecv_client_t client, uint8_t bm_request_type, u | |||
| 489 | memset(&overlapped, 0, sizeof(overlapped)); | 487 | memset(&overlapped, 0, sizeof(overlapped)); |
| 490 | overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); | 488 | overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); |
| 491 | DeviceIoControl(client->handle, 0x2200A0, packet, sizeof(usb_control_request) + w_length, packet, sizeof(usb_control_request) + w_length, NULL, &overlapped); | 489 | DeviceIoControl(client->handle, 0x2200A0, packet, sizeof(usb_control_request) + w_length, packet, sizeof(usb_control_request) + w_length, NULL, &overlapped); |
| 492 | ret = WaitForSingleObject(overlapped.hEvent, timeout); | 490 | WaitForSingleObject(overlapped.hEvent, timeout); |
| 493 | bRet = GetOverlappedResult(client->handle, &overlapped, &count, FALSE); | 491 | bRet = GetOverlappedResult(client->handle, &overlapped, &count, FALSE); |
| 494 | CloseHandle(overlapped.hEvent); | 492 | CloseHandle(overlapped.hEvent); |
| 495 | if (!bRet) { | 493 | if (!bRet) { |
| @@ -752,9 +750,8 @@ irecv_error_t irecv_reset(irecv_client_t client) { | |||
| 752 | #ifndef WIN32 | 750 | #ifndef WIN32 |
| 753 | libusb_reset_device(client->handle); | 751 | libusb_reset_device(client->handle); |
| 754 | #else | 752 | #else |
| 755 | int ret; | ||
| 756 | DWORD count; | 753 | DWORD count; |
| 757 | ret = DeviceIoControl(client->handle, 0x22000C, NULL, 0, NULL, 0, &count, NULL); | 754 | DeviceIoControl(client->handle, 0x22000C, NULL, 0, NULL, 0, &count, NULL); |
| 758 | #endif | 755 | #endif |
| 759 | 756 | ||
| 760 | return IRECV_E_SUCCESS; | 757 | return IRECV_E_SUCCESS; |
