EVT_NET_DEVICE_PREVIEW_POWER_OFFLOAD callback function (netdevice.h)
Implement this optional callback to reject protocol offloads that are not compatible with your hardware.
Syntax
EVT_NET_DEVICE_PREVIEW_POWER_OFFLOAD EvtNetDevicePreviewPowerOffload;
NTSTATUS EvtNetDevicePreviewPowerOffload(
[_In_] WDFDEVICE Device,
[_In_] NETPOWEROFFLOAD PowerOffload
)
{...}
Parameters
[_In_] Device
The WDFDEVICE object that the client driver previously obtained with a call to WdfDeviceCreate.
[_In_] PowerOffload
A NETPOWEROFFLOAD object that represents the low power protocol offload to examine.
Return value
To accept the protocol offload, the callback function must return STATUS_SUCCESS.
To reject the protocol offload, return STATUS_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL.
Remarks
Drivers are not required to implement EvtNetDevicePreviewPowerOffload, as NetAdapterCx already blocks protocol offloads that are not compatible with the driver's power offload capabilities: NET_ADAPTER_POWER_OFFLOAD_ARP_CAPABILITIES and NET_ADAPTER_POWER_OFFLOAD_NS_CAPABILITIES. However, if your hardware has additional limitations that cannot be expressed in these capabilities structures, you can provide EvtNetDevicePreviewPowerOffload 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 protocol offload. For example, if the number of protocol offloads in the current protocol offload list for Device have already reached or exceeded the number of protocol offloads that the hardware supports, the driver can reject this protocol offload.
For more info, see Configuring Power Management.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 10, version 2004 |
Minimum UMDF version | 2.33 |
Header | netdevice.h (include netadaptercx.h) |
IRQL | PASSIVE_LEVEL |