NDIS_STATUS
MacRequest(
IN NDIS_HANDLE MacBindingHandle,
IN PNDIS_REQUEST NdisRequest
);
MacRequest is called when a protocol driver calls NdisRequest to query or set NIC information in the underlying driver’s MIB.
Parameters
MacBindingHandle
Specifies the handle that the NIC driver associates with the binding.
NdisRequest
Points to a request structure containing the OID identifying the object to query or set.
Return Value
MacRequest can return any of the following status codes:
NDIS_STATUS_FAILURE
NDIS_STATUS_INVALID_DATA
NDIS_STATUS_INVALID_LENGTH
NDIS_STATUS_INVALID_OID
NDIS_STATUS_NOT_ACCEPTED
NDIS_STATUS_NOT_SUPPORTED
NDIS_STATUS_PENDING
NDIS_STATUS_REQUEST_ABORTED
NDIS_STATUS_RESET_IN_PROGRESS
NDIS_STATUS_RESOURCES
NDIS_STATUS_SUCCESS
Comments
In its call to NdisRequest, the protocol driver passes an NDIS_REQUEST-type structure containing an OID for the MIB object.
The protocol-driver-supplied NDIS_REQUEST structure contains a substructure filled with data related to either querying information or setting information, depending on the RequestType specified. If the protocol driver calls NdisRequest with a query, MacRequest writes the requested information for the specified OID in the appropriate members of the NDIS_REQUEST structure. If the protocol driver requests a set, MacRequest uses the protocol-driver-supplied, OID-specific information from the NDIS_REQUEST structure to set the information for the NIC.
If the NDIS_REQUEST buffer is not large enough to return queried information, MacRequest writes the number of bytes needed for the data in the BytesNeeded member of NDIS_REQUEST and returns NDIS_STATUS_INVALID_LENGTH. It does not fill in the BytesWritten member. If a query request specifies an OID that the NIC driver does not support, MacRequest sets the BytesWritten member to zero and returns the appropriate status code.
For a set operation, MacRequest determines whether the protocol-supplied information is valid. If not, MacRequest writes the number of bytes processed in the BytesRead member of NDIS_REQUEST and returns NDIS_STATUS_INVALID_DATA.
For more information about system-defined OIDs and OID-specific data structures, see Part I.
MacRequest completes synchronously if it finishes processing the request before it returns with any status code other than NDIS_STATUS_PENDING. If MacRequest satisfies a given request, it fills the request’s BytesWritten or BytesRead member with the number of bytes transferred before it returns NDIS_STATUS_SUCCESS.
The driver completes such a request asynchronously if MacRequest returns NDIS_STATUS_PENDING. The NIC driver eventually calls NdisCompleteRequest, which, in turn, calls the ProtocolRequestComplete function of the driver that initiated the query or set request. This asynchronous completion allows protocol driver postprocessing of the completed request.
MacRequest runs at IRQL DISPATCH_LEVEL.
See Also
MacQueryGlobalStatistics, MiniportQueryInformation, MiniportSetInformation, NdisCompleteRequest, NDIS_REQUEST, NdisRequest, ProtocolRequestComplete