---
title: getPreparedOffsetAndLength
framework: kernel
role: pseudoSymbol
path: kernel/iodmacommand/1811194-getpreparedoffsetandlength
---

# getPreparedOffsetAndLength

Returns the offset and length into the target IOMemoryDescriptor of a prepared IODDMACommand.

## Declaration

```occ
virtual IOReturn getPreparedOffsetAndLength(
 UInt64 *offset,
 UInt64 *length); 
```

## Parameters

- `offset`: returns the starting offset in the memory descriptor the DMA command was prepared with. Pass NULL for don't care.
- `length`: returns the length in the memory descriptor the DMA command was prepared with. Pass NULL for don't care.

## Return Value

Return Value An IOReturn code. kIOReturnNotReady if the IODMACommand is not prepared.

## Overview

Overview If successfully prepared, returns the offset and length into the IOMemoryDescriptor. Will fail for an unprepared IODMACommand.

## See Also

### Configuring the Memory Descriptor

- [setMemoryDescriptor](kernel/iodmacommand/1811308-setmemorydescriptor.md)
- [setMemoryDescriptor](kernel/iodmacommand/1547727-setmemorydescriptor.md)
- [clearMemoryDescriptor](kernel/iodmacommand/1811032-clearmemorydescriptor.md)
- [clearMemoryDescriptor](kernel/iodmacommand/1547715-clearmemorydescriptor.md)
- [getMemoryDescriptor](kernel/iodmacommand/1811175-getmemorydescriptor.md)
- [getMemoryDescriptor](kernel/iodmacommand/1547753-getmemorydescriptor.md)
- [getIOMemoryDescriptor](kernel/iodmacommand/1547736-getiomemorydescriptor.md)
- [getPreparedOffsetAndLength](kernel/iodmacommand/1547765-getpreparedoffsetandlength.md)
- [genIOVMSegments](kernel/iodmacommand/1811150-geniovmsegments.md)
- [genIOVMSegments](kernel/iodmacommand/1547720-geniovmsegments.md)
- [gen32IOVMSegments](kernel/iodmacommand/1811104-gen32iovmsegments.md)
- [gen32IOVMSegments](kernel/iodmacommand/1547749-gen32iovmsegments.md)
- [gen64IOVMSegments](kernel/iodmacommand/1811126-gen64iovmsegments.md)
- [gen64IOVMSegments](kernel/iodmacommand/1547722-gen64iovmsegments.md)
- [createCopyBuffer](kernel/iodmacommand/1547729-createcopybuffer.md)
