[Applies to KMDF and UMDF]
The WdfDevStateIsNP method returns a Boolean value that indicates whether a specified power state or power policy state is a nonpageable state.
BOOLEAN WdfDevStateIsNP( ULONG State );
If the calling driver is currently nonpageable, the WdfDevStateIsNP method returns TRUE. Otherwise, the method returns FALSE.
To obtain the current state of the framework's power state machine, a driver can call WdfDeviceGetDevicePowerState from within a PnP or power callback function. To obtain the current state of the framework's power policy state machine, a driver can call WdfDeviceGetDevicePowerPolicyState from within a power policy callback function. After the driver has called WdfDeviceGetDevicePowerState or WdfDeviceGetDevicePowerPolicyState, it can call WdfDevStateIsNP to determine if the returned state represents a pageable or nonpageable state. If the framework's state machine is in a nonpageable state, the driver is not pageable and must not perform any operations that might cause the operating system to access the paging file. Such operations include accessing files, the registry, or paged pool.
The following code example sets the nonpageable value to TRUE if the framework's power state machine is currently in a nonpageable state.
BOOLEAN nonpageable; nonpageable = WdfDevStateIsNP(WdfDeviceGetDevicePowerState(device));
|Minimum KMDF version||1.0|
|Minimum UMDF version||2.0|
|Header||wdfdevice.h (include Wdf.h)|
|Library||Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)|