From d8a67df857163462c9ddfabb854746388cdb515d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uldis=20Kalni=C5=86=C5=A1?= Date: Tue, 20 Oct 2020 16:12:35 +0300 Subject: [PATCH] Allocate ref on stack instead of the type itself for AFC service startup --- src/ios-deploy/MobileDevice.h | 4 ++-- src/ios-deploy/ios-deploy.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ios-deploy/MobileDevice.h b/src/ios-deploy/MobileDevice.h index 637890ba..b47e0b0a 100644 --- a/src/ios-deploy/MobileDevice.h +++ b/src/ios-deploy/MobileDevice.h @@ -268,7 +268,7 @@ mach_error_t AMDeviceStartSession(struct am_device *device); */ mach_error_t AMDeviceStartService(struct am_device *device, CFStringRef - service_name, ServiceConnRef handle, unsigned int * + service_name, ServiceConnRef * handle, unsigned int * unknown); mach_error_t AMDeviceStartHouseArrestService(struct am_device *device, CFStringRef identifier, void *unknown, ServiceConnRef handle, unsigned int *what); @@ -290,7 +290,7 @@ mach_error_t AMDeviceStopSession(struct am_device *device); * MDERR_AFC_OUT_OF_MEMORY if malloc() failed */ -afc_error_t AFCConnectionOpen(service_conn_t handle, unsigned int io_timeout, +afc_error_t AFCConnectionOpen(ServiceConnRef handle, unsigned int io_timeout, AFCConnectionRef *conn); /* Pass in a pointer to an afc_device_info structure. It will be filled. */ diff --git a/src/ios-deploy/ios-deploy.m b/src/ios-deploy/ios-deploy.m index 175478bc..fbfb4d72 100644 --- a/src/ios-deploy/ios-deploy.m +++ b/src/ios-deploy/ios-deploy.m @@ -1520,7 +1520,7 @@ AFCConnectionRef start_afc_service(AMDeviceRef device) { check_error(AMDeviceStartSession(device)); AFCConnectionRef conn = NULL; - service_conn_t serviceConn; + ServiceConnRef serviceConn = NULL; if (AMDeviceStartService(device, AMSVC_AFC, &serviceConn, 0) != MDERR_OK) { on_error(@"Unable to start file service!");