---
title: CopyStringDescriptor
framework: usbdriverkit
role: symbol
role_heading: Instance Method
path: usbdriverkit/iousbhostdevice/copystringdescriptor-28ybo
---

# CopyStringDescriptor

Returns a string descriptor from the device.

## Declaration

```occ
virtual const IOUSBStringDescriptor * CopyStringDescriptor(uint8_t index, uint16_t languageID);
```

## Parameters

- `index`: The descriptor index value. This parameter corresponds to the low byte of wValue of the SET_DESCRIPTOR control request (USB 2.0, section 9.4.8).
- `languageID`: The descriptor language ID. This parameter corresponds to the wIndex value of the SET_DESCRIPTOR control request (USB 2.0, section 9.4.8).

## Return Value

Return Value A pointer to the descriptor, if found. It’s your responsibility to free the returned descriptor.

## Discussion

Discussion This method searches the descriptor cache for the specified descriptor. If the descriptor isn’t in the cache, the method retrieves it from the device using a GET_DESCRIPTOR control request (USB 2.0, section 9.4.3) and adds it to the cache. When making a GET_DESCRIPTOR control request, this method acquires the service’s workloop lock and may call commandSleep.

## See Also

### Getting the Device Descriptors

- [CopyCapabilityDescriptors](usbdriverkit/iousbhostdevice/copycapabilitydescriptors.md)
- [CopyConfigurationDescriptor](usbdriverkit/iousbhostdevice/copyconfigurationdescriptor-lej1.md)
- [CopyConfigurationDescriptor](usbdriverkit/iousbhostdevice/copyconfigurationdescriptor-6qgew.md)
- [CopyConfigurationDescriptorWithValue](usbdriverkit/iousbhostdevice/copyconfigurationdescriptorwithvalue.md)
- [CopyDeviceDescriptor](usbdriverkit/iousbhostdevice/copydevicedescriptor.md)
- [CopyStringDescriptor](usbdriverkit/iousbhostdevice/copystringdescriptor-9h8l2.md)
- [CopyDescriptor](usbdriverkit/iousbhostdevice/copydescriptor.md)
- [tIOUSBDeviceRequestTypeValue](usbdriverkit/tiousbdevicerequesttypevalue.md)
- [tIOUSBDeviceRequestRecipientValue](usbdriverkit/tiousbdevicerequestrecipientvalue.md)
- [Descriptor Utilities](usbdriverkit/descriptor-utilities.md)
