OSRLogo
OSRLogoOSRLogoOSRLogo x Seminar Ad
OSRLogo
x

Everything Windows Driver Development

x
x
x
GoToHomePage xLoginx
 
 

    Thu, 02 Sep 2010     81215 members

   Login
   Join


 
 
Contents
  About This Site
What's New?
Hector's Memos
The NT Insider
The Basics
File Systems
Downloads
ListServer / Forum
Driver Jobs
Store
  Express Links
  · It's Here: The NT Insider -- Digital Edition!
  · WDK Community Bug Bash 2010 -- Submit a Bug... Get FREE STUFF!
  · File Systems and Filters: A Specialty
  · It's All About The Basics
  · The NT Insider - Digital Edition

Interoffice Memorandum

Date:  02-Jun-04, Modified: 07-Jun-04
From: Hector J. Rodriguez
To:    Driver Developers

Re: 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
Though Hector himself probably doesn't care, why not rate this article and 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.

Writing WDM Drivers LAB
Seattle, WA
16-Aug-2010 to 20-Aug-2010

Writing WDF Drivers LAB
Santa Clara, CA
27-Sept-2010 to 1-Oct-2010

Kernel Debugging &
Crash Analysis LAB

Portland, OR
18-Oct-2010 to 22-Oct-2010

Developing File Systems
Santa Clara, CA
26-Oct-2010 to 29-Oct-2010

Windows Internals &
Software Drivers LAB

Santa Clara, CA
15-Nov-2010 to 19-Nov-2010

 
 

Windows Debugger
V6.12.2.633 -- 26 Feb 10

Checked Build Downloads
29-Apr-10

Debugging Symbols
5-Oct-09
 

WDK Doc Updates
Now updated bi-monthly!

Windows WDK
V7.1.0 -- 26 Feb 10

 
 
x
LetUsHelp
 

Need to develop a Windows file system solution?

We've got a kit for that.

Need Windows internals or kernel driver expertise?

Bring us your most challenging project - we can help!

System hangs/crashes?

We've got a special diagnostic team that's standing by.

Visit the OSR Corporate Web site for more information about how OSR can help!

 
bottom nav links