FILTER_DIRECT_OID_REQUEST_COMPLETE callback function

NDIS calls the FilterDirectOidRequestComplete function to complete a filter driver direct OID request that queried or set information in an underlying driver.

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

Syntax


FILTER_DIRECT_OID_REQUEST_COMPLETE FilterDirectOidRequestComplete;

VOID FilterDirectOidRequestComplete(
  _In_ NDIS_HANDLE       FilterModuleContext,
  _In_ PNDIS_OID_REQUEST OidRequest,
  _In_ NDIS_STATUS       Status
)
{ ... }

Parameters

FilterModuleContext [in]

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

OidRequest [in]

A pointer to the NDIS_OID_REQUEST structure that the filter driver previously passed to the NdisFDirectOidRequest function.

Status [in]

The final status of the request that an underlying driver or NDIS set. This parameter determines what FilterDirectOidRequestComplete does with the information at OidRequest . For a list of the possible status values, see the return values of NdisFDirectOidRequest.

Return value

None

Remarks

FilterDirectOidRequestComplete is an optional function. If a filter driver does not use direct OID requests, it can set the entry point for this function to NULL when it calls the NdisFRegisterFilterDriver function. If a filter driver defines a FilterDirectOidRequest function, it must provide the FilterDirectOidRequestComplete function.

If the NdisFDirectOidRequest function returns NDIS_STATUS_PENDING, NDIS must call the FilterDirectOidRequestComplete function to complete the OID request.

If a filter driver forwarded a request that it received in the FilterDirectOidRequest function, FilterDirectOidRequestComplete should pass the completion status up the driver stack by calling the NdisFDirectOidRequestComplete function. In this case, the filter driver must call NdisFreeCloneOidRequest, to free the NDIS_OID_REQUEST structure, before it calls NdisFDirectOidRequestComplete.

A filter driver should keep track of requests that it originates and ensure that it does not call NdisFDirectOidRequestComplete when NDIS calls FilterDirectOidRequestComplete for such requests.

NDIS calls FilterDirectOidRequestComplete at IRQL <= DISPATCH_LEVEL.

Examples

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


FILTER_DIRECT_OID_REQUEST_COMPLETE MyDirectOidRequestComplete;

Then, implement your function as follows:


_Use_decl_annotations_
VOID
 MyDirectOidRequestComplete(
    NDIS_HANDLE  FilterModuleContext,
    PNDIS_OID_REQUEST  OidRequest,
    NDIS_STATUS Status
    )
  {...}

The FILTER_DIRECT_OID_REQUEST_COMPLETE 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_DIRECT_OID_REQUEST_COMPLETE 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

Version

Supported in NDIS 6.1 and later.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

See also

FilterAttach
FilterDirectOidRequest
NDIS_OID_REQUEST
NdisFDirectOidRequest
NdisFDirectOidRequestComplete
NdisFreeCloneOidRequest
NdisFRegisterFilterDriver

 

 

Send comments about this topic to Microsoft

Show: