Compartilhar via


NDIS_REQUEST structure

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 NDIS_REQUEST structure specifies a packet set up by NDIS or by a protocol for a call to NdisRequest or NdisCoRequest. NDIS submits these requests to the underlying driver's MiniportQueryInformation or MiniportSetInformation functions.

Syntax

typedef struct _NDIS_REQUEST {
  UCHAR             MacReserved[4*sizeof(PVOID)];
  NDIS_REQUEST_TYPE RequestType;
  union _DATA {
    struct _QUERY_INFORMATION {
      NDIS_OID Oid;
      PVOID    InformationBuffer;
      UINT     InformationBufferLength;
      UINT     BytesWritten;
      UINT     BytesNeeded;
    } QUERY_INFORMATION;
    struct _SET_INFORMATION {
      NDIS_OID Oid;
      PVOID    InformationBuffer;
      UINT     InformationBufferLength;
      UINT     BytesRead;
      UINT     BytesNeeded;
    } SET_INFORMATION;
  } DATA;
#if (defined(NDIS50) || defined(NDIS51) || defined(NDIS50_MINIPORT) || defined(NDIS51_MINIPORT))
  UCHAR             NdisReserved[9*sizeof(PVOID)];
  union {
    UCHAR CallMgrReserved[2*sizeof(PVOID)];
    UCHAR ProtocolReserved[2*sizeof(PVOID)];
  };
  UCHAR             MiniportReserved[2*sizeof(PVOID)];
#endif 
} NDIS_REQUEST, *PNDIS_REQUEST;

Members

  • MacReserved
    Specifies an area reserved for use by the underlying driver. This area can contain up to four pointers' worth of data.

  • RequestType
    Specifies the request type as one of the following:

    • NdisRequestQueryInformation
      Specifies a query-information request. NDIS forwards such a request to the underlying driver's MiniportQueryInformation function.

    • NdisRequestSetInformation
      Specifies a set-information request. NDIS forwards such a request to the underlying driver's MiniportSetInformation function.

    • NdisRequestQueryStatistics
      Specifies a query-statistics request. For most statistics queries, NDIS satisfies the request itself. Otherwise, NDIS forwards such request to the underlying driver's MiniportQueryInformation function. This type of request originates in a user-mode application, never in a protocol driver.

    For any of the preceding values, the OID_XXX specified in the Oid member must be compatible with the type of operation requested.

    • NdisRequestOpen
      This type is obsolete. A protocol driver calls NdisOpenAdapter instead.

    • NdisRequestClose
      This type is obsolete. A protocol driver calls NdisCloseAdapter instead.

    • NdisRequestSend
      This type is obsolete. A protocol driver calls NdisSend or NdisSendPackets instead.

    • NdisRequestTransferData
      This type is obsolete. A protocol driver calls NdisTransferData instead.

    • NdisRequestReset
      This type is obsolete. A protocol driver calls NdisReset instead.

    • NdisRequestGeneric1
      Specifies a NIC driver-specific request.

    • NdisRequestGeneric2
      Specifies a NIC driver-specific request.

    • NdisRequestGeneric3
      Specifies a NICdriver-specific request.

    • NdisRequestGeneric4
      Specifies a NIC driver-specific request.

  • DATA

    • QUERY_INFORMATION

      • Oid
        Specifies the object identifier of the requested operation. The value is an OID_XXX code.

      • InformationBuffer
        Pointer to a buffer into which the underlying driver or NDIS returns the requested information for queries or from which the underlying driver reads caller-supplied information for sets.

      • InformationBufferLength
        Specifies the size in bytes of the buffer at InformationBuffer. The value at Oid determines the value appropriate to this member.

      • BytesWritten
        Specifies the number of bytes that the underlying driver or NDIS transfers into the buffer at InformationBuffer for query-information requests. If NdisRequest returns NDIS_STATUS_INVALID_LENGTH, the value of this member is meaningless.

      • BytesNeeded
        Specifies the number of bytes needed to return query information or to carry out the set operation requested by the given OID_XXX code.

        If NdisRequest returns NDIS_STATUS_SUCCESS, the value of this member is meaningless. If the InformationBufferLength is too small for the given OID_XXX on a query, this member indicates how large a buffer is required to satisfy the request. If the buffer at InformationBuffer does not contain sufficient data for the given OID_XXX on a set, this member indicates how much data is required.

    • SET_INFORMATION

      • Oid
        Specifies the object identifier of the requested operation. The value is an OID_XXX code.

      • InformationBuffer
        Pointer to a buffer into which the underlying driver or NDIS returns the requested information for queries or from which the underlying driver reads caller-supplied information for sets.

      • InformationBufferLength
        Specifies the size in bytes of the buffer at InformationBuffer. The value at Oid determines the value appropriate to this member.

      • BytesRead
        Specifies the number of bytes that the underlying driver read from the buffer at InformationBuffer for set-information requests.

      • BytesNeeded
        Specifies the number of bytes needed to return query information or to carry out the set operation requested by the given OID_XXX code.

        If NdisRequest returns NDIS_STATUS_SUCCESS, the value of this member is meaningless. If the InformationBufferLength is too small for the given OID_ XXX on a query, this member indicates how large a buffer is required to satisfy the request. If the buffer at InformationBuffer does not contain sufficient data for the given OID_XXX on a set, this member indicates how much data is required.

  • NdisReserved
    Reserved for use by NDIS.

  • CallMgrReserved
    Reserved for use by call manager.

  • ProtocolReserved
    Reserved for use by protocol drivers.

  • MiniportReserved
    Reserved for use by miniport drivers.

Remarks

A protocol should allocate nonpaged memory for the buffer at InformationBuffer and for the NDIS_REQUEST packet itself. Passing in a packet or buffer allocated from paged memory can cause fatal page faults because the underlying driver(s) run at IRQL DISPATCH_LEVEL to carry out the requested operation.

NDIS_REQUEST contains a DATA substructure for each type of operation that a protocol driver can request of an underlying driver. Before calling NdisRequest, the protocol fills in the relevant members of the substructure that represents the query or set operation it specified in the Oid member. NDIS or the underlying driver fills in the remaining members before it returns control to the caller.

For more information about OID_XXX codes and which system-defined OIDs permit queries, statistics queries, or set requests, see NDIS Objects.

The NdisRequestGeneric types are available for NIC drivers that create their own internal requests. To indicate a requested operation, a NIC driver sets an internal variable to one of these types.

Requirements

Header

Ndis.h (include Ndis.h)

See also

MiniportQueryInformation

MiniportSetInformation

NdisCloseAdapter

NdisCoRequest

NdisMQueryInformationComplete

NdisMSetInformationComplete

NdisOpenAdapter

NdisRequest

NdisReset

NdisSend

NdisSendPackets

NdisTransferData

ProtocolRequestComplete

 

 

Send comments about this topic to Microsoft