2.3 Shutdown Reasons

This dwReason type is declared as follows:

 typedef ULONG dwReason;

Some opnums allow the transmission of a shutdown reason. This reason is composed of a major reason code, an optional minor reason code, and optional flags, which MUST be a bitwise OR of the flags.

Major reason codes are described in the following table.

 Constant/value

 Description

SHTDN_REASON_MAJOR_APPLICATION

0x00040000

Application issue

SHTDN_REASON_MAJOR_HARDWARE

0x00010000

Hardware issue

SHTDN_REASON_MAJOR_LEGACY_API

0x00070000

The InitiateSystemShutdown function was used instead of InitiateSystemShutdownEx

SHTDN_REASON_MAJOR_OPERATINGSYSTEM

0x00020000

Operating system issue

SHTDN_REASON_MAJOR_OTHER

0x00000000

Other issue

SHTDN_REASON_MAJOR_POWER

0x00060000

Power failure

SHTDN_REASON_MAJOR_SOFTWARE

0x00030000

Software issue

SHTDN_REASON_MAJOR_SYSTEM

0x00050000

System failure

Any minor reason code MAY be used with any major reason code. Minor reason codes are described in the following table.

 Constant/value

 Description

SHTDN_REASON_MINOR_BLUESCREEN

0x0000000F

Blue screen crash event

SHTDN_REASON_MINOR_CORDUNPLUGGED

0x0000000b

Unplugged

SHTDN_REASON_MINOR_DISK

0x00000007

Disk

SHTDN_REASON_MINOR_ENVIRONMENT

0x0000000c

Environment

SHTDN_REASON_MINOR_HARDWARE_DRIVER

0x0000000d

Driver

SHTDN_REASON_MINOR_HOTFIX

0x00000011

Hot fix

SHTDN_REASON_MINOR_HOTFIX_UNINSTALL

0x00000017

Hot fix uninstallation

SHTDN_REASON_MINOR_HUNG

0x00000005

Unresponsive

SHTDN_REASON_MINOR_INSTALLATION

0x00000002

Installation

SHTDN_REASON_MINOR_MAINTENANCE

0x00000001

Maintenance

SHTDN_REASON_MINOR_MMC

0x00000019

Management tool<1>

SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY

0x00000014

Network connectivity

SHTDN_REASON_MINOR_NETWORKCARD

0x00000009

Network card

SHTDN_REASON_MINOR_OTHER

0x00000000

Other issue

SHTDN_REASON_MINOR_OTHERDRIVER

0x0000000e

Other driver event

SHTDN_REASON_MINOR_POWER_SUPPLY

0x0000000a

Power supply

SHTDN_REASON_MINOR_PROCESSOR

0x00000008

Processor

SHTDN_REASON_MINOR_RECONFIG

0x00000004

Reconfigure

SHTDN_REASON_MINOR_SECURITY

0x00000013

Security issue

SHTDN_REASON_MINOR_SECURITYFIX

0x00000012

Security patch

SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL

0x00000018

Security patch uninstallation

SHTDN_REASON_MINOR_SERVICEPACK

0x00000010

Service pack

SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL

0x00000016

Service pack uninstallation

SHTDN_REASON_MINOR_TERMSRV

0x00000020

Terminal services

SHTDN_REASON_MINOR_UNSTABLE

0x00000006

Unstable

SHTDN_REASON_MINOR_UPGRADE

0x00000003

Installation of software on the system required reboot

SHTDN_REASON_MINOR_WMI

0x00000015

WMI issue

The following optional flags provide additional information about the event.

 Constant/Value

 Description

SHTDN_REASON_FLAG_USER_DEFINED

0x40000000

The reason code is defined by the user.<2> If this flag is not present, the reason code is defined by the system.

SHTDN_REASON_FLAG_PLANNED

0x80000000

The shutdown was planned. If this flag is not present, the shutdown was unplanned.