FILTER_CANCEL_OID_REQUEST callback function (ndis.h)

NDIS calls a filter driver's FilterCancelOidRequest function to cancel an OID request.

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

Syntax

FILTER_CANCEL_OID_REQUEST FilterCancelOidRequest;

void FilterCancelOidRequest(
  [in] NDIS_HANDLE FilterModuleContext,
  [in] PVOID RequestId
)
{...}

Parameters

[in] FilterModuleContext

A handle to the context area for the filter module that is the target of this request. The filter driver created and initialized this context area in the FilterAttach function.

[in] RequestId

A cancellation identifier for the request. This identifier specifies the NDIS_OID_REQUEST structures that are being canceled.

Return value

None

Remarks

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

When NDIS calls FilterCancelOidRequest, the filter driver should attempt to call NdisFOidRequestComplete function as soon as possible.

The request parameters are defined in the NDIS_OID_REQUEST structure at OidRequest .

If a filter driver does not queue OID requests, the driver is not required to provide a FilterCancelOidRequest function. If the filter driver does not specify a FilterCancelOidRequest entry point, NDIS calls the cancel OID request function of the underlying driver.

NDIS calls the FilterCancelOidRequest function either when the originator of the request cancels the request or when the time-out specified at the Timeout member expires.

If the request processing is still not complete in a filter driver, the driver calls the NdisFOidRequestComplete function with the status set to NDIS_STATUS_REQUEST_ABORTED.

If the filter driver forwarded the request to an underlying driver and the processing is still not complete, the filter driver calls the NdisFCancelOidRequest function with the OidRequest parameter set to the value that it sent to the underlying driver.

NDIS calls FilterCancelOidRequest at IRQL <= DISPATCH_LEVEL.

Examples

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

FILTER_CANCEL_OID_REQUEST MyCancelOidRequest;

Then, implement your function as follows:

_Use_decl_annotations_
VOID
 MyCancelOidRequest(
    NDIS_HANDLE  FilterModuleContext,
    PVOID  RequestId
    )
  {...}

The FILTER_CANCEL_OID_REQUEST 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_CANCEL_OID_REQUEST 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

FilterAttach

NDIS_OID_REQUEST

NdisFCancelOidRequest

NdisFOidRequestComplete

NdisFRegisterFilterDriver