3

Is there a way to use C#/.NET to find previous BSOD codes (e.g. KERNEL_DATA_INPAGE_ERROR) that have occurred in the past (even if only recent past).

I've only seen ways involving applications (for example: How do I analyse a BSOD and the error information it will provide me?), but would like to programmatically gather a list of Error Codes. I don't need any other data (memory dumps etc) but just something to identify the source or cause like the message that flashes before it auto reboots.

Here's the codes I'd like to find. http://msdn.microsoft.com/en-us/library/windows/hardware/hh994433%28v=vs.85%29.aspx

Community
  • 1
  • 1
lko
  • 8,161
  • 9
  • 45
  • 62
  • What operating system are you using? By default, log files are put in "C:\Windows\Minidump". You can use a `StreamReader` or something similar to read the file(s) programmatically. To see (or change) where the files are dumped, go to `Start -> Control Panel -> System -> Advanced system settings -> Advanced -> Startup and Recovery.` then select either of the two options from the dropdown list under `Write debugging information`. – Arian Motamedi Apr 10 '13 at 19:55
  • Win8/7. This sounds interesting, do the dumps contain the error code strings e.g. `KERNEL_DATA_INPAGE_ERROR` (and how accessible if so)? Aww, just looked the folder exists but is empty. Now I wonder if I should try get a BSOD and poke around. XD Wait, I Found 2 in my win7 installation. Paydirt! – lko Apr 10 '13 at 20:08
  • I'm not sure exactly what chunks of information you can find in the dump file, but as far as I remember you should see the error code for each crash, which can easily be extracted from the file programmatically. – Arian Motamedi Apr 10 '13 at 21:30
  • Seems like the dump file in the minidump directory isn't very useful. I'm pretty sure though there's a file, probably stored elsewhere, that has readable data in it. I'll try to dig it up. Man this question is killing me :) – Arian Motamedi Apr 11 '13 at 16:04
  • I tried to dig in the dump files briefly too, but couldn't find anything either. – lko Apr 12 '13 at 17:43

1 Answers1

0

I've not done it myself, but it doesn't look too bad:

  1. Get a List of Event Logs
  2. Open the log and view entires
Denise Skidmore
  • 2,286
  • 22
  • 51
  • Hmm, I've actually done that (read from the Event Viewer in C#). I never noticed any of those error codes anywhere. I'll have to look into it and see if they are there. – lko Apr 10 '13 at 20:06