Hi guys,
Can we interact with kernel mode drivers namely the sys files through
.net.If we can than how can it be done.Please help me.
With regards
Ganesh
Hi guys,
Can we interact with kernel mode drivers namely the sys files through
.net.If we can than how can it be done.Please help me.
With regards
Ganesh
Yes, quite easily. Read up on “Platform Invoke” or P/Invoke – it’s the
.Net facility for making calls into unmanaged DLLs.
The System.IO.FileStream class provides a Handle property, which will give
you the kernel object handle of the opened file object. You can then use
[DllImport] to import DeviceIoControl from KERNEL32.DLL, and pass that
handle to it. Or, you can call the Read/Write methods of FileStream, if
reading/writing is all you need to do.
Please bear in mind, this is off-topic for the WINDBG list, or even for the
NTDEV list. This is just basic user-mode programming, using managed
languages, instead of just C/C++/assembly. Basically, using .Net languages
to talk to drivers works the exact same way as unmanaged languages. Your
managed apps call Win32 API functions, such as CreateFile, ReadFile,
DeviceIoControl, etc., and from there it all works exactly the same as
traditional C/C++.
– arlie
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ganesh
Sent: Thursday, January 26, 2006 9:49 AM
To: Kernel Debugging Interest List
Subject: [windbg] How can we interact with kernel mode drivers through .net
Hi guys,
Can we interact with kernel mode drivers namely the sys files through
.net.If we can than how can it be done.Please help me.
With regards
Ganesh
You are currently subscribed to windbg as: xxxxx@stonestreetone.com To
unsubscribe send a blank email to xxxxx@lists.osr.com