/*++ Copyright (c) Microsoft Corporation. All rights reserved. Module Name: NetDevice.h Environment: user mode NOTE: This header is generated by stubwork. To modify contents, add or remove or tags in the corresponding .x and .y template files. --*/ #pragma once #ifndef WDF_EXTERN_C #ifdef __cplusplus #define WDF_EXTERN_C extern "C" #define WDF_EXTERN_C_START extern "C" { #define WDF_EXTERN_C_END } #else #define WDF_EXTERN_C #define WDF_EXTERN_C_START #define WDF_EXTERN_C_END #endif #endif WDF_EXTERN_C_START typedef _Function_class_(EVT_NET_DEVICE_PREVIEW_WAKE_SOURCE) _IRQL_requires_same_ _IRQL_requires_max_(PASSIVE_LEVEL) NTSTATUS NTAPI EVT_NET_DEVICE_PREVIEW_WAKE_SOURCE( _In_ WDFDEVICE Device, _In_ NETWAKESOURCE WakeSource ); typedef EVT_NET_DEVICE_PREVIEW_WAKE_SOURCE *PFN_NET_DEVICE_PREVIEW_WAKE_SOURCE; typedef _Function_class_(EVT_NET_DEVICE_PREVIEW_POWER_OFFLOAD) _IRQL_requires_same_ _IRQL_requires_max_(PASSIVE_LEVEL) NTSTATUS NTAPI EVT_NET_DEVICE_PREVIEW_POWER_OFFLOAD( _In_ WDFDEVICE Device, _In_ NETPOWEROFFLOAD PowerOffload ); typedef EVT_NET_DEVICE_PREVIEW_POWER_OFFLOAD *PFN_NET_DEVICE_PREVIEW_POWER_OFFLOAD; typedef struct _NET_DEVICE_POWER_POLICY_EVENT_CALLBACKS { ULONG Size; PFN_NET_DEVICE_PREVIEW_WAKE_SOURCE EvtDevicePreviewBitmapPattern; PFN_NET_DEVICE_PREVIEW_POWER_OFFLOAD EvtDevicePreviewArpOffload; PFN_NET_DEVICE_PREVIEW_POWER_OFFLOAD EvtDevicePreviewNSOffload; } NET_DEVICE_POWER_POLICY_EVENT_CALLBACKS; inline void NET_DEVICE_POWER_POLICY_EVENT_CALLBACKS_INIT( _Out_ NET_DEVICE_POWER_POLICY_EVENT_CALLBACKS * Callbacks ) { RtlZeroMemory(Callbacks, sizeof(*Callbacks)); Callbacks->Size = sizeof(*Callbacks); } typedef _Function_class_(EVT_NET_DEVICE_COLLECT_RESET_DIAGNOSTICS) _IRQL_requires_same_ _IRQL_requires_max_(PASSIVE_LEVEL) void NTAPI EVT_NET_DEVICE_COLLECT_RESET_DIAGNOSTICS( _In_ WDFDEVICE Device ); typedef EVT_NET_DEVICE_COLLECT_RESET_DIAGNOSTICS *PFN_NET_DEVICE_COLLECT_RESET_DIAGNOSTICS; typedef struct _NET_DEVICE_RESET_CAPABILITIES { ULONG Size; GUID ResetDiagnosticsGuid; PFN_NET_DEVICE_COLLECT_RESET_DIAGNOSTICS EvtNetDeviceCollectResetDiagnostics; } NET_DEVICE_RESET_CAPABILITIES; inline void NET_DEVICE_RESET_CAPABILITIES_INIT( _Out_ NET_DEVICE_RESET_CAPABILITIES * ResetCapabilities, _In_ GUID ResetDiagnosticsGuid, _In_ PFN_NET_DEVICE_COLLECT_RESET_DIAGNOSTICS EvtNetDeviceCollectResetDiagnostics ) { RtlZeroMemory(ResetCapabilities, sizeof(NET_DEVICE_RESET_CAPABILITIES)); ResetCapabilities->Size = sizeof(NET_DEVICE_RESET_CAPABILITIES); ResetCapabilities->ResetDiagnosticsGuid = ResetDiagnosticsGuid; ResetCapabilities->EvtNetDeviceCollectResetDiagnostics = EvtNetDeviceCollectResetDiagnostics; } // // NET Function: NetDeviceInitConfig // typedef _IRQL_requires_max_(PASSIVE_LEVEL) WDFAPI NTSTATUS (NTAPI *PFN_NETDEVICEINITCONFIG)( _In_ PNET_DRIVER_GLOBALS DriverGlobals, _Inout_ PWDFDEVICE_INIT DeviceInit ); _IRQL_requires_max_(PASSIVE_LEVEL) FORCEINLINE NTSTATUS NetDeviceInitConfig( _Inout_ PWDFDEVICE_INIT DeviceInit ) { return ((PFN_NETDEVICEINITCONFIG) NetFunctions[NetDeviceInitConfigTableIndex])(NetDriverGlobals, DeviceInit); } // // NET Function: NetDeviceOpenConfiguration // typedef _Must_inspect_result_ _IRQL_requires_(PASSIVE_LEVEL) WDFAPI NTSTATUS (NTAPI *PFN_NETDEVICEOPENCONFIGURATION)( _In_ PNET_DRIVER_GLOBALS DriverGlobals, _In_ WDFDEVICE Device, _In_opt_ WDF_OBJECT_ATTRIBUTES* ConfigurationAttributes, _Out_ NETCONFIGURATION* Configuration ); _Must_inspect_result_ _IRQL_requires_(PASSIVE_LEVEL) FORCEINLINE NTSTATUS NetDeviceOpenConfiguration( _In_ WDFDEVICE Device, _In_opt_ WDF_OBJECT_ATTRIBUTES* ConfigurationAttributes, _Out_ NETCONFIGURATION* Configuration ) { return ((PFN_NETDEVICEOPENCONFIGURATION) NetFunctions[NetDeviceOpenConfigurationTableIndex])(NetDriverGlobals, Device, ConfigurationAttributes, Configuration); } // // NET Function: NetDeviceInitSetPowerPolicyEventCallbacks // typedef _IRQL_requires_(PASSIVE_LEVEL) WDFAPI void (NTAPI *PFN_NETDEVICEINITSETPOWERPOLICYEVENTCALLBACKS)( _In_ PNET_DRIVER_GLOBALS DriverGlobals, _Inout_ PWDFDEVICE_INIT DeviceInit, _In_ CONST NET_DEVICE_POWER_POLICY_EVENT_CALLBACKS* Callbacks ); _IRQL_requires_(PASSIVE_LEVEL) FORCEINLINE void NetDeviceInitSetPowerPolicyEventCallbacks( _Inout_ PWDFDEVICE_INIT DeviceInit, _In_ CONST NET_DEVICE_POWER_POLICY_EVENT_CALLBACKS* Callbacks ) { #if defined(NET_EVERYTHING_ALWAYS_AVAILABLE) ((PFN_NETDEVICEINITSETPOWERPOLICYEVENTCALLBACKS) NetFunctions[NetDeviceInitSetPowerPolicyEventCallbacksTableIndex])(NetDriverGlobals, DeviceInit, Callbacks); #else if (NET_IS_FUNCTION_AVAILABLE(NetDeviceInitSetPowerPolicyEventCallbacks)) { ((PFN_NETDEVICEINITSETPOWERPOLICYEVENTCALLBACKS) NetFunctions[NetDeviceInitSetPowerPolicyEventCallbacksTableIndex])(NetDriverGlobals, DeviceInit, Callbacks); } else { ((PFN_WDFDRIVERERRORREPORTAPIMISSING) WdfFunctions[WdfDriverErrorReportApiMissingTableIndex])(WdfDriverGlobals, WdfGetDriver(), NetFrameworkExtensionName, NetDeviceInitSetPowerPolicyEventCallbacksTableIndex, FALSE); } #endif } // // NET Function: NetDeviceInitSetResetCapabilities // typedef _IRQL_requires_(PASSIVE_LEVEL) WDFAPI void (NTAPI *PFN_NETDEVICEINITSETRESETCAPABILITIES)( _In_ PNET_DRIVER_GLOBALS DriverGlobals, _Inout_ PWDFDEVICE_INIT DeviceInit, _In_ CONST NET_DEVICE_RESET_CAPABILITIES* ResetCapabilities ); _IRQL_requires_(PASSIVE_LEVEL) FORCEINLINE void NetDeviceInitSetResetCapabilities( _Inout_ PWDFDEVICE_INIT DeviceInit, _In_ CONST NET_DEVICE_RESET_CAPABILITIES* ResetCapabilities ) { #if defined(NET_EVERYTHING_ALWAYS_AVAILABLE) ((PFN_NETDEVICEINITSETRESETCAPABILITIES) NetFunctions[NetDeviceInitSetResetCapabilitiesTableIndex])(NetDriverGlobals, DeviceInit, ResetCapabilities); #else if (NET_IS_FUNCTION_AVAILABLE(NetDeviceInitSetResetCapabilities)) { ((PFN_NETDEVICEINITSETRESETCAPABILITIES) NetFunctions[NetDeviceInitSetResetCapabilitiesTableIndex])(NetDriverGlobals, DeviceInit, ResetCapabilities); } else { ((PFN_WDFDRIVERERRORREPORTAPIMISSING) WdfFunctions[WdfDriverErrorReportApiMissingTableIndex])(WdfDriverGlobals, WdfGetDriver(), NetFrameworkExtensionName, NetDeviceInitSetResetCapabilitiesTableIndex, FALSE); } #endif } // // NET Function: NetDeviceStoreResetDiagnostics // typedef _IRQL_requires_(PASSIVE_LEVEL) WDFAPI void (NTAPI *PFN_NETDEVICESTORERESETDIAGNOSTICS)( _In_ PNET_DRIVER_GLOBALS DriverGlobals, _In_ WDFDEVICE Device, _In_ SIZE_T ResetDiagnosticsSize, _In_reads_bytes_(ResetDiagnosticsSize) CONST UINT8* ResetDiagnosticsBuffer ); _IRQL_requires_(PASSIVE_LEVEL) FORCEINLINE void NetDeviceStoreResetDiagnostics( _In_ WDFDEVICE Device, _In_ SIZE_T ResetDiagnosticsSize, _In_reads_bytes_(ResetDiagnosticsSize) CONST UINT8* ResetDiagnosticsBuffer ) { #if defined(NET_EVERYTHING_ALWAYS_AVAILABLE) ((PFN_NETDEVICESTORERESETDIAGNOSTICS) NetFunctions[NetDeviceStoreResetDiagnosticsTableIndex])(NetDriverGlobals, Device, ResetDiagnosticsSize, ResetDiagnosticsBuffer); #else if (NET_IS_FUNCTION_AVAILABLE(NetDeviceStoreResetDiagnostics)) { ((PFN_NETDEVICESTORERESETDIAGNOSTICS) NetFunctions[NetDeviceStoreResetDiagnosticsTableIndex])(NetDriverGlobals, Device, ResetDiagnosticsSize, ResetDiagnosticsBuffer); } else { ((PFN_WDFDRIVERERRORREPORTAPIMISSING) WdfFunctions[WdfDriverErrorReportApiMissingTableIndex])(WdfDriverGlobals, WdfGetDriver(), NetFrameworkExtensionName, NetDeviceStoreResetDiagnosticsTableIndex, FALSE); } #endif } // // NET Function: NetDeviceRequestReset // typedef _IRQL_requires_(PASSIVE_LEVEL) WDFAPI void (NTAPI *PFN_NETDEVICEREQUESTRESET)( _In_ PNET_DRIVER_GLOBALS DriverGlobals, _In_ WDFDEVICE Device ); _IRQL_requires_(PASSIVE_LEVEL) FORCEINLINE void NetDeviceRequestReset( _In_ WDFDEVICE Device ) { #if defined(NET_EVERYTHING_ALWAYS_AVAILABLE) ((PFN_NETDEVICEREQUESTRESET) NetFunctions[NetDeviceRequestResetTableIndex])(NetDriverGlobals, Device); #else if (NET_IS_FUNCTION_AVAILABLE(NetDeviceRequestReset)) { ((PFN_NETDEVICEREQUESTRESET) NetFunctions[NetDeviceRequestResetTableIndex])(NetDriverGlobals, Device); } else { ((PFN_WDFDRIVERERRORREPORTAPIMISSING) WdfFunctions[WdfDriverErrorReportApiMissingTableIndex])(WdfDriverGlobals, WdfGetDriver(), NetFrameworkExtensionName, NetDeviceRequestResetTableIndex, FALSE); } #endif } WDF_EXTERN_C_END