WinUsb_QueryDeviceInformation function

The WinUsb_QueryDeviceInformation function gets information about the physical device that is associated with a WinUSB interface handle.

Syntax

BOOL WinUsb_QueryDeviceInformation(
  WINUSB_INTERFACE_HANDLE InterfaceHandle,
  ULONG                   InformationType,
  PULONG                  BufferLength,
  PVOID                   Buffer
);

Parameters

InterfaceHandle

An opaque handle to the first interface on the device, which is returned by WinUsb_Initialize.

InformationType

A value that specifies which interface information value to retrieve.

On input, InformationType must have the following value: DEVICE_SPEED (0x01).

BufferLength

The maximum number of bytes to read. This number must be less than or equal to the size, in bytes, of Buffer. On output, BufferLength is set to the actual number of bytes that were copied into Buffer.

Buffer

A caller-allocated buffer that receives the requested value.

If InformationType is DEVICE_SPEED, on successful return, Buffer indicates the operating speed of the device. 0x03 indicates high-speed or higher; 0x01 indicates full-speed or lower.

Return Value

WinUsb_QueryDeviceInformation returns TRUE if the operation succeeds. Otherwise, this routine returns FALSE, and the caller can retrieve the logged error by calling GetLastError.

GetLastError can return the following error code.

Return code Description
ERROR_INVALID_HANDLE
The caller passed NULL in the InterfaceHandle parameter.

Requirements

   
Target Platform Universal
Header winusb.h (include Winusb.h)
Library Winusb.lib
DLL Winusb.dll

See Also

WinUSB

WinUSB Functions

WinUsb_Initialize