unsafe private void NotifyCallback(ref AMDeviceNotificationCallbackInfo callback) { if (callback.msg == NotificationMessage.Connected) { iDeviceHandle = callback.dev; //ConnectToPhone(); int connectID = MobileDevice.AMDeviceGetConnectionID(iDeviceHandle); void * rd = MobileDevice.AMRestoreModeDeviceCreate(0, connectID, 0); int i = MobileDevice.AMRestoreModeDeviceGetLocationID(rd); IntPtr p2 = MobileDevice.AMRestoreModeDeviceGetDeviceID(rd); MobileDevice.AMRestoreModeDeviceReboot(rd); //IntPtr p1 = MobileDevice.AMRestoreModeDeviceCopySerialNumber(iDeviceHandle); //CoreFoundation.CFString str_srnm = new CoreFoundation.CFString(p1); //if (ConnectToPhone()) { OnConnect(new ConnectEventArgs(callback)); } } else if (callback.msg == NotificationMessage.Disconnected) { connected = false; OnDisconnect(new ConnectEventArgs(callback)); } }