Beispiel #1
0
        /// <summary>
        /// Creates a new <see cref="DeviceHandle"/> 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 DeviceHandle DangerousCreate(IntPtr unsafeHandle, bool ownsHandle)
        {
            DeviceHandle safeHandle = new DeviceHandle(ownsHandle);

            safeHandle.SetHandle(unsafeHandle);
            return(safeHandle);
        }
Beispiel #2
0
 public static extern Error SetAutoDetachKernelDriver(DeviceHandle devHandle, int enable);
Beispiel #3
0
 public static extern Error AttachKernelDriver(DeviceHandle devHandle, int interfaceNumber);
Beispiel #4
0
 public static extern int KernelDriverActive(DeviceHandle devHandle, int interfaceNumber);
Beispiel #5
0
 public static extern Error DevMemFree(DeviceHandle devHandle, byte *buffer, UIntPtr length);
Beispiel #6
0
 public static extern Device GetDevice(DeviceHandle devHandle);
Beispiel #7
0
 /// <summary>
 /// Creates a new <see cref="DeviceHandle"/> from a <see cref="IntPtr"/>.
 /// </summary>
 /// <param name="unsafeHandle">
 /// The underlying <see cref="IntPtr"/>
 /// </param>
 /// <returns>
 /// </returns>
 public static DeviceHandle DangerousCreate(IntPtr unsafeHandle)
 {
     return(DeviceHandle.DangerousCreate(unsafeHandle, true));
 }
Beispiel #8
0
 public static extern Error GetStringDescriptorAscii(DeviceHandle devHandle, byte descIndex, byte *data, int length);
Beispiel #9
0
 public static extern Error ResetDevice(DeviceHandle devHandle);
Beispiel #10
0
 public static extern Error ClearHalt(DeviceHandle devHandle, byte endpoint);
Beispiel #11
0
 public static extern Error SetInterfaceAltSetting(DeviceHandle devHandle, int interfaceNumber, int alternateSetting);
Beispiel #12
0
 public static extern Error ReleaseInterface(DeviceHandle devHandle, int interfaceNumber);
Beispiel #13
0
 public static extern Error ClaimInterface(DeviceHandle devHandle, int interfaceNumber);
Beispiel #14
0
 public static extern Error SetConfiguration(DeviceHandle devHandle, int configuration);
Beispiel #15
0
 public static extern int ControlTransfer(DeviceHandle devHandle, byte requestType, byte brequest, ushort wvalue, ushort windex, byte *data, ushort wlength, uint timeout);
Beispiel #16
0
 public static extern Error InterruptTransfer(DeviceHandle devHandle, byte endpoint, byte *data, int length, ref int actualLength, uint timeout);
Beispiel #17
0
 public static extern Error AllocStreams(DeviceHandle devHandle, uint numStreams, byte *endpoints, int numEndpoints);
Beispiel #18
0
 public static extern Error GetConfiguration(DeviceHandle dev, ref int config);
Beispiel #19
0
 public static extern Error FreeStreams(DeviceHandle devHandle, byte *endpoints, int numEndpoints);
Beispiel #20
0
 public static extern byte *DevMemAlloc(DeviceHandle devHandle, UIntPtr length);
Beispiel #21
0
 public static extern Error GetBosDescriptor(DeviceHandle devHandle, BosDescriptor **bos);