Exemple #1
0
 private static IntPtr _OpenDevice(string devicePath, bool enumerate)
 {
     return(NativeInterface.CreateFile_IntPtr(devicePath, enumerate ? 0 :
                                              NativeInterface.GENERIC_READ | NativeInterface.GENERIC_WRITE,
                                              enumerate ? NativeInterface.FILE_SHARE_READ | NativeInterface.FILE_SHARE_WRITE :
                                              NativeInterface.FILE_SHARE_READ, IntPtr.Zero, NativeInterface.OPEN_EXISTING,
                                              NativeInterface.FILE_FLAG_OVERLAPPED, 0));
 }