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

# DoAsyncReadWrite

Starts an asynchronous read or write operation.

## Declaration

```occ
virtual kern_return_t DoAsyncReadWrite(bool isRead, uint32_t requestID, uint64_t dmaAddr, uint64_t size, uint64_t lba, uint64_t numOfBlocks, IOUserStorageOptions options);
```

## Parameters

- `requestID`: An opaque identifier. After the dext completes the request, it calls doc://com.apple.blockstoragedevicedriverkit/documentation/BlockStorageDeviceDriverKit/IOUserBlockStorageDevice/CompleteIO and sends this value as a parameter.
- `dmaAddr`: The DMA address of the data buffer.
- `size`: The size of the data buffer.
- `lba`: The start logical block number.
- `numOfBlocks`: The number of blocks to read or write.
- `options`: Data transfer options. These can be any combination of kIOUserStorage… values (defined in doc://com.apple.blockstoragedevicedriverkit/documentation/BlockStorageDeviceDriverKit/IOUserStorageOptions) combined together with the logical OR operator.

## Return Value

Return Value A value that indicates the result of the read/write operation. kIOReturnSuccess indicates success. For error definitions, see IOKit Constants.

## Discussion

Discussion When the read or write operation completes, the dext calls your CompleteIO method with the results of the operation.

## See Also

### Accessing the Device

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