WdfDeviceInitSetPnpPowerEventCallbacks - NtDoc

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

VOID WdfDeviceInitSetPnpPowerEventCallbacks(
  [in] PWDFDEVICE_INIT               DeviceInit,
  [in] PWDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

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

WdfDeviceInitSetPnpPowerEventCallbacks function

Description

[Applies to KMDF and UMDF]

The WdfDeviceInitSetPnpPowerEventCallbacks method registers a driver's Plug and Play and power management event callback functions.

Parameters

DeviceInit [in]

A caller-supplied pointer to a WDFDEVICE_INIT structure.

PnpPowerEventCallbacks [in]

A pointer to a caller-initialized WDF_PNPPOWER_EVENT_CALLBACKS structure.

Remarks

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

For more information about calling WdfDeviceCreate, see Creating a Framework Device Object.

Examples

The following code example initializes a WDF_PNPPOWER_EVENT_CALLBACKS structure and then calls WdfDeviceInitSetPnpPowerEventCallbacks.

WDF_PNPPOWER_EVENT_CALLBACKS  pnpPowerCallbacks;

WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks);
pnpPowerCallbacks.EvtDevicePrepareHardware = SerialEvtPrepareHardware;
pnpPowerCallbacks.EvtDeviceReleaseHardware = SerialEvtReleaseHardware;
pnpPowerCallbacks.EvtDeviceD0Entry = SerialEvtDeviceD0Entry;
pnpPowerCallbacks.EvtDeviceD0Exit = SerialEvtDeviceD0Exit;
WdfDeviceInitSetPnpPowerEventCallbacks(
                                       DeviceInit,
                                       &pnpPowerCallbacks
                                       );

See also

WDF_PNPPOWER_EVENT_CALLBACKS_INIT

WdfDeviceInitSetPowerPolicyEventCallbacks