Search code examples
cwindowsfilesystemsdevice-driver

how to not enter deadlock in file system device driver?


i am creating file system filter driver and need to open some files to check attributes in dispatch routines. I am using ZwCreateFile(). But my dispatch routines is called at every file system request, so my ZwCreateFile() will then call again my dispatch routine. What is the best method to not enter deadlock? I think using flags or something is good choice?

I have tested and simple signing the flag in device extension still not changes the flag in some situations or the flag contain old data.

Thank you


Solution

  • Try IoCreateFileSpecifyDeviceObjectHint, IoCreateFileEx or FtlCreateFile.