NDIS_SWITCH_REFERENCE_SWITCH_NIC callback function (ndis.h)
The ReferenceSwitchNic function increments the Hyper-V extensible switch reference counter for a network adapter that is connected to an extensible switch port.
Syntax
NDIS_SWITCH_REFERENCE_SWITCH_NIC NdisSwitchReferenceSwitchNic;
NDIS_STATUS NdisSwitchReferenceSwitchNic(
[in] NDIS_SWITCH_CONTEXT NdisSwitchContext,
[in] NDIS_SWITCH_PORT_ID SwitchPortId,
[in] NDIS_SWITCH_NIC_INDEX SwitchNicIndex
)
{...}
Parameters
[in] NdisSwitchContext
An NDIS_SWITCH_CONTEXT value that contains the handle of the extensible switch module to which the Hyper-V extensible switch extension is attached. When the extension calls NdisFGetOptionalSwitchHandlers, this handle is returned through the NdisSwitchContext parameter.
[in] SwitchPortId
An NDIS_SWITCH_PORT_ID value that contains the unique identifier of the extensible switch port to which the virtual network adapter is connected.
[in] SwitchNicIndex
An NDIS_SWITCH_NIC_INDEX value that specifies the index of the virtual network adapter for which the extensible switch reference counter is to be incremented.
For more information on NDIS_SWITCH_NIC_INDEX values, see Network Adapter Index Values.
Return value
If the call succeeds, the function returns NDIS_STATUS_SUCCESS. Otherwise, it returns an NDIS_STATUS_Xxx error code that is defined in Ndis.h.
Remarks
The extensible switch extension calls ReferenceSwitchNic to increment a reference counter for a network adapter that is connected to an extensible switch port. While the reference counter has a nonzero value, the protocol edge of the extensible switch will not issue an object identifier (OID) set request of OID_SWITCH_NIC_DELETE to delete the connection to the adapter.
After the extension calls ReferenceSwitchNic, it must call DereferenceSwitchNic to decrement the extensible switch reference counter.
The extension should call ReferenceSwitchNic before it performs the following operations:
-
Forwards an OID_SWITCH_NIC_REQUEST OID request over the extensible switch control path to an underlying physical network adapter.
For more information, see Managing OID Requests to Physical Network Adapters.
-
Forwards an NDIS_STATUS_SWITCH_NIC_STATUS status indication over the extensible switch control path from an underlying external adapter.
For more information, see Managing NDIS Status Indications from Physical Network Adapters.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Supported in NDIS 6.30 and later. |
Target Platform | Desktop |
Header | ndis.h (include Ndis.h) |
IRQL | <= DISPATCH_LEVEL |
See also