EvtDeviceReportedMissing
EvtDeviceUsageNotificationEx
EvtDeviceWdmIrpDispatch
EvtDeviceWdmPostPoFxRegisterDevice
EvtDeviceWdmPrePoFxUnregisterDevice
WDF_DEVICE_INTERFACE_PROPERTY_DATA
WDF_DEVICE_INTERFACE_PROPERTY_DATA_INIT
WDF_DEVICE_PROPERTY_DATA
WDF_DEVICE_PROPERTY_DATA_INIT
WDF_DISPATCH_IRP_TO_IO_QUEUE_FLAGS
WDF_EVENT_TYPE
WDF_IO_TYPE_CONFIG
WDF_IO_TYPE_CONFIG_INIT
WDF_POWER_FRAMEWORK_SETTINGS
WDF_POWER_FRAMEWORK_SETTINGS_INIT
WDF_POWER_POLICY_IDLE_TIMEOUT_TYPE
WDF_RELEASE_HARDWARE_ORDER_ON_FAILURE
WDF_REMOVE_LOCK_OPTIONS
WDF_REMOVE_LOCK_OPTIONS_FLAGS
WDF_REMOVE_LOCK_OPTIONS_INIT
WdfDeviceAllocAndQueryInterfaceProperty method
WdfDeviceAllocAndQueryPropertyEx method
WdfDeviceAssignInterfaceProperty method
WdfDeviceAssignProperty method
WdfDeviceConfigureWdmIrpDispatchCallback method
WdfDeviceGetDeviceStackIoType method
WdfDeviceGetHardwareRegisterMappedAddress
WdfDeviceInitSetIoTypeEx method
WdfDeviceInitSetReleaseHardwareOrderOnFailure method
WdfDeviceInitSetRemoveLockOptions method
WdfDeviceMapIoSpace
WdfDeviceOpenDevicemapKey method
WdfDevicePostEvent
WdfDeviceQueryInterfaceProperty method
WdfDeviceQueryPropertyEx method
WdfDeviceReadFromHardware
WdfDeviceResumeIdleWithTag method
WdfDeviceStopIdleWithTag method
WdfDeviceUnmapIoSpace
WdfDeviceWdmAssignPowerFrameworkSettings method
WdfDeviceWdmDispatchIrp method
WdfDeviceWdmDispatchIrpToIoQueue method
WdfDeviceWriteToHardware
WdfFdoInitAllocAndQueryPropertyEx method
WdfFdoInitQueryPropertyEx method
展开 最小化

WdfDeviceInitRegisterPowerStateChangeCallback 方法

The WdfDeviceInitRegisterPowerStateChangeCallback method registers a driver-supplied event callback function that the framework calls when a device's power state machine changes state.

语法

NTSTATUS WdfDeviceInitRegisterPowerStateChangeCallback(
  [in]  PWDFDEVICE_INIT DeviceInit,
  [in]  WDF_DEVICE_POWER_STATE PowerState,
  [in]  PFN_WDF_DEVICE_POWER_STATE_CHANGE_NOTIFICATION EvtDevicePowerStateChange,
  [in]  ULONG CallbackTypes
);

参数

DeviceInit [in]

A caller-supplied pointer to a WDFDEVICE_INIT structure.

PowerState [in]

A WDF_DEVICE_POWER_STATE enumerator that identifies the power machine state for which the driver is requesting notification.

EvtDevicePowerStateChange [in]

A caller-supplied pointer to the driver's EvtDevicePowerStateChange event callback function.

CallbackTypes [in]

An ORed combination of WDF_STATE_NOTIFICATION_TYPE-typed enumerators.

返回值

If the operation succeeds, WdfDeviceInitRegisterPowerStateChangeCallback returns STATUS_SUCCESS. Additional return values include:

返回代码说明
STATUS_INVALID_PARAMETER

An invalid parameter was detected.

STATUS_INSUFFICIENT_RESOURCES

There is insufficient memory to complete the operation.

 

评论

If your driver calls WdfDeviceInitRegisterPowerStateChangeCallback, it must do so before it calls WdfDeviceCreate.

For more information about calling WdfDeviceCreate, see State Machines in the Framework.

示例

The following code example registers an event callback function that the framework will call when the device's power state machine changes state.

status = WdfDeviceInitRegisterPowerStateChangeCallback(
                                     DeviceInit,
                                     WdfDevStatePowerD0StartingConnectInterrupt,
                                     PciDrvPowerStateChangeCallback,
                                     StateNotificationAllStates
                                     );

要求

版本

Available in version 1.0 and later versions of KMDF.

标头

Wdfdevice.h (包括Wdf.h)

Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)

IRQL

PASSIVE_LEVEL

 

 

社区附加资源

添加
显示:
© 2015 Microsoft