Bewerken

Delen via


EVT_NET_DEVICE_PREVIEW_WAKE_SOURCE callback function (netdevice.h)

Implement this optional callback to reject wake patterns that are not compatible with your hardware.

Syntax

EVT_NET_DEVICE_PREVIEW_WAKE_SOURCE EvtNetDevicePreviewWakeSource;

NTSTATUS EvtNetDevicePreviewWakeSource(
  [_In_] WDFDEVICE Device,
  [_In_] NETWAKESOURCE WakeSource
)
{...}

Parameters

[_In_] Device

The WDFDEVICE object that the client driver previously obtained with a call to WdfDeviceCreate.

[_In_] WakeSource

A NETWAKESOURCE object that represents the wake source to examine.

Return value

To accept the pattern, the callback function must return STATUS_SUCCESS.

To reject the pattern, return STATUS_NDIS_PM_WOL_PATTERN_LIST_FULL.

Remarks

Drivers are not required to implement EvtNetDevicePreviewWakeSource, as NetAdapterCx already blocks wake sources that are not compatible with the driver's NET_ADAPTER_WAKE_BITMAP_CAPABILITIES. However, if your hardware has additional limitations that cannot be expressed in the bitmap capabilities structure, you can provide EvtNetDevicePreviewWakeSource to enforce those additional limitations.

Register your implementation of this callback function by setting the appropriate member of the NET_DEVICE_POWER_POLICY_EVENT_CALLBACKS, then calling NetDeviceInitSetPowerPolicyEventCallbacks.

Client drivers typically call NetDeviceInitSetPowerPolicyEventCallbacks when creating the device object, before calling WdfDeviceCreate.

In this callback, client drivers get the chance to reject the wake source. For example, if the number of power filters in the current wake source list for Device have already reached or exceeded the number of power filters that the hardware supports, the driver can reject this wake source.

For more info, see Configuring Power Management.

Requirements

Requirement Value
Minimum supported client Windows 10, version 2004
Target Platform Universal
Minimum UMDF version 2.33
Header netdevice.h (include netadaptercx.h)
IRQL PASSIVE_LEVEL