OSRLogo
OSRLogoOSRLogoOSRLogo x Seminar Ad
OSRLogo
x

Everything Windows Driver Development

x
x
x
GoToHomePage xLoginx
 
 

    Mon, 10 Dec 2018     118021 members

   Login
   Join


 
 
Contents
  Online Dump Analyzer
OSR Dev Blog
The NT Insider
Downloads
ListServer / Forum
  Express Links
  · The NT Insider Digital Edition - May-June 2016 Now Available!
  · Windows 8.1 Update: VS Express Now Supported
  · HCK Client install on Windows N versions
  · There's a WDFSTRING?
  · When CAN You Call WdfIoQueueP...ously

How to Determine if System Running in Safe Mode

Since the introduction of Windows 2000, many driver developers have asked if there is a way to determine whether or not the system is running in Safe Mode, and if it is, exactly what type of Safe Mode it is in.    Well, a recent KB article entitled "How to determine whether the system is running in Safe Mode from a device driver" found at http://support.microsoft.com/default.aspx?scid=kb;EN-US;837643 explains it all.  

Essentially the way it works is that your driver must import the InitSafeBootMode variable using the following declaration:

extern PULONG InitSafeBootMode;

This variable has 4 possible values:

  • - The system is not in safe mode
  • 1 - SAFEBOOT_MINIMAL
  • 2 - SAFEBOOT_NETWORK
  • 3 - SAFEBOOT_DSREPAIR (for Windows Domain Controllers Only)

Anyway, this KB article applies to all Windows 2000,XP, and Server 2003 system.

Related Articles
Tooling Around with Vista - Modifying Windows Boot & Debug Options in Vista

User Comments
Rate this article and give us feedback. Do you find anything missing? Share your opinion with the community!
Post Your Comment

"What about userland?"
How can we find this out in luser-land?

Rating:
11-Jun-04, Dimitris Staikos


"my filter driver"
But my filter driver does not load in safe mode while i does not check the InitSafeBootMode.

Rating:
08-Jun-04, Zou Ximing


"not InitSafeMode"
InitSafeBootMode

Rating:
08-Jun-04, Satya Das


"How to Determine if System Running in Safe Mode"
Thanks for tip.

By the way do you know how determine when system finished booting ?

Rating:
08-Jun-04, Ilya Tepelboym


Post Your Comments.
Print this article.
Email this article.
bottom nav links