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

# CopyClientMemoryForType

Return an IOMemoryDescriptor to be mapped into the client task.

```
virtual kern_return_t CopyClientMemoryForType(uint64_t type, uint64_t *options, IOMemoryDescriptor **memory);
```

## Parameters

`type`

Type parameter IOConnectMapMemory()/UnmapMemory().

`options`

Set kIOUserClientMemoryReadOnly for memory to be mapped read only in the client.

`memory`

An instance of IOMemoryDescriptor on success. One reference will be consumed by the caller of this method.

## Return Value

kIOReturnSuccess on success. See IOReturn.h for error codes.

## Discussion

IOConnectMapMemory()/UnmapMemory() will result in a call to this method to obtain an IOMemoryDescriptor instance for shared memory. For a given IOUserClient instance, calling CopyClientMemoryForType() with a given type, should return the same IOMemoryDescriptor instance.

---

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)