views:

60

answers:

4

hello, im writing a driver and I have a problem

everytime I try to open a handle to my driver using CreateFile, I get bsod (Access Violation)

It's important to mention that my driver loads successfuly and I dont get any errors

does someone knows how to handle it ?

Thanks in advance!

+1  A: 

!analyze -v is your friend.

Johannes Passing
+1  A: 

Turn on creating Kernel Dump in Windows settings and then analyze dump in WinDbg.

Kirill V. Lyadvinsky
A: 

Are you using ZwCreateFile or Createfile? You can't use CreateFile in a driver because that is a usermode function and drivers run in kernel mode. Instead call ZwCreateFile which is the kernel mode version of CreateFile.

A: 

Another possible fault source: the driver-internal function for handling IRP_MJ_CREATE is either incorrectly assigned or faulty.

But you can only guess without analyzing the dump (maybe in conjunction with the symbols database of your driver [the PDB files]).

Robert