Why does the console application crash the system?

So basically I am making a driver, and when I close the console application that interacts with the driver, it crashes the system. Why? Are there open handles? Do I have to do something about the mdl address? This happens after I perform a direct write operation to driver

The system crash code is PROCESS_HAS_LOCKED_PAGES 0x76

Why? Because your driver has a bug.

What bug? I don’t know. I can’t see your code or read your mind.

If you want help with the crash, post the output from WinDbg !analyze -v, and with the symbols properly loaded.

Peter

So basically I am making a driver, and when I close the console application that interacts with the driver, it crashes the system. Why?

The most likely scenario is that your driver accesses the userland addresses. When your app terminates its userland address space becomes meaningless straight away, but its threads that run in the kernel mode at the moment may still be alive until they try returning to the userland. Therefore, if your driver accesses the userland in context of such a thread BSOD is simply inevitable.

This is the very first thought that gets into my head. However, as Peter told you already, in order to get a more precise suggestion you need to post the output that you get from !analyze -v,

Anton Bassov