|
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:
- 0 - 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
|