NdisrdRequest

BOOL __stdcall NdisrdRequest (HANDLE hOpen, PPACKET_OID_DATA OidData, BOOL Set);

Return Value:
In the 3.6.2 native SDK, TRUE does not by itself establish successful OID completion. See the version-specific limitations below; FALSE can also result from a changed Length.

Parameters:

hOpen
Specifies driver object open handle.

OidData
Specifies the pointer to the user allocated and initialized _PACKET_OID_DATA structure.

Set
Specifies if the operation is a set (set=TRUE) or a query (set=FALSE).

Remarks:
This function is used to perform a query/set operation on the adapter pointed by OidData.hAdapterHandle. With this function, it is possible to obtain or define various parameters of the network adapter, like the dimension of the internal buffers, the link speed or the counter of corrupted packets. The constants that define the operations are declared in the file ntddndis.h. More details on the argument can be found in the documentation provided with the Microsoft DDK.

NOTE: not all the network adapters implement all the query/set functions. There is a set of mandatory OID functions that is granted to be present on all the adapters, and a set of facultative functions, not provided by all the adapters (see the DDKs to see which functions are mandatory). When using an optional OID, check the result and account for the version-specific completion limitations below.
This function is a C_style wrapper for CNdisApi::NdisrdRequest

Native SDK 3.6.2 limitations

The SDK returns FALSE for event creation/reset failures or immediate non-pending I/O failures. On the remaining return path, it compares the original and final PACKET_OID_DATA.Length: unchanged length produces TRUE, and changed length produces FALSE. A completed query that changes Length therefore returns FALSE.

For ERROR_IO_PENDING, the SDK waits on the request event but does not check the wait result or call GetOverlappedResult to obtain terminal completion status. Treating its Boolean as an independently verified OID completion status is unsafe.

Under WOW64, query Data and Length are copied from the translation buffer only on the pending-I/O path. Synchronous success can leave the caller’s query data unchanged. Failure to allocate that translation buffer can also return TRUE without issuing the IOCTL. These limitations apply to this native SDK implementation and bindings that call it; direct-I/O bindings have their own implementations. See the pinned 3.6.2 implementation.