

The kernel-mode USB driver does not implement a package or message protocol. Whenever a subsequent call to DeviceIoControl, ReadFile, or WriteFile is made, the device handle associated with the desired pipe should be specified.īecause only one control endpoint is supported, specifying any I/O control code that uses the control pipe causes the driver to use the proper endpoint, regardless of which endpoint (if any) was specified to CreateFile.įor descriptions of all I/O control codes, see USB Still Image I/O Control Codes. If you call CreateFile with a port name of "usbscan0\1", the function opens transfer pipes to endpoints with index values of 1, 4, and 5, as well as the control endpoint.įor this device, if you want to use interrupt endpoint 0, bulk IN endpoint 1, and bulk OUT endpoint 3, call CreateFile three times, specifying port names of "usbscan0\0", "usbscan0\1", and "usbscan0\3". If you call CreateFile with a port name of "usbscan0", the function opens transfer pipes to endpoints with index values of 2, 4, and 5, as well as the control endpoint.

Note that these index numbers are not the endpoint numbers described in the Universal Serial Bus Specification.Īppend a backslash and the endpoint's index number to the port name returned by IStiDeviceControl::GetMyDevicePortName when calling CreateFile.įor example, suppose a device (with a port name of "usbscan0") has two endpoints of each type (interrupt, bulk IN, bulk OUT), with index numbers as follows: Index If you want to use a different endpoint, you must do the following:Ĭall DeviceIoControl, specifying an I/O control code of IOCTL_GET_PIPE_CONFIGURATION, to determine a port's endpoint index numbers (that is, indexes into the returned USBSCAN_PIPE_INFORMATION structure array). For devices that support no more than one of each endpoint type (control, interrupt, bulk IN, bulk OUT), a single call to CreateFile opens transfer pipes to each endpoint.įor devices that support multiple interrupt or bulk endpoints, a single call to CreateFile opens transfer pipes to the highest-numbered endpoint of each type.

The bulk endpoints are accessible using ReadFile and WriteFile.īefore calling DeviceIoControl, ReadFile, or WriteFile, you must call CreateFile (all described in the Microsoft Windows SDK documentation) to obtain a device handle. The control and interrupt endpoints are accessible using I/O control codes and DeviceIoControl. The kernel-mode still image driver for USB buses supports a single control endpoint, along with multiple interrupt, bulk IN, and bulk OUT endpoints.
