// ndis.h
MINIPORT_PAUSE MiniportPause;
NDIS_STATUS MiniportPause(
[in] NDIS_HANDLE MiniportAdapterContext,
[in] PNDIS_MINIPORT_PAUSE_PARAMETERS PauseParameters
)
{...}
View the official Windows Driver Kit DDI referenceNo description available.
NDIS calls a miniport driver's MiniportPause function to stop the flow of network data through a specified miniport adapter.
Note You must declare the function by using the MINIPORT_PAUSE type. For more information, see the following Examples section.
MiniportAdapterContext [in]A handle to a context area that the miniport driver allocated in its MiniportInitializeEx function. The miniport driver uses this context area to maintain state information for a miniport adapter.
PauseParameters [in]A pointer to an NDIS_MINIPORT_PAUSE_PARAMETERS structure that defines the pause parameters for the miniport adapter.
MiniportPause returns one of the following status values:
| Return code | Description |
|---|---|
| NDIS_STATUS_SUCCESS | MiniportPause successfully stopped the flow of network data through the miniport adapter. |
| NDIS_STATUS_PENDING | MiniportPause did not complete the pause operation and the operation will be completed asynchronously. The miniport driver must call the NdisMPauseComplete function when the operation is complete. |
A driver specifies the MiniportPause entry point when it calls the NdisMRegisterMiniportDriver function.
NDIS pauses a miniport adapter to stop data flow that could interfere with PnP operations such as adding or removing a filter driver, or binding or unbinding a protocol driver.
NDIS calls a miniport driver's MiniportPause function to initiate a pause request for the miniport adapter specified at MiniportAdapterContext. The miniport adapter remains in the Pausing state until the pause operation is complete.
For a miniport adapter in the Pausing state, the miniport driver:
NDIS does not initiate other PnP operations for the miniport adapter, such as halt, initialize, power change, pause, or a restart requests, while the miniport adapter is in the Pausing state. NDIS can initiate these PnP operations after a miniport adapter is in the Paused state.
After a miniport driver completes all outstanding send requests and NDIS returns all received network data structures (from outstanding receive indications), the driver must complete the pause operation. If the driver returns NDIS_STATUS_SUCCESS from MiniportPause, the pause operation is complete. If the driver returns NDIS_STATUS_PENDING, the miniport adapter can remain in the Pausing state and the pause operation is complete after the driver calls the NdisMPauseComplete function. After the pause operation is complete, the miniport adapter is in the Paused state.
For a miniport adapter in the Paused state, the miniport driver:
Miniport drivers cannot fail a pause request. Therefore, if a miniport driver requires any resources to handle a pause request, it should preallocate the resources during initialization.
NDIS calls the MiniportRestart function to initiate a restart request for a miniport adapter that is paused.
NDIS calls MiniportPause at IRQL = PASSIVE_LEVEL.
To define a MiniportPause 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 MiniportPause function that is named "MyPause", use the MINIPORT_PAUSE type as shown in this code example:
MINIPORT_PAUSE MyPause;
Then, implement your function as follows:
_Use_decl_annotations_
NDIS_STATUS
MyPause(
NDIS_HANDLE MiniportAdapterContext,
PNDIS_MINIPORT_PAUSE_PARAMETERS MiniportPauseParameters
)
{...}
The MINIPORT_PAUSE 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 MINIPORT_PAUSE 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.
NDIS_MINIPORT_PAUSE_PARAMETERS
NdisMIndicateReceiveNetBufferLists
NdisMSendNetBufferListsComplete