<!--
{
  "availability" : [
    "DriverKit: 19.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "USBDriverKit",
  "identifier" : "/documentation/USBDriverKit/IOUSBHostDevice/CopyConfigurationDescriptor-6qgew",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "USBDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUSBHostDevice@F@CopyConfigurationDescriptor#*$@S@IOService#"
  },
  "title" : "CopyConfigurationDescriptor"
}
-->

# CopyConfigurationDescriptor

Returns the currently selected configuration descriptor.

```
virtual const IOUSBConfigurationDescriptor * CopyConfigurationDescriptor(IOService *forClient);
```

## Parameters

`forClient`

The current service object. You may specify `NULL` for this parameter.

## Return Value

A pointer to the configuration descriptor if found, or `NULL` if the device isn’t configured. It’s your responsibility to free the returned descriptor.

## 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 <doc://com.apple.documentation/documentation/kernel/iocommandgate/1573818-commandsleep>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)