/// <summary> /// Creates a new <see cref="LockdownPairRecordHandle"/> from a <see cref="IntPtr"/>. /// </summary> /// <param name="unsafeHandle"> /// The underlying <see cref="IntPtr"/> /// </param> /// <param name="ownsHandle"> /// <see langword="true"/> to reliably release the handle during the finalization phase; <see langword="false"/> to prevent reliable release (not recommended). /// </param> /// <returns> /// </returns> public static LockdownPairRecordHandle DangerousCreate(System.IntPtr unsafeHandle, bool ownsHandle) { LockdownPairRecordHandle safeHandle = new LockdownPairRecordHandle(ownsHandle); safeHandle.SetHandle(unsafeHandle); return(safeHandle); }
public object MarshalNativeToManaged(System.IntPtr nativeData) { return(LockdownPairRecordHandle.DangerousCreate(nativeData, false)); }
/// <summary> /// Creates a new <see cref="LockdownPairRecordHandle"/> from a <see cref="IntPtr"/>. /// </summary> /// <param name="unsafeHandle"> /// The underlying <see cref="IntPtr"/> /// </param> /// <returns> /// </returns> public static LockdownPairRecordHandle DangerousCreate(System.IntPtr unsafeHandle) { return(LockdownPairRecordHandle.DangerousCreate(unsafeHandle, true)); }
/// <summary> /// Unpairs the device with the given HostID and removes the pairing records /// from the device and host if the internal pairing record management is used. /// </summary> /// <param name="client"> /// The lockdown client /// </param> /// <param name="pair_record"> /// The pair record to use for unpair. If NULL is passed, then /// the pair records from the current machine are used. /// </param> /// <returns> /// LOCKDOWN_E_SUCCESS on success, LOCKDOWN_E_INVALID_ARG when client is NULL, /// LOCKDOWN_E_PLIST_ERROR if the pair_record certificates are wrong, /// LOCKDOWN_E_PAIRING_FAILED if the pairing failed, /// LOCKDOWN_E_PASSWORD_PROTECTED if the device is password protected, /// LOCKDOWN_E_INVALID_HOST_ID if the device does not know the caller's host id /// </returns> public virtual LockdownError lockdownd_unpair(LockdownClientHandle client, LockdownPairRecordHandle pairRecord) { return(LockdownNativeMethods.lockdownd_unpair(client, pairRecord)); }
/// <summary> /// Pairs the device using the supplied pair record and passing the given options. /// </summary> /// <param name="client"> /// The lockdown client /// </param> /// <param name="pair_record"> /// The pair record to use for pairing. If NULL is passed, then /// the pair records from the current machine are used. New records will be /// generated automatically when pairing is done for the first time. /// </param> /// <param name="options"> /// The pairing options to pass. Can be NULL for no options. /// </param> /// <param name="response"> /// If non-NULL a pointer to lockdownd's response dictionary is returned. /// The caller is responsible to free the response dictionary with plist_free(). /// </param> /// <returns> /// LOCKDOWN_E_SUCCESS on success, LOCKDOWN_E_INVALID_ARG when client is NULL, /// LOCKDOWN_E_PLIST_ERROR if the pair_record certificates are wrong, /// LOCKDOWN_E_PAIRING_FAILED if the pairing failed, /// LOCKDOWN_E_PASSWORD_PROTECTED if the device is password protected, /// LOCKDOWN_E_INVALID_HOST_ID if the device does not know the caller's host id /// </returns> public virtual LockdownError lockdownd_pair_with_options(LockdownClientHandle client, LockdownPairRecordHandle pairRecord, PlistHandle options, out PlistHandle response) { LockdownError returnValue; returnValue = LockdownNativeMethods.lockdownd_pair_with_options(client, pairRecord, options, out response); response.Api = this.Parent; return(returnValue); }
public static extern LockdownError lockdownd_unpair(LockdownClientHandle client, LockdownPairRecordHandle pairRecord);
public static extern LockdownError lockdownd_pair_with_options(LockdownClientHandle client, LockdownPairRecordHandle pairRecord, PlistHandle options, out PlistHandle response);