diff options
| -rw-r--r-- | src/libirecovery.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index e150e84..f53ca45 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c | |||
| @@ -36,7 +36,6 @@ | |||
| 36 | #else | 36 | #else |
| 37 | #define WIN32_LEAN_AND_MEAN | 37 | #define WIN32_LEAN_AND_MEAN |
| 38 | #include <windows.h> | 38 | #include <windows.h> |
| 39 | #undef interface | ||
| 40 | #include <setupapi.h> | 39 | #include <setupapi.h> |
| 41 | #define _FMT_qX "%I64X" | 40 | #define _FMT_qX "%I64X" |
| 42 | #define _FMT_016llx "%016I64x" | 41 | #define _FMT_016llx "%016I64x" |
| @@ -59,9 +58,9 @@ | |||
| 59 | 58 | ||
| 60 | struct irecv_client_private { | 59 | struct irecv_client_private { |
| 61 | int debug; | 60 | int debug; |
| 62 | int config; | 61 | int usb_config; |
| 63 | int interface; | 62 | int usb_interface; |
| 64 | int alt_interface; | 63 | int usb_alt_interface; |
| 65 | unsigned int mode; | 64 | unsigned int mode; |
| 66 | struct irecv_device_info device_info; | 65 | struct irecv_device_info device_info; |
| 67 | #ifndef WIN32 | 66 | #ifndef WIN32 |
| @@ -798,7 +797,7 @@ IRECV_API irecv_error_t irecv_open_with_ecid(irecv_client_t* pclient, unsigned l | |||
| 798 | } | 797 | } |
| 799 | 798 | ||
| 800 | memset(client, '\0', sizeof(struct irecv_client_private)); | 799 | memset(client, '\0', sizeof(struct irecv_client_private)); |
| 801 | client->interface = 0; | 800 | client->usb_interface = 0; |
| 802 | client->handle = usb_handle; | 801 | client->handle = usb_handle; |
| 803 | client->mode = usb_descriptor.idProduct; | 802 | client->mode = usb_descriptor.idProduct; |
| 804 | 803 | ||
| @@ -887,7 +886,7 @@ IRECV_API irecv_error_t irecv_usb_set_configuration(irecv_client_t client, int c | |||
| 887 | } | 886 | } |
| 888 | } | 887 | } |
| 889 | 888 | ||
| 890 | client->config = configuration; | 889 | client->usb_config = configuration; |
| 891 | #endif | 890 | #endif |
| 892 | 891 | ||
| 893 | return IRECV_E_SUCCESS; | 892 | return IRECV_E_SUCCESS; |
| @@ -911,8 +910,8 @@ IRECV_API irecv_error_t irecv_usb_set_interface(irecv_client_t client, int usb_i | |||
| 911 | return IRECV_E_USB_INTERFACE; | 910 | return IRECV_E_USB_INTERFACE; |
| 912 | } | 911 | } |
| 913 | #endif | 912 | #endif |
| 914 | client->interface = usb_interface; | 913 | client->usb_interface = usb_interface; |
| 915 | client->alt_interface = usb_alt_interface; | 914 | client->usb_alt_interface = usb_alt_interface; |
| 916 | 915 | ||
| 917 | return IRECV_E_SUCCESS; | 916 | return IRECV_E_SUCCESS; |
| 918 | } | 917 | } |
| @@ -1023,7 +1022,7 @@ IRECV_API irecv_error_t irecv_close(irecv_client_t client) { | |||
| 1023 | #ifndef WIN32 | 1022 | #ifndef WIN32 |
| 1024 | if (client->handle != NULL) { | 1023 | if (client->handle != NULL) { |
| 1025 | if ((client->mode != IRECV_K_DFU_MODE) && (client->mode != IRECV_K_WTF_MODE)) { | 1024 | if ((client->mode != IRECV_K_DFU_MODE) && (client->mode != IRECV_K_WTF_MODE)) { |
| 1026 | libusb_release_interface(client->handle, client->interface); | 1025 | libusb_release_interface(client->handle, client->usb_interface); |
| 1027 | } | 1026 | } |
| 1028 | libusb_close(client->handle); | 1027 | libusb_close(client->handle); |
| 1029 | client->handle = NULL; | 1028 | client->handle = NULL; |
