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

# CopyDispatchQueue

Gets the dispatch queue with the specified name from the current service.

```
virtual kern_return_t CopyDispatchQueue(const IODispatchQueueName name, IODispatchQueue **queue);
```

## Parameters

`name`

The name you assigned to the dispatch queue. Specify `kIOServiceDefaultQueueName` to retrieve the default dispatch queue.

`queue`

A variable to use for storing the dispatch queue. On return, this parameter contains the retained queue, or `NULL` if no queue matches the specified name. You are responsible for releasing the returned dispatch queue.

## Return Value

[`kIOReturnSuccess`](/documentation/DriverKit/kIOReturnSuccess) on success, or another value if an error occurs. For a list of error codes, 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)