<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/IODataQueueDispatchSource/Create",
  "metadataVersion" : "0.1.0",
  "role" : "Static Method",
  "symbol" : {
    "kind" : "Static Method",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@IODataQueueDispatchSource@F@Create#k#*$@S@IODispatchQueue#**$@S@IODataQueueDispatchSource#S"
  },
  "title" : "Create"
}
-->

# Create

Creates a dispatch source that you use as a shared-memory data queue.

```
static kern_return_t Create(uint64_t queueByteCount, IODispatchQueue *queue, IODataQueueDispatchSource **source);
```

## Parameters

`queueByteCount`

The size of the queue in bytes.

`queue`

The dispatch queue to use for executing tasks. Note that the [`DataAvailable`](/documentation/DriverKit/IODataQueueDispatchSource/DataAvailable) and [`DataServiced`](/documentation/DriverKit/IODataQueueDispatchSource/DataServiced) handlers execute on the queue set for the target method of the associated [`OSAction`](/documentation/DriverKit/OSAction) object, not this queue.

`source`

A variable for storing the resulting dispatch source object. On success, the returned object has a retain count of 1, and you must release it when finished.

## Return Value

[`kIOReturnSuccess`](/documentation/DriverKit/kIOReturnSuccess) on success, or another value if an error occurs. See [Error Codes](/documentation/DriverKit/error-codes).

---

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)