USBD_ValidateConfigurationDescriptor function

The USBD_ValidateConfigurationDescriptor routine validates all descriptors returned by a device in its response to a configuration descriptor request.

Syntax

DECLSPEC_IMPORT USBD_STATUS USBD_ValidateConfigurationDescriptor(
  PUSB_CONFIGURATION_DESCRIPTOR ConfigDesc,
  ULONG                         BufferLength,
  USHORT                        Level,
  PUCHAR                        *Offset,
  ULONG                         Tag
);

Parameters

ConfigDesc

Pointer to a configuration descriptor that includes all interface, endpoint, vendor, and class-specific descriptors retrieved from a USB device.

BufferLength

Size, in bytes, of the configuration descriptor being validated.

Level

Level of validation to be performed. The following are valid values:

  • 1-Basic validation of the configuration descriptor header.
  • 2-Full validation of the configuration descriptor including checking for invalid endpoint addresses, interface numbers, descriptor structures, interface alternate settings, number of interfaces and bLength fields of all descriptors.
  • 3-In addition to the validation for levels 1 and 2, level 3 validates plus validates the number of endpoints in each interface, enforces the USB specification's descriptor bLength sizes, and verifies that all interface numbers are in sequential order.

Offset

Offset within configuration descriptor where validation failed. Only valid when a status other than USBD_STATUS_SUCCESS is returned.

Tag

Pool tag used by USBD_ValidateConfigurationDescriptor when allocating memory.

Return Value

USBD_STATUS_SUCCESS, or appropriate USBD error code if validation failed.

Requirements

   
Windows version Available in Windows Vista and later operating systems.
Target Platform Universal
Header usbdlib.h (include Usbdlib.h)
Library Usbd.lib
IRQL PASSIVE_LEVEL

See Also

USB device driver programming reference