public static LockdownError lockdownd_get_device_name(LockdownClientHandle client, out string deviceName)
        {
            System.Runtime.InteropServices.ICustomMarshaler deviceNameMarshaler = NativeStringMarshaler.GetInstance(null);
            System.IntPtr deviceNameNative = System.IntPtr.Zero;
            LockdownError returnValue      = LockdownNativeMethods.lockdownd_get_device_name(client, out deviceNameNative);

            deviceName = ((string)deviceNameMarshaler.MarshalNativeToManaged(deviceNameNative));
            deviceNameMarshaler.CleanUpNativeData(deviceNameNative);
            return(returnValue);
        }
Esempio n. 2
0
 /// <summary>
 /// Retrieves the name of the device from lockdownd set by the user.
 /// </summary>
 /// <param name="client">
 /// An initialized lockdownd client.
 /// </param>
 /// <param name="device_name">
 /// Holds the name of the device. The caller is
 /// responsible for freeing the memory.
 /// </param>
 /// <returns>
 /// LOCKDOWN_E_SUCCESS on success
 /// </returns>
 public virtual LockdownError lockdownd_get_device_name(LockdownClientHandle client, out string deviceName)
 {
     return(LockdownNativeMethods.lockdownd_get_device_name(client, out deviceName));
 }