PROTOCOL_STATUS_EX callback function (ndis.h)

The ProtocolStatusEx function indicates status-changes from underlying connectionless drivers or NDIS.

Note  You must declare the function by using the PROTOCOL_STATUS_EX type. For more information, see the following Examples section.
 

Syntax

PROTOCOL_STATUS_EX ProtocolStatusEx;

void ProtocolStatusEx(
  [in] NDIS_HANDLE ProtocolBindingContext,
  [in] PNDIS_STATUS_INDICATION StatusIndication
)
{...}

Parameters

[in] ProtocolBindingContext

A handle to a context area that the protocol driver allocated. The protocol driver maintains the per-binding context information in this context area. The driver supplied this handle to NDIS when the driver called the NdisOpenAdapterEx function.

[in] StatusIndication

A pointer to an NDIS_STATUS_INDICATION structure that contains the status information.

Return value

None

Remarks

A call to ProtocolStatusEx notifies the protocol driver about changes in status of an underlying driver.

To determine link status, use the status indications from underlying drivers instead of OID queries. These status indications will improve system performance and avoid possible race conditions.

NDIS calls the ProtocolStatusEx function of all bound protocol drivers when an underlying driver is resetting a NIC. First NDIS specifies the NDIS_STATUS_RESET_START code and later, when the reset operation is complete, NDIS specifies the NDIS_STATUS_RESET_END code.

NDIS will not accept send requests and OID requests for a miniport adapter while a reset operation is in progress, the NDIS_STATUS_RESET_START notification warns bound protocol drivers to stop such requests on the affected binding until they receive the corresponding NDIS_STATUS_RESET_END notification.

NDIS calls ProtocolStatusEx at IRQL <= DISPATCH_LEVEL.

Examples

To define a ProtocolStatusEx function, you must first provide a function declaration that identifies the type of function you're defining. Windows provides a set of function types for drivers. Declaring a function using the function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it's a requirement for writing drivers for the Windows operating system.

For example, to define a ProtocolStatusEx function that is named "MyStatusEx", use the PROTOCOL_STATUS_EX type as shown in this code example:

PROTOCOL_STATUS_EX MyStatusEx;

Then, implement your function as follows:

_Use_decl_annotations_
VOID
 MyStatusEx(
    NDIS_HANDLE  ProtocolBindingContext,
    PNDIS_STATUS_INDICATION  StatusIndication
    )
  {...}

The PROTOCOL_STATUS_EX function type is defined in the Ndis.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the Use_decl_annotations annotation to your function definition. The Use_decl_annotations annotation ensures that the annotations that are applied to the PROTOCOL_STATUS_EX function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions by Using Function Role Types for NDIS Drivers.

For information about Use_decl_annotations, see Annotating Function Behavior.

Requirements

Requirement Value
Minimum supported client Supported in NDIS 6.0 and later.
Target Platform Windows
Header ndis.h (include Ndis.h)
IRQL <= DISPATCH_LEVEL

See also

MiniportResetEx

NDIS_STATUS_INDICATION

NDIS_STATUS_RESET_END

NDIS_STATUS_RESET_START

NdisOpenAdapterEx