CNdisApi::DeviceIoControl

Since 3.6.1

Available since: Windows Packet Filter 3.6.2

The CNdisApi::DeviceIoControl method provides direct access to send control codes (IOCTLs) and associated input/output buffers directly to the underlying ndisrd.sys filter driver device handle.

Syntax

BOOL CNdisApi::DeviceIoControl(
    DWORD        dwService,
    void*        BuffIn,
    int          SizeIn,
    void*        BuffOut,
    int          SizeOut,
    LPDWORD      SizeRet = NULL,
    LPOVERLAPPED povlp   = NULL
) const;

Parameters

dwService
The driver IOCTL control code (defined in Common.h).

BuffIn
Pointer to the input data buffer.

SizeIn
Size in bytes of the input data buffer.

BuffOut
Pointer to the output data buffer.

SizeOut
Size in bytes of the output data buffer.

SizeRet
[optional] Pointer to a variable receiving the actual number of bytes returned by the driver.

povlp
[optional] Pointer to an OVERLAPPED structure for asynchronous I/O.

Return Value

Returns TRUE if the driver request succeeded; otherwise returns FALSE.

Remarks

In version 3.6.2, DeviceIoControl was promoted from protected to public in CNdisApi.h. This allows advanced systems developers to execute custom driver operations or new driver IOCTLs directly without bypassing the class instance or duplicating driver handle management.