Question

I don't know if this is even possible but is there any way to programmatically detect that a BSOD has just occurred when rebooting just after the BSOD?

The BSOD could be for ANY reason or all reasons, doesn't matter. I know you could check for the dump file but if the user turns that setting off then no dump will be made. They can also change the path they want the dump files to go to which makes it unreliable for you to detect.

Any and/or all versions of Windows would be nice. It would be nice if I can check in the same manner on each OS but if it has to be OS-specific I suppose that would be fine as well.

Was it helpful?

Solution

Yes, you can access the event logs from C++.

The EventLog service will log a specific event 6008 after an unexpected shutdown. In addition, you will see the event 6006 logged on a successful shutdown, and 6009 and 6005 on a startup.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top