Article ID: 837643 - View products that this article applies to.
This article describes how to determine whether the system is running in Safe Mode from a device driver.
The Windows OS kernel exports a pointer to a ULONG variable that is named InitSafeBootMode. This variable contains the Safe Mode settings.
A device driver can determine whether the system is running in Safe Mode by the value of the InitSafeBootMode variable. A value of 0 means that the system is not running in Safe Mode.
The following table lists the modes for other values.
*Note The value of 3 applies to Windows domain controllers only.
Collapse this tableExpand this table
You must declare the following in your driver.
You must check the value of InitSafeBootMode to determine whether the system is running in Safe Mode.
For example, to prevent a driver from working in Safe Mode, use one of the following methods:
Article ID: 837643 - Last Review: May 29, 2004 - Revision: 1.0