Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to detect Blue Screen Of Death in my driver

how to detect Blue Screen Of Death in my driver

Scheduled Pinned Locked Moved C / C++ / MFC
windows-adminhelptutorialquestion
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 8433064
    wrote on last edited by
    #1

    I am programming a driver in kernel mode. I need my driver to detect a BSOD. When BSOD occurs my driver will write a flag out a registry or a file to mark BSOD occurred .In next boot ,My driver will read this flag to know BSOD in previous boot. if the flag is set the driver do something. I found a way to detect BSOD by using KeRegisterBugCheckCallback routine. this routine registers a BugCheckCallback routine, which executes when the operating system issues a bug check. but I don't know how to write file of write Registry in this callback (In this callback , ZwWriteFile or ZwSetValueKey can't do that) Is there any way to do that? or is there any other way to detect BSOD in previous boot ? Thanks.

    _ M 2 Replies Last reply
    0
    • U User 8433064

      I am programming a driver in kernel mode. I need my driver to detect a BSOD. When BSOD occurs my driver will write a flag out a registry or a file to mark BSOD occurred .In next boot ,My driver will read this flag to know BSOD in previous boot. if the flag is set the driver do something. I found a way to detect BSOD by using KeRegisterBugCheckCallback routine. this routine registers a BugCheckCallback routine, which executes when the operating system issues a bug check. but I don't know how to write file of write Registry in this callback (In this callback , ZwWriteFile or ZwSetValueKey can't do that) Is there any way to do that? or is there any other way to detect BSOD in previous boot ? Thanks.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      Not sure if it is even possible. But here is a list of functions that work with the registry -

      IoOpenDeviceRegistryKey
      IoOpenDeviceInterfaceRegistryKey
      RtlDeleteRegistryValue
      RtlQueryRegistryValues
      RtlWriteRegistryValue
      ZwCreateKey
      ZwDeleteKey
      ZwDeleteValueKey
      ZwEnumerateKey
      ZwEnumerateValueKey
      ZwOpenKey
      ZwQueryKey
      ZwQueryValueKey
      ZwSetValueKey

      Another possibility is for you to hook the KeBugCheckEx function. Again not sure if this will actually work. Here is an article on how to hook the kernel APIs - Hooking the kernel directly[^]

      «_Superman_»  _I love work. It gives me something to do between weekends.

      _Microsoft MVP (Visual C++) (October 2009 - September 2013)

      Polymorphism in C

      1 Reply Last reply
      0
      • U User 8433064

        I am programming a driver in kernel mode. I need my driver to detect a BSOD. When BSOD occurs my driver will write a flag out a registry or a file to mark BSOD occurred .In next boot ,My driver will read this flag to know BSOD in previous boot. if the flag is set the driver do something. I found a way to detect BSOD by using KeRegisterBugCheckCallback routine. this routine registers a BugCheckCallback routine, which executes when the operating system issues a bug check. but I don't know how to write file of write Registry in this callback (In this callback , ZwWriteFile or ZwSetValueKey can't do that) Is there any way to do that? or is there any other way to detect BSOD in previous boot ? Thanks.

        M Offline
        M Offline
        Munchies_Matt
        wrote on last edited by
        #3

        I am going to say either impossible or very complex. Ask at OSR online though, that's where kernel experts hang out, someone else might have a suggestion.

        "The whole idea that carbon dioxide is the main cause of the recent global warming is based on a guess that was proved false by empirical evidence during the 1990s." climate-models-go-cold

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups