#ifndef _NTPOAPI_H
// wdm
typedef struct _SYSTEM_POWER_STATE_CONTEXT
{
union
{
struct
{
ULONG Reserved1 : 8;
ULONG TargetSystemState : 4;
ULONG EffectiveSystemState : 4;
ULONG CurrentSystemState : 4;
ULONG IgnoreHibernationPath : 1;
ULONG PseudoTransition : 1;
ULONG KernelSoftReboot : 1;
ULONG DirectedDripsTransition : 1;
ULONG Reserved2 : 8;
};
ULONG ContextAsUlong;
};
} SYSTEM_POWER_STATE_CONTEXT, *PSYSTEM_POWER_STATE_CONTEXT;
View code on GitHub// ntpoapi.h
typedef struct _SYSTEM_POWER_STATE_CONTEXT {
union {
struct {
ULONG Reserved1 : 8;
ULONG TargetSystemState : 4;
ULONG EffectiveSystemState : 4;
ULONG CurrentSystemState : 4;
ULONG IgnoreHibernationPath : 1;
ULONG PseudoTransition : 1;
ULONG KernelSoftReboot : 1;
ULONG DirectedDripsTransition : 1;
ULONG Reserved2 : 8;
} DUMMYSTRUCTNAME;
ULONG ContextAsUlong;
} DUMMYUNIONNAME;
} SYSTEM_POWER_STATE_CONTEXT, *PSYSTEM_POWER_STATE_CONTEXT;
View the official Windows Driver Kit DDI reference// wdm.h
typedef struct _SYSTEM_POWER_STATE_CONTEXT {
union {
struct {
ULONG Reserved1 : 8;
ULONG TargetSystemState : 4;
ULONG EffectiveSystemState : 4;
ULONG CurrentSystemState : 4;
ULONG IgnoreHibernationPath : 1;
ULONG PseudoTransition : 1;
ULONG KernelSoftReboot : 1;
ULONG DirectedDripsTransition : 1;
ULONG Reserved2 : 8;
} DUMMYSTRUCTNAME;
ULONG ContextAsUlong;
} DUMMYUNIONNAME;
} SYSTEM_POWER_STATE_CONTEXT, *PSYSTEM_POWER_STATE_CONTEXT;
View the official Windows Driver Kit DDI referenceThe SYSTEM_POWER_STATE_CONTEXT structure is a partially opaque system structure that contains information about the previous system power states of a computer.
DUMMYUNIONNAMEUnnamed union.
DUMMYUNIONNAME.DUMMYSTRUCTNAMEUnnamed structure.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.Reserved1Opaque member. Reserved for system use.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.TargetSystemStateThe target system power state of the previous system power IRP that the driver received. This member is set to a SYSTEM_POWER_STATE enumeration value. Drivers should treat this member as read-only.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.EffectiveSystemStateThe effective previous system power state, as perceived by the user. This member is set to a SYSTEM_POWER_STATE enumeration value. Drivers should treat this member as read-only. This member value might not match the TargetSystemState member if, for example, the previous system power IRP indicated that the computer was about to enter hibernation, but a hybrid shutdown instead occurred to prepare the computer for a fast startup. For more information, see Remarks.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.CurrentSystemStateOpaque member. Reserved for system use.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.IgnoreHibernationPathOpaque member. Reserved for system use.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.PseudoTransitionOpaque member. Reserved for system use.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.KernelSoftRebootDUMMYUNIONNAME.DUMMYSTRUCTNAME.DirectedDripsTransitiona Directed DRIPS transition.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.Reserved2Opaque member. Reserved for system use.
DUMMYUNIONNAME.ContextAsUlongOpaque member. Reserved for system use.
Starting with Windows Vista, the I/O stack location in a system power IRP contains a SYSTEM_POWER_STATE_CONTEXT structure. The Power member of the IO_STACK_LOCATION structure contains a SystemPowerStateContext member, which is a SYSTEM_POWER_STATE_CONTEXT structure. For more information, see IO_STACK_LOCATION.
The size of the SYSTEM_POWER_STATE_CONTEXT structure is four bytes. This structure is divided into bit fields, most of which are opaque to drivers and reserved exclusively for use by the operating system. However, two of these bit fields, TargetSystemState and EffectiveSystemState, can be read by kernel-mode drivers to distinguish a fast startup from a wake-from-hibernation startup. For more information, see Distinguishing Fast Startup from Wake-from-Hibernation.
The SYSTEM_POWER_STATE_CONTEXT structure is a partially opaque system structure that contains information about the previous system power states of a computer.
DUMMYUNIONNAMEUnnamed union.
DUMMYUNIONNAME.DUMMYSTRUCTNAMEUnnamed structure.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.Reserved1Opaque member. Reserved for system use.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.TargetSystemStateThe target system power state of the previous system power IRP that the driver received. This member is set to a SYSTEM_POWER_STATE enumeration value. Drivers should treat this member as read-only.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.EffectiveSystemStateThe effective previous system power state, as perceived by the user. This member is set to a SYSTEM_POWER_STATE enumeration value. Drivers should treat this member as read-only. This member value might not match the TargetSystemState member if, for example, the previous system power IRP indicated that the computer was about to enter hibernation, but a hybrid shutdown instead occurred to prepare the computer for a fast startup. For more information, see Remarks.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.CurrentSystemStateOpaque member. Reserved for system use.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.IgnoreHibernationPathOpaque member. Reserved for system use.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.PseudoTransitionOpaque member. Reserved for system use.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.KernelSoftRebootOpaque member. Reserved for system use.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.DirectedDripsTransitionOpaque member. Reserved for system use.
DUMMYUNIONNAME.DUMMYSTRUCTNAME.Reserved2Opaque member. Reserved for system use.
DUMMYUNIONNAME.ContextAsUlongOpaque member. Reserved for system use.
Starting with Windows Vista, the I/O stack location in a system power IRP contains a SYSTEM_POWER_STATE_CONTEXT structure. The Power member of the IO_STACK_LOCATION structure contains a SystemPowerStateContext member, which is a SYSTEM_POWER_STATE_CONTEXT structure. For more information, see IO_STACK_LOCATION.
The size of the SYSTEM_POWER_STATE_CONTEXT structure is four bytes. This structure is divided into bit fields, most of which are opaque to drivers and reserved exclusively for use by the operating system. However, two of these bit fields, TargetSystemState and EffectiveSystemState, can be read by kernel-mode drivers to distinguish a fast startup from a wake-from-hibernation startup. For more information, see Distinguishing Fast Startup from Wake-from-Hibernation.