확장 최소화

WdfDevStateIsNP method

[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

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

Requirements

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

See also

WdfDeviceInitSetPowerPageable
WdfDeviceInitSetPowerNotPageable

 

 

Send comments about this topic to Microsoft

표시:
© 2014 Microsoft