sl@0: using Microsoft.Win32.SafeHandles; sl@0: using System.Runtime.InteropServices; sl@0: using System; sl@0: sl@0: namespace GenericHid sl@0: { sl@0: /// sl@0: /// Win32 API declarations relating to file I/O. sl@0: /// sl@0: /// sl@0: internal sealed class FileIo sl@0: { sl@0: internal const Int32 FileShareRead = 1; sl@0: internal const Int32 FileShareWrite = 2; sl@0: internal const uint GenericRead = 0X80000000U; sl@0: internal const Int32 GenericWrite = 0X40000000; sl@0: internal const Int32 InvalidHandleValue = -1; sl@0: internal const Int32 OpenExisting = 3; sl@0: sl@0: [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] sl@0: internal static extern SafeFileHandle CreateFile(String lpFileName, UInt32 dwDesiredAccess, Int32 dwShareMode, IntPtr lpSecurityAttributes, Int32 dwCreationDisposition, Int32 dwFlagsAndAttributes, IntPtr hTemplateFile); sl@0: } sl@0: }