---
title: DoAsyncUnmap
framework: BlockStorageDeviceDriverKit
role: symbol
role_heading: Instance Method
platforms: [driverkit 21.0+]
path: blockstoragedevicedriverkit/iouserblockstoragedevice/doasyncunmap
---

# DoAsyncUnmap

Sends an asynchronous request to the dext to reclaim storage by unmapping.

## Declaration

```occ
virtual kern_return_t DoAsyncUnmap(uint32_t requestID, IOMemoryDescriptor *buffer, uint32_t numOfRanges);
```

## Parameters

- `requestID`: An opaque identifier. After the dext completes the request, it calls doc://com.apple.blockstoragedevicedriverkit/documentation/BlockStorageDeviceDriverKit/IOUserBlockStorageDevice/Complete and sends this value as a parameter.
- `buffer`: A memory buffer containing the block ranges to unmap.
- `numOfRanges`: The number of ranges in buffer.

## Return Value

Return Value A value that indicates the unmap result. kIOReturnSuccess indicates success. For error definitions, see IOKit Constants.

## Discussion

Discussion When the unmap operation completes, the dext calls your Complete method with the results of the operation.

## See Also

### Accessing the Device

- [BlockRange](blockstoragedevicedriverkit/blockrange.md)
- [DoAsyncSynchronize](blockstoragedevicedriverkit/iouserblockstoragedevice/doasyncsynchronize.md)
- [DoAsyncEjectMedia](blockstoragedevicedriverkit/iouserblockstoragedevice/doasyncejectmedia.md)
- [Complete](blockstoragedevicedriverkit/iouserblockstoragedevice/complete.md)
- [DoAsyncReadWrite](blockstoragedevicedriverkit/iouserblockstoragedevice/doasyncreadwrite.md)
- [IOUserStorageOptions](blockstoragedevicedriverkit/iouserstorageoptions.md)
- [CompleteIO](blockstoragedevicedriverkit/iouserblockstoragedevice/completeio.md)
