Previous Next

MiniportCoRequest

The MiniportCoRequest function is required for connection-oriented miniports. MiniportCoRequest handles a protocol-initiated request to get or set information from the miniport driver.

NDIS_STATUS 
  MiniportCoRequest(
    IN NDIS_HANDLE  MiniportAdapterContext,
    IN NDIS_HANDLE  MiniportVcContext OPTIONAL,
    IN OUT PNDIS_REQUEST  NdisRequest
    );

Parameters

MiniportAdapterContext
Specifies the handle to a miniport driver-allocated context area in which the miniport driver maintains state information about this instance of the adapter. The miniport driver provided this handle to NDIS by calling NdisMSetAttributes or NdisMSetAttributesEx from its MiniportInitialize function.
MiniportVcContext
Specifies the handle to a miniport driver-allocated context area in which the miniport driver maintains its per-VC state. The miniport driver supplied this handle to NDIS from its MiniportCoCreateVc function.
NdisRequest
Pointer to a NDIS_REQUEST structure that contains both the buffer and the request packet for the miniport driver to handle. Depending on the request, the miniport driver returns requested information in the structure provided.

Return Value

NDIS_STATUS_SUCCESS
Indicates that the miniport driver has either set or obtained the data as requested.
NDIS_STATUS_PENDING
Indicates that the miniport driver will complete the request asynchronously. Once the miniport driver has completed all processing it must call NdisMCoRequestComplete to signal NDIS that the request is complete.
NDIS_STATUS_INVALID_OID
Indicates that the request, specified at NdisRequest, is invalid or not recognized.
NDIS_STATUS_NOT_SUPPORTED
Indicates that the request, specified at NdisRequest, is recognized, but not supported by the miniport driver.
NDIS_STATUS_INVALID_LENGTH
Indicates that the buffer, supplied at NdisRequest, is of an insufficient size to hold the data requested.
NDIS_STATUS_INVALID_DATA
Indicates that one or more of the parameters specified for the request at NdisRequest is invalid.

Headers

Declared in Ndis.h. Include Ndis.h.

Comments

NDIS calls the MiniportCoRequest function either on its own behalf or on behalf of a bound protocol driver that called NdisCoRequest. Miniport drivers should examine the request supplied at NdisRequest and take the action requested. For more information about the required and optional OID_GEN_CO_XXX that connection-oriented miniport drivers must handle, see Connection-Oriented Objects.

Note that NDIS does not validate the OID-specific contents at NdisRequest. The driver itself must therefore validate these contents. If the driver determines that the value to be set is out of bounds, it should fail the request and return NDIS_STATUS_INVALID_DATA.

MiniportCoRequest must be written such that it can be run from IRQL = DISPATCH_LEVEL.

See Also

MiniportCoCreateVc, MiniportInitialize, NdisCoRequest, NdisMCoRequestComplete, NdisMSetAttributes, NdisMSetAttributesEx