Freigeben über


W_CO_REQUEST_HANDLER callback function

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

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

Syntax

W_CO_REQUEST_HANDLER MiniportCoRequest;

NDIS_STATUS MiniportCoRequest(
  _In_     NDIS_HANDLE   MiniportAdapterContext,
  _In_opt_ NDIS_HANDLE   MiniportVcContext,
  _Inout_  PNDIS_REQUEST NdisRequest
)
{ ... }

Parameters

  • MiniportAdapterContext [in]
    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 [in, optional]
    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 [in, out]
    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

Return code Description
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.

 

Remarks

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.

Requirements

Target platform

Desktop

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use MiniportCoOidRequest instead. Supported for NDIS 5.1 drivers in Windows Vista and Microsoft Windows XP.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

See also

MiniportCoCreateVc

MiniportInitialize

NdisCoRequest

NdisMCoRequestComplete

NdisMSetAttributes

NdisMSetAttributesEx

 

 

Send comments about this topic to Microsoft