Accessing Device Drivers from C#
By David Union, April 01, 2002
Device Drivers are written largely in C or C++. No explicit support for Device Driver communication is included in the current .NET framework. David implements support with C# and discusses how to access Win32 APIs using the Platform Invocation Services and how to make that reusable from within the .NET framework with Overloading.
April 2002/ Accessing Device Drivers from C#
Example 4
The CreateFile() function
HANDLE CreateFile(
LPCTSTR lpFileName, // File Name
DWORD dwDesiredAccess, // Access Mode
DWORD dwShareMode, // Share Mode
LPSECURITY_ATTRIBUTES lpSecurityAttributes, // Security Descriptor
DWORD dwCreationDisposition, // How to Create
DWORD dwFlagsAndAttributes, // File Attributes
HANDLE hTemplateFile // Handle to Template File
);