---
title: dispatch_data_copy_region
framework: dispatch
role: symbol
role_heading: Function
path: dispatch/dispatch_data_copy_region
---

# dispatch_data_copy_region

Returns a data object containing a portion of the data in another data object.

## Declaration

```occ
extern dispatch_data_tdispatch_data_copy_region(dispatch_data_t data, size_t location, size_t *offset_ptr);
```

## Parameters

- `data`: The dispatch data object to query.
- `location`: The byte offset to use when determining which memory region to return.
- `offset_ptr`: On input, a pointer to a variable. On output, this variable contains the offset from the beginning of data of the returned memory region.

## Return Value

Return Value A dispatch data object containing a copy of the entire memory region that contains the specified location.

## See Also

### Creating a Dispatch Data Object

- [dispatch_data_create](dispatch/dispatch_data_create.md)
- [dispatch_data_create_map](dispatch/dispatch_data_create_map.md)
- [dispatch_data_create_concat](dispatch/dispatch_data_create_concat.md)
- [dispatch_data_create_subrange](dispatch/dispatch_data_create_subrange.md)
- [dispatch_data_empty](dispatch/dispatch_data_empty.md)
- [dispatch_data_t](dispatch/dispatch_data_t.md)
- [OS_dispatch_data](dispatch/os_dispatch_data.md)
- [DISPATCH_DATA_DESTRUCTOR_DEFAULT](dispatch/dispatch_data_destructor_default.md)
- [DISPATCH_DATA_DESTRUCTOR_FREE](dispatch/dispatch_data_destructor_free.md)
