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

# CreateIOBuffer

Allocates a buffer for use during I/O operations.

```
virtual kern_return_t CreateIOBuffer(IOOptionBits options, uint64_t capacity, IOBufferMemoryDescriptor **buffer);
```

## Parameters

`options`

The direction of I/O transfer for the buffer. For a list of possible values, see `Memory Buffer Options`.

`capacity`

The size of the buffer to allocate in bytes.

`buffer`

A pointer to a variable. On success, this variable contains a pointer to a memory descriptor. It’s your responsibility to release this memory descriptor when you finish using it. If an error occurs, the method returns NULL instead.

## Return Value

<doc://com.apple.documentation/documentation/DriverKit/kIOReturnSuccess> on success, or another value if an error occurs. See <doc://com.apple.documentation/documentation/DriverKit/error-codes>.

## Discussion

This method allocates an <doc://com.apple.documentation/documentation/DriverKit/IOBufferMemoryDescriptor> optimized for use by the underlying controller hardware. A buffer allocated by this method isn’t bounced to perform DMA operations.

---

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)