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