FileIODeclarations.cs
author sl
Wed, 14 May 2014 07:53:47 +0200
changeset 1 29c8c6738077
permissions -rw-r--r--
Disabling signing to fix our build.
     1 using Microsoft.Win32.SafeHandles; 
     2 using System.Runtime.InteropServices;
     3 using System;
     4 
     5 namespace GenericHid
     6 {
     7 	/// <summary>
     8 	/// Win32 API declarations relating to file I/O.
     9 	/// </summary>
    10 	/// 
    11 	internal sealed class FileIo
    12 	{
    13 		internal const Int32 FileShareRead = 1;
    14 		internal const Int32 FileShareWrite = 2;
    15 		internal const uint GenericRead = 0X80000000U;
    16 		internal const Int32 GenericWrite = 0X40000000;
    17 		internal const Int32 InvalidHandleValue = -1;
    18 		internal const Int32 OpenExisting = 3;
    19 
    20 		[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
    21 		internal static extern SafeFileHandle CreateFile(String lpFileName, UInt32 dwDesiredAccess, Int32 dwShareMode, IntPtr lpSecurityAttributes, Int32 dwCreationDisposition, Int32 dwFlagsAndAttributes, IntPtr hTemplateFile);
    22 	}
    23 }