John Terry
John Terry

Reputation:

bsod every time a handle to a driver is created

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!

Upvotes: 1

Views: 253

Answers (4)

Robert
Robert

Reputation: 878

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]).

Upvotes: 0

user37875
user37875

Reputation: 14194

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.

Upvotes: 1

Kirill V. Lyadvinsky
Kirill V. Lyadvinsky

Reputation: 99585

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

Upvotes: 1

Johannes Passing
Johannes Passing

Reputation: 2805

!analyze -v is your friend.

Upvotes: 1

Related Questions