NDISUIO Implementation

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

NDISUIO is implemented as an NDIS protocol driver. As a protocol driver, NDISUIO is NDIS-aware, and can directly open an NDIS miniport driver to send requests, set, and query information. NDISUIO provides an interface between a user-mode application and NDIS using DeviceIoControl.

Applications load NDISUIO from a DriverEntry routine. The application calls to CreateFile to generate a file handle, then associates the file handle with the target network device by sending IOCTL_NDISUIO_OPEN_DEVICEfrom DeviceIoControl. The application uses one file handle for each device that it communicates with.

The following shows how to call CreateFile to obtain a handle to the device.

hAdapter = CreateFile(
     NDISUIO_DEVICE_NAME,
     GENERIC_READ | GENERIC_WRITE,
     FILE_SHARE_READ | FILE_SHARE_WRITE,
     NULL,
     OPEN_EXISTING,
     FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
     INVALID_HANDLE_VALUE);

The following function call shows the use of IOCTL_NDISUIO_OPEN_DEVICE to create a binding with an NE20001 network device using the handle obtained from CreateFile.

DeviceIoControl(
hAdapter, 
     IOCTL_NDISUIO_OPEN_DEVICE,
TEXT("NE20001"),
wcslen(TEXT("NE20001")) * sizeof(TCHAR),
NULL,
0,
&dwReturnedBytes,
NULL);

The following list shows the operations NDISUIO does using the file object:

  • Read and write operations
  • Send or query NDIS OIDs
  • Receive bind and unbind notifications

See Also

Concepts

NDIS User-Mode I/O Driver
NDISUIO Operations
Simultaneous Access for Multiple Applications
NDISUIO Driver Registration
NDISUIO Binding and Unbinding