public static List <RawMtpDevice> Detect() { int count = 0; IntPtr ptr = IntPtr.Zero; LIBMTP_Detect_Raw_Devices(ref ptr, ref count); List <RawMtpDevice> devices = new List <RawMtpDevice>(); for (int i = 0; i < count; i++) { IntPtr offset = Offset(ptr, i * Marshal.SizeOf(typeof(RawDeviceStruct))); RawDeviceStruct d = (RawDeviceStruct)Marshal.PtrToStructure(offset, typeof(RawDeviceStruct)); devices.Add(new RawMtpDevice(d)); } return(devices); }
internal RawMtpDevice(RawDeviceStruct device) { RawDevice = device; }
private static extern IntPtr LIBMTP_Open_Raw_Device(ref RawDeviceStruct rawdevice);
internal RawMtpDevice (RawDeviceStruct device) { RawDevice = device; }
private static extern IntPtr LIBMTP_Open_Raw_Device (ref RawDeviceStruct rawdevice);