/// <summary> /// Creates a new <see cref="ServiceClientHandle"/> 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 ServiceClientHandle DangerousCreate(System.IntPtr unsafeHandle, bool ownsHandle) { ServiceClientHandle safeHandle = new ServiceClientHandle(ownsHandle); safeHandle.SetHandle(unsafeHandle); return(safeHandle); }
public object MarshalNativeToManaged(System.IntPtr nativeData) { return(ServiceClientHandle.DangerousCreate(nativeData, false)); }
/// <summary> /// Creates a new service for the specified service descriptor. /// </summary> /// <param name="device"> /// The device to connect to. /// </param> /// <param name="service"> /// The service descriptor returned by lockdownd_start_service. /// </param> /// <param name="client"> /// Pointer that will be set to a newly allocated /// service_client_t upon successful return. /// </param> /// <returns> /// SERVICE_E_SUCCESS on success, /// SERVICE_E_INVALID_ARG when one of the arguments is invalid, /// or SERVICE_E_MUX_ERROR when connecting to the device failed. /// </returns> public virtual ServiceError service_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out ServiceClientHandle client) { ServiceError returnValue; returnValue = ServiceNativeMethods.service_client_new(device, service, out client); client.Api = this.Parent; return(returnValue); }
/// <summary> /// Disable SSL for the given service client. /// </summary> /// <param name="client"> /// The connected service client for that SSL should be disabled. /// </param> /// <returns> /// SERVICE_E_SUCCESS on success, /// SERVICE_E_INVALID_ARG if client or client->connection is /// NULL, or SERVICE_E_UNKNOWN_ERROR otherwise. /// </returns> public virtual ServiceError service_disable_ssl(ServiceClientHandle client) { return(ServiceNativeMethods.service_disable_ssl(client)); }
/// <summary> /// Receives data using the given service client. /// </summary> /// <param name="client"> /// The service client to use for receiving /// </param> /// <param name="data"> /// Buffer that will be filled with the data received /// </param> /// <param name="size"> /// Number of bytes to receive /// </param> /// <param name="received"> /// Number of bytes received (can be NULL to ignore) /// </param> /// <returns> /// SERVICE_E_SUCCESS on success, /// SERVICE_E_INVALID_ARG when one or more parameters are /// invalid, SERVICE_E_MUX_ERROR when a communication error /// occurs, or SERVICE_E_UNKNOWN_ERROR when an unspecified /// error occurs. /// </returns> public virtual ServiceError service_receive(ServiceClientHandle client, byte[] data, uint size, ref uint received) { return(ServiceNativeMethods.service_receive(client, data, size, ref received)); }
/// <summary> /// Receives data using the given service client with specified timeout. /// </summary> /// <param name="client"> /// The service client to use for receiving /// </param> /// <param name="data"> /// Buffer that will be filled with the data received /// </param> /// <param name="size"> /// Number of bytes to receive /// </param> /// <param name="received"> /// Number of bytes received (can be NULL to ignore) /// </param> /// <param name="timeout"> /// Maximum time in milliseconds to wait for data. /// </param> /// <returns> /// SERVICE_E_SUCCESS on success, /// SERVICE_E_INVALID_ARG when one or more parameters are /// invalid, SERVICE_E_MUX_ERROR when a communication error /// occurs, or SERVICE_E_UNKNOWN_ERROR when an unspecified /// error occurs. /// </returns> public virtual ServiceError service_receive_with_timeout(ServiceClientHandle client, byte[] data, uint size, ref uint received, uint timeout) { return(ServiceNativeMethods.service_receive_with_timeout(client, data, size, ref received, timeout)); }
/// <summary> /// Sends data using the given service client. /// </summary> /// <param name="client"> /// The service client to use for sending. /// </param> /// <param name="data"> /// Data to send /// </param> /// <param name="size"> /// Size of the data to send /// </param> /// <param name="sent"> /// Number of bytes sent (can be NULL to ignore) /// </param> /// <returns> /// SERVICE_E_SUCCESS on success, /// SERVICE_E_INVALID_ARG when one or more parameters are /// invalid, or SERVICE_E_UNKNOWN_ERROR when an unspecified /// error occurs. /// </returns> public virtual ServiceError service_send(ServiceClientHandle client, byte[] data, uint size, ref uint sent) { return(ServiceNativeMethods.service_send(client, data, size, ref sent)); }
public static extern ServiceError service_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out ServiceClientHandle client);
public static extern ServiceError service_disable_ssl(ServiceClientHandle client);
public static extern ServiceError service_receive(ServiceClientHandle client, byte[] data, uint size, ref uint received);
public static extern ServiceError service_receive_with_timeout(ServiceClientHandle client, byte[] data, uint size, ref uint received, uint timeout);
public static extern ServiceError service_send(ServiceClientHandle client, byte[] data, uint size, ref uint sent);
/// <summary> /// Disable SSL for the given service client without sending SSL terminate messages. /// </summary> /// <param name="client"> /// The connected service client for that SSL should be disabled. /// </param> /// <returns> /// SERVICE_E_SUCCESS on success, /// SERVICE_E_INVALID_ARG if client or client->connection is /// NULL, or SERVICE_E_UNKNOWN_ERROR otherwise. /// </returns> public virtual ServiceError service_disable_bypass_ssl(ServiceClientHandle client, char sslbypass) { return(ServiceNativeMethods.service_disable_bypass_ssl(client, sslbypass)); }
public static extern ServiceError service_disable_bypass_ssl(ServiceClientHandle client, char sslbypass);
/// <summary> /// Creates a new <see cref="ServiceClientHandle"/> from a <see cref="IntPtr"/>. /// </summary> /// <param name="unsafeHandle"> /// The underlying <see cref="IntPtr"/> /// </param> /// <returns> /// </returns> public static ServiceClientHandle DangerousCreate(System.IntPtr unsafeHandle) { return(ServiceClientHandle.DangerousCreate(unsafeHandle, true)); }