UdecxUsbDeviceInitAddStringDescriptor function (udecxusbdevice.h)

Adds a USB string descriptor to the initialization parameters used to create a virtual USB device.

Syntax

NTSTATUS UdecxUsbDeviceInitAddStringDescriptor(
  [in, out] PUDECXUSBDEVICE_INIT UdecxUsbDeviceInit,
  [in]      PCUNICODE_STRING     String,
  [in]      UCHAR                DescriptorIndex,
  [in]      USHORT               LanguageId
);

Parameters

[in, out] UdecxUsbDeviceInit

A pointer to a WDF-allocated structure that contains initialization parameters for the virtual USB device. The client driver retrieved this pointer in the previous call to UdecxUsbDeviceInitAllocate.

[in] String

A Unicode string that contains the USB string descriptor to add to the device.

[in] DescriptorIndex

The index of the descriptor.

[in] LanguageId

The language identifier of the string. The client driver must define constants for the language support, such as:

const USHORT US_ENGLISH = 0x409;

Return value

The method returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method might return an appropriate NTSTATUS error code.

Requirements

Requirement Value
Minimum supported client Windows 10
Minimum supported server Windows Server 2016
Target Platform Windows
Minimum KMDF version 1.15
Header udecxusbdevice.h (include Udecx.h)
Library Udecxstub.lib
IRQL PASSIVE_LEVEL

See also

Architecture: USB Device Emulation (UDE)

USB String Descriptors

UdecxUsbDeviceInitAllocate

Write a UDE client driver