TdiDispatchDeviceControl

NTSTATUS
TdiDispatchDeviceControl (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PIO_STACK IrpSp
);

TdiDispatchDeviceControl processes IRPs set with the major function code IRP_MJ_DEVICE_CONTROL.

Parameters

DeviceObject

Points to the device object created by the TDI driver.

Irp

Points to the IRP.

IrpSp

Points to the I/O stack location of the transport driver in the given IRP.

Return Value

TdiDispatchDeviceControl returns STATUS_SUCCESS if it satisfied the given request. Otherwise, it returns a driver-determined error status, depending on the given IOCTL_XXX minor function code in the IRP.

Comments

Usually, TdiDispatchDeviceControl calls TdiMapUserRequest and, if it returns STATUS_SUCCESS, calls the transport's TdiDispatchInternalDeviceControl function with the input DeviceObject and Irp pointers. If TdiMapUserRequest returns an error indicating that the given IOCTL_XXX in the Irp did not match any of the system-defined IOCTL_TDI_XXX codes, most transports simply complete the IRP with a driver-determined error status, such as STATUS_INVALID_DEVICE_REQUEST or STATUS_NOT_SUPPORTED.

However, if a transport supports any driver-defined "private" IOCTLs that a transport-dedicated application uses to communicate with the transport, its TdiDispatchDeviceControl switches on these IOCTL_XXX and calls internal driver functions to process them, as well as calling TdiDispatchInternalDeviceControl when TdiMapUserRequest returns STATUS_SUCCESS.

For more information about driver-defined IOCTL codes, see the Kernel-Mode Driver Reference.

See Also

TdiDispatchFastDeviceControl, TdiDispatchInternalDeviceControl, TdiMapUserRequest