public static LockdownError lockdownd_start_session(LockdownClientHandle client, string hostId, out string sessionId, ref int sslEnabled) { System.Runtime.InteropServices.ICustomMarshaler sessionIdMarshaler = NativeStringMarshaler.GetInstance(null); System.IntPtr sessionIdNative = System.IntPtr.Zero; LockdownError returnValue = LockdownNativeMethods.lockdownd_start_session(client, hostId, out sessionIdNative, ref sslEnabled); sessionId = ((string)sessionIdMarshaler.MarshalNativeToManaged(sessionIdNative)); sessionIdMarshaler.CleanUpNativeData(sessionIdNative); return(returnValue); }
/// <summary> /// Opens a session with lockdownd and switches to SSL mode if device wants it. /// </summary> /// <param name="client"> /// The lockdownd client /// </param> /// <param name="host_id"> /// The HostID of the computer /// </param> /// <param name="session_id"> /// The new session_id of the created session /// </param> /// <param name="ssl_enabled"> /// Whether SSL communication is used in the session /// </param> /// <returns> /// LOCKDOWN_E_SUCCESS on success, LOCKDOWN_E_INVALID_ARG when a client /// or host_id is NULL, LOCKDOWN_E_PLIST_ERROR if the response plist had errors, /// LOCKDOWN_E_INVALID_HOST_ID if the device does not know the supplied HostID, /// LOCKDOWN_E_SSL_ERROR if enabling SSL communication failed /// </returns> public virtual LockdownError lockdownd_start_session(LockdownClientHandle client, string hostId, out string sessionId, ref int sslEnabled) { return(LockdownNativeMethods.lockdownd_start_session(client, hostId, out sessionId, ref sslEnabled)); }