---
title: IOUSBGetNextDescriptorWithType
framework: usbdriverkit
role: symbol
role_heading: Function
path: usbdriverkit/iousbgetnextdescriptorwithtype
---

# IOUSBGetNextDescriptorWithType

Finds the next descriptor matching a given type within a configuration descriptor.

## Declaration

```occ
const IOUSBDescriptorHeader *IOUSBGetNextDescriptorWithType(const IOUSBConfigurationDescriptor *configurationDescriptor, const IOUSBDescriptorHeader *currentDescriptor, const uint8_t type);
```

## Parameters

- `configurationDescriptor`: The configuration descriptor that contains the descriptors to iterate through.
- `currentDescriptor`: A descriptor pointer within the bounds of the configuration descriptor, or NULL.
- `type`: The type of descriptor to find.

## Return Value

Return Value A descriptor pointer, or NULL if no matching descriptor can be found.

## Discussion

Discussion This method uses getNextDescriptor, and further validates that the returned descriptor’s bDescriptorType field matches the type parameter.

## See Also

### Configuration Descriptors

- [IOUSBGetNextDescriptor](usbdriverkit/iousbgetnextdescriptor.md)
- [IOUSBGetNextAssociatedDescriptor](usbdriverkit/iousbgetnextassociateddescriptor.md)
- [IOUSBGetNextAssociatedDescriptorWithType](usbdriverkit/iousbgetnextassociateddescriptorwithtype.md)
- [IOUSBGetConfigurationMaxPowerMilliAmps](usbdriverkit/iousbgetconfigurationmaxpowermilliamps.md)
