public static AfcError afc_get_device_info_key(AfcClientHandle client, string key, out string value)
        {
            System.Runtime.InteropServices.ICustomMarshaler valueMarshaler = NativeStringMarshaler.GetInstance(null);
            System.IntPtr valueNative = System.IntPtr.Zero;
            AfcError      returnValue = AfcNativeMethods.afc_get_device_info_key(client, key, out valueNative);

            value = ((string)valueMarshaler.MarshalNativeToManaged(valueNative));
            valueMarshaler.CleanUpNativeData(valueNative);
            return(returnValue);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Get a specific key of the device info list for a client connection.
 /// Known key values are: Model, FSTotalBytes, FSFreeBytes and FSBlockSize.
 /// This is a helper function for afc_get_device_info().
 /// </summary>
 /// <param name="client">
 /// The client to get device info for.
 /// </param>
 /// <param name="key">
 /// The key to get the value of.
 /// </param>
 /// <param name="value">
 /// The value for the key if successful or NULL otherwise.
 /// </param>
 /// <returns>
 /// AFC_E_SUCCESS on success or an AFC_E_* error value.
 /// </returns>
 public virtual AfcError afc_get_device_info_key(AfcClientHandle client, string key, out string value)
 {
     return(AfcNativeMethods.afc_get_device_info_key(client, key, out value));
 }