WdfDevStateIsNP - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdfdevice.h

BOOLEAN WdfDevStateIsNP(
  [in] ULONG State
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfdevice-wdfdevstateisnp)

WdfDevStateIsNP function

Description

[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.

Parameters

State [in]

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));

See also

WdfDeviceInitSetPowerNotPageable

WdfDeviceInitSetPowerPageable