---
title: setMemoryDescriptor
framework: kernel
role: pseudoSymbol
path: kernel/iointerleavedmemorydescriptor/1812618-setmemorydescriptor
---

# setMemoryDescriptor

Add a portion of an IOMemoryDescriptor to the IOInterleavedMemoryDescriptor.

## Declaration

```occ
virtual bool setMemoryDescriptor(
 IOMemoryDescriptor *descriptor, 
 IOByteCountoffset, 
 IOByteCountlength ); 
```

## Parameters

- `descriptor`: An IOMemoryDescriptor to be added to the IOInterleavedMemoryDescriptor. Its direction must be compatible with that of the IOInterleavedMemoryDescriptor.
- `offset`: The offset into the IOMemoryDescriptor of the portion that will be added to the virtualized buffer.
- `length`: The length of the portion of the IOMemoryDescriptor to be added to the virtualized buffer.

## Return Value

Return Value Returns true the portion was successfully added.

## Overview

Overview This method adds the portion of an IOMemoryDescriptor described by the offset and length parameters to the end of the IOInterleavedMemoryDescriptor. A single IOMemoryDescriptor may be added as many times as there is room for it. The offset and length must describe a portion entirely within the IOMemoryDescriptor.

## See Also

### Miscellaneous

- [clearMemoryDescriptors](kernel/iointerleavedmemorydescriptor/1812566-clearmemorydescriptors.md)
- [complete](kernel/iointerleavedmemorydescriptor/1812579-complete.md)
- [getPhysicalSegment](kernel/iointerleavedmemorydescriptor/1812587-getphysicalsegment.md)
- [initWithCapacity](kernel/iointerleavedmemorydescriptor/1812598-initwithcapacity.md)
- [prepare](kernel/iointerleavedmemorydescriptor/1812608-prepare.md)
- [withCapacity](kernel/iointerleavedmemorydescriptor/1812626-withcapacity.md)
