FILTER_RESTART - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ndis.h

FILTER_RESTART FilterRestart;

NDIS_STATUS FilterRestart(
  [in] NDIS_HANDLE FilterModuleContext,
  [in] PNDIS_FILTER_RESTART_PARAMETERS RestartParameters
)
{...}
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nc-ndis-filter_restart)

FILTER_RESTART callback function

Description

The FilterRestart function initiates a restart operation for the specified filter module.

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

Parameters

FilterModuleContext [in]

A handle to the context area for the filter module that the filter driver should restart. The filter driver created and initialized this context area in the FilterAttach function.

RestartParameters [in]

A pointer to an NDIS_FILTER_RESTART_PARAMETERS structure that defines the restart parameters for the filter module.

Return value

FilterRestart returns one of the following status values:

Return code Description
NDIS_STATUS_SUCCESS FilterRestart successfully restarted the specified filter module.
NDIS_STATUS_PENDING The filter driver will complete the request asynchronously with a call to the NdisFRestartComplete function after it completes the restart operation.
NDIS_STATUS_RESOURCES FilterRestart failed because of insufficient resources.
NDIS_STATUS_FAILURE None of the preceding status values applies. The filter driver should call the NdisWriteEventLogEntry function together with parameters that specify the reason for the failure.

Remarks

FilterRestart is a required function for filter drivers. NDIS can call FilterRestart when a filter module is in the Paused state. The filter module enters the Restarting state at the start of the execution of FilterRestart.

When NDIS calls FilterRestart, a filter driver:

If a filter driver modifies the list of restart attributes, the filter driver:

After the filter driver returns its status or calls the NdisFRestartComplete function, the restart operation is complete. If the operation completed successfully, the filter module is in the Running state and normal send and receive processing is resumed. If the restart operation failed, the filter module returns to the Paused state.

NDIS calls FilterRestart at IRQL = PASSIVE_LEVEL.

Examples

To define a FilterRestart 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 FilterRestart function that is named "MyRestart", use the FILTER_RESTART type as shown in this code example:

FILTER_RESTART MyRestart;

Then, implement your function as follows:

_Use_decl_annotations_
NDIS_STATUS
 MyRestart(
    NDIS_HANDLE  FilterModuleContext,
    PNDIS_FILTER_RESTART_PARAMETERS  FilterRestartParameters
    )
  {...}

The FILTER_RESTART 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 FILTER_RESTART 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.

See also

FilterAttach

FilterOidRequest

FilterStatus

NDIS_FILTER_RESTART_PARAMETERS

NDIS_OBJECT_HEADER

NDIS_RESTART_ATTRIBUTES

NDIS_RESTART_GENERAL_ATTRIBUTES

NDIS_STATUS_LINK_STATE

NdisAllocateMemoryWithTagPriority

NdisFRegisterFilterDriver

NdisFRestartComplete

NdisFreeMemory

NdisWriteEventLogEntry

OID_GEN_LINK_STATE

OID_GEN_MINIPORT_RESTART_ATTRIBUTES