Mercurial > hg > ucis.core
comparison USBLib/Internal/Windows/Win32Kernel.cs @ 57:b1efeada517e
Added VirtualBox USB driver backend for direct USB communication
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Fri, 04 Oct 2013 13:22:21 +0200 |
parents | dcfec2be27c9 |
children | fd63c453ff65 |
comparison
equal
deleted
inserted
replaced
55:ec222fb577dd | 57:b1efeada517e |
---|---|
12 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] | 12 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] |
13 public static extern SafeFileHandle CreateFile(string lpFileName, uint dwDesiredAccess, int dwShareMode, IntPtr lpSecurityAttributes, int dwCreationDisposition, int dwFlagsAndAttributes, IntPtr hTemplateFile); | 13 public static extern SafeFileHandle CreateFile(string lpFileName, uint dwDesiredAccess, int dwShareMode, IntPtr lpSecurityAttributes, int dwCreationDisposition, int dwFlagsAndAttributes, IntPtr hTemplateFile); |
14 | 14 |
15 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi)] | 15 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi)] |
16 unsafe internal static extern bool DeviceIoControl(SafeHandle hDevice, int IoControlCode, IntPtr InBuffer, int nInBufferSize, IntPtr OutBuffer, int nOutBufferSize, out int pBytesReturned, NativeOverlapped* Overlapped); | 16 unsafe internal static extern bool DeviceIoControl(SafeHandle hDevice, int IoControlCode, IntPtr InBuffer, int nInBufferSize, IntPtr OutBuffer, int nOutBufferSize, out int pBytesReturned, NativeOverlapped* Overlapped); |
17 [DllImport("kernel32.dll", SetLastError = true)] | |
18 unsafe internal static extern bool DeviceIoControl(SafeHandle hDevice, int IoControlCode, void* InBuffer, int nInBufferSize, void* OutBuffer, int nOutBufferSize, out int pBytesReturned, NativeOverlapped* Overlapped); | |
17 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi)] | 19 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi)] |
18 unsafe internal static extern bool GetOverlappedResult(SafeHandle hFile, NativeOverlapped* lpOverlapped, out int lpNumberOfBytesTransferred, Boolean bWait); | 20 unsafe internal static extern bool GetOverlappedResult(SafeHandle hFile, NativeOverlapped* lpOverlapped, out int lpNumberOfBytesTransferred, Boolean bWait); |
19 | 21 |
20 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] | 22 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] |
21 public static extern bool DeviceIoControl(SafeHandle hDevice, int dwIoControlCode, IntPtr lpInBuffer, int nInBufferSize, out USB_ROOT_HUB_NAME lpOutBuffer, int nOutBufferSize, out int lpBytesReturned, IntPtr lpOverlapped); | 23 public static extern bool DeviceIoControl(SafeHandle hDevice, int dwIoControlCode, IntPtr lpInBuffer, int nInBufferSize, out USB_ROOT_HUB_NAME lpOutBuffer, int nOutBufferSize, out int lpBytesReturned, IntPtr lpOverlapped); |
28 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] | 30 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] |
29 public static extern bool DeviceIoControl(SafeHandle hDevice, int dwIoControlCode, [In] ref USB_NODE_CONNECTION_INFORMATION_EX lpInBuffer, int nInBufferSize, out USB_NODE_CONNECTION_INFORMATION_EX lpOutBuffer, int nOutBufferSize, out int lpBytesReturned, IntPtr lpOverlapped); | 31 public static extern bool DeviceIoControl(SafeHandle hDevice, int dwIoControlCode, [In] ref USB_NODE_CONNECTION_INFORMATION_EX lpInBuffer, int nInBufferSize, out USB_NODE_CONNECTION_INFORMATION_EX lpOutBuffer, int nOutBufferSize, out int lpBytesReturned, IntPtr lpOverlapped); |
30 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] | 32 [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] |
31 public static extern bool DeviceIoControl(SafeHandle hDevice, int dwIoControlCode, [In] ref USB_NODE_CONNECTION_NAME lpInBuffer, int nInBufferSize, out USB_NODE_CONNECTION_NAME lpOutBuffer, int nOutBufferSize, out int lpBytesReturned, IntPtr lpOverlapped); | 33 public static extern bool DeviceIoControl(SafeHandle hDevice, int dwIoControlCode, [In] ref USB_NODE_CONNECTION_NAME lpInBuffer, int nInBufferSize, out USB_NODE_CONNECTION_NAME lpOutBuffer, int nOutBufferSize, out int lpBytesReturned, IntPtr lpOverlapped); |
32 | 34 |
33 //public const uint GENERIC_READ = 0x80000000; | 35 public const uint GENERIC_READ = 0x80000000; |
34 public const uint GENERIC_WRITE = 0x40000000; | 36 public const uint GENERIC_WRITE = 0x40000000; |
35 //public const uint GENERIC_EXECUTE = 0x20000000; | 37 //public const uint GENERIC_EXECUTE = 0x20000000; |
36 //public const uint GENERIC_ALL = 0x10000000; | 38 //public const uint GENERIC_ALL = 0x10000000; |
37 //public const uint FILE_FLAG_NO_BUFFERING = 0x20000000; | 39 public const uint FILE_FLAG_NO_BUFFERING = 0x20000000; |
38 | 40 |
39 //public const int FILE_SHARE_READ = 0x1; | 41 public const int FILE_SHARE_READ = 0x1; |
40 public const int FILE_SHARE_WRITE = 0x2; | 42 public const int FILE_SHARE_WRITE = 0x2; |
41 public const int OPEN_EXISTING = 0x3; | 43 public const int OPEN_EXISTING = 0x3; |
44 | |
45 public const int FILE_ATTRIBUTE_SYSTEM = 0x00000004; | |
46 public const int FILE_FLAG_OVERLAPPED = 0x40000000; | |
42 } | 47 } |
43 | 48 |
44 [Flags] | 49 [Flags] |
45 enum NativeFileAccess : uint { | 50 enum NativeFileAccess : uint { |
46 FILE_SPECIAL = 0, | 51 FILE_SPECIAL = 0, |