PC crashes when trying to write to file

I have no errors or problems running ZwCreateFile on my file systems minifilter, when I define my filename unicode string as follow:

UNICODE_STRING filename = RTL_CONSTANT_STRING(L"\??\c:\Temp\1.txt");

However, the PC crashes when I change the drive letter to another existing drive as follow:

UNICODE_STRING filename = RTL_CONSTANT_STRING(L"\??\d:\Temp\1.txt");

I confirm that both access rights to both paths are the same. What could be the likely reasons be that result in the crash?

FYI, I know that ideally we don’t write files from kernel, but I would in the meantime want to do that for now, so I hope to resolve this issue. Thanks.

> What could be the likely reasons be that result in the crash?

Because something went wrong.

Given your description that’s all I can say. An analyze -v would be
helpful. You do have a debugger attached don’t you…

/Rod

Number 1 most likely reason: You’re calling ZwCreateFile from IRQL >= IRQL DISPATCH_LEVEL.

As Mr. Widdowson said, please provide us with your analyze -v output, and we’ll see how we can help.

Peter
OSR
@OSRDrivers