---
title: CopyInterface
framework: usbdriverkit
role: symbol
role_heading: Instance Method
path: usbdriverkit/iousbhostdevice/copyinterface
---

# CopyInterface

Gets the next host interface child associated with this device.

## Declaration

```occ
virtual kern_return_t CopyInterface(uintptr_t ref, IOUSBHostInterface **interface);
```

## Parameters

- `ref`: The opaque iterator reference you received from the doc://com.apple.usbdriverkit/documentation/USBDriverKit/IOUSBHostDevice/CreateInterfaceIterator method.
- `interface`: A pointer to a variable. On output, this variable contains a pointer to the next doc://com.apple.usbdriverkit/documentation/USBDriverKit/IOUSBHostInterface object. When there are no more iterfaces, this method assigns NULL to the variable.

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurs. See Error Codes.

## Discussion

Discussion Keep calling this method until the value in the interface parameter is NULL.

## See Also

### Iterating Over the Device Interfaces

- [CreateInterfaceIterator](usbdriverkit/iousbhostdevice/createinterfaceiterator.md)
- [DestroyInterfaceIterator](usbdriverkit/iousbhostdevice/destroyinterfaceiterator.md)
