Reputation:
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
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
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
Reputation: 99585
Turn on creating Kernel Dump in Windows settings and then analyze dump in WinDbg.
Upvotes: 1