WdfDevStateIsNP function (wdfdevice.h)
[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.
Syntax
BOOLEAN WdfDevStateIsNP(
[in] ULONG State
);
Parameters
[in] State
A WDF_DEVICE_POWER_STATE-typed enumerator or a WDF_DEVICE_POWER_POLICY_STATE-typed enumerator.
Return value
If the calling driver is currently nonpageable, the WdfDevStateIsNP method returns TRUE. Otherwise, the method returns FALSE.
Remarks
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.
Examples
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));
Requirements
Requirement | Value |
---|---|
Target Platform | Universal |
Minimum KMDF version | 1.0 |
Minimum UMDF version | 2.0 |
Header | wdfdevice.h (include Wdf.h) |
Library | Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF) |
IRQL | Any level |