---
title: setProperty
framework: kernel
role: pseudoSymbol
path: kernel/ioregistryentry/1811442-setproperty
---

# setProperty

Synchronized method to construct and add an OSData property to a registry entry's property table.

## Declaration

```occ
virtual bool setProperty(
 const char *aKey, 
 void *bytes, 
 unsigned intlength); 
```

## Parameters

- `aKey`: The property's name as a C-string.
- `bytes`: The property's value as a pointer. OSData will copy this data.
- `length`: The property's size in bytes, for OSData.

## Return Value

Return Value true on success or false on a resource failure.

## Overview

Overview This method will add or replace a property in a registry entry's property table, using the OSDictionary::setObject semantics. This method is synchronized with other IORegistryEntry accesses to the property table. The property is created as an OSData copied from the supplied data and length, set in the property table with the given name, and released.

## See Also

### Miscellaneous

- [attachToChild](kernel/ioregistryentry/1810177-attachtochild.md)
- [attachToParent](kernel/ioregistryentry/1810196-attachtoparent.md)
- [childFromPath](kernel/ioregistryentry/1810215-childfrompath.md)
- [compareName](kernel/ioregistryentry/1810236-comparename.md)
- [compareNames](kernel/ioregistryentry/1810259-comparenames.md)
- [copyChildEntry](kernel/ioregistryentry/1810279-copychildentry.md)
- [copyLocation](kernel/ioregistryentry/1810296-copylocation.md)
- [copyName](kernel/ioregistryentry/1810315-copyname.md)
- [copyParentEntry](kernel/ioregistryentry/1810335-copyparententry.md)
- [copyProperty(const char *)](kernel/ioregistryentry/1810352-copyproperty.md)
- [copyProperty(const char *, const IORegistryPlane *, IOOptionBits)](kernel/ioregistryentry/1810371-copyproperty.md)
- [copyProperty(const OSString *)](kernel/ioregistryentry/1810386-copyproperty.md)
- [copyProperty(const OSString *, const IORegistryPlane *, IOOptionBits)](kernel/ioregistryentry/1810403-copyproperty.md)
- [copyProperty(const OSSymbol *)](kernel/ioregistryentry/1810428-copyproperty.md)
- [copyProperty(const OSSymbol *, const IORegistryPlane *, IOOptionBits)](kernel/ioregistryentry/1810451-copyproperty.md)
- [dealiasPath](kernel/ioregistryentry/1810478-dealiaspath.md)
- [detachAbove](kernel/ioregistryentry/1810509-detachabove.md)
- [detachAll](kernel/ioregistryentry/1810550-detachall.md)
- [detachFromChild](kernel/ioregistryentry/1810594-detachfromchild.md)
- [detachFromParent](kernel/ioregistryentry/1810632-detachfromparent.md)
- [dictionaryWithProperties](kernel/ioregistryentry/1810672-dictionarywithproperties.md)
- [free](kernel/ioregistryentry/1810704-free.md)
- [fromPath(const char *, const IORegistryPlane *, char *, int *)](kernel/ioregistryentry/1810742-frompath.md)
- [fromPath(const char *, const IORegistryPlane *, char *, int *, IORegistryEntry *)](kernel/ioregistryentry/1810796-frompath.md)
- [getChildEntry](kernel/ioregistryentry/1810842-getchildentry.md)
- [getChildIterator](kernel/ioregistryentry/1810873-getchilditerator.md)
- [getDepth](kernel/ioregistryentry/1810910-getdepth.md)
- [getGenerationCount](kernel/ioregistryentry/1810941-getgenerationcount.md)
- [getLocation](kernel/ioregistryentry/1810970-getlocation.md)
- [getName](kernel/ioregistryentry/1810990-getname.md)
- [getParentEntry](kernel/ioregistryentry/1811012-getparententry.md)
- [getParentIterator](kernel/ioregistryentry/1811037-getparentiterator.md)
- [getPath](kernel/ioregistryentry/1811074-getpath.md)
- [getPathComponent](kernel/ioregistryentry/1811114-getpathcomponent.md)
- [getPlane](kernel/ioregistryentry/1811147-getplane.md)
- [getProperty(const char *)](kernel/ioregistryentry/1811182-getproperty.md)
- [getProperty(const char *, const IORegistryPlane *, IOOptionBits)](kernel/ioregistryentry/1811215-getproperty.md)
- [getProperty(const OSString *)](kernel/ioregistryentry/1811230-getproperty.md)
- [getProperty(const OSString *, const IORegistryPlane *, IOOptionBits)](kernel/ioregistryentry/1811244-getproperty.md)
- [getProperty(const OSSymbol *)](kernel/ioregistryentry/1811254-getproperty.md)
- [getProperty(const OSSymbol *, const IORegistryPlane *, IOOptionBits)](kernel/ioregistryentry/1811263-getproperty.md)
- [getPropertyTable](kernel/ioregistryentry/1811272-getpropertytable.md)
- [getRegistryEntryID](kernel/ioregistryentry/1811281-getregistryentryid.md)
- [getRegistryRoot](kernel/ioregistryentry/1811288-getregistryroot.md)
- [init](kernel/ioregistryentry/1811299-init.md)
- [inPlane](kernel/ioregistryentry/1811307-inplane.md)
- [isChild](kernel/ioregistryentry/1811317-ischild.md)
- [isParent](kernel/ioregistryentry/1811327-isparent.md)
- [makePlane](kernel/ioregistryentry/1811335-makeplane.md)
- [removeProperty](kernel/ioregistryentry/1811343-removeproperty.md)
- [removeProperty(const OSString *)](kernel/ioregistryentry/1811354-removeproperty.md)
- [removeProperty(const OSSymbol *)](kernel/ioregistryentry/1811362-removeproperty.md)
- [runPropertyAction](kernel/ioregistryentry/1811370-runpropertyaction.md)
- [serializeProperties](kernel/ioregistryentry/1811384-serializeproperties.md)
- [setLocation](kernel/ioregistryentry/1811397-setlocation.md)
- [setName(const char *, const IORegistryPlane *)](kernel/ioregistryentry/1811407-setname.md)
- [setName(const OSSymbol *, const IORegistryPlane *)](kernel/ioregistryentry/1811420-setname.md)
- [setProperties](kernel/ioregistryentry/1811430-setproperties.md)
- [setProperty(const char *, bool)](kernel/ioregistryentry/1811451-setproperty.md)
- [setProperty(const char *, const char *)](kernel/ioregistryentry/1811461-setproperty.md)
- [setProperty(const char *, OSObject *)](kernel/ioregistryentry/1811476-setproperty.md)
- [setProperty(const char *, unsigned long long, unsigned int)](kernel/ioregistryentry/1811491-setproperty.md)
- [setProperty(const OSString *, OSObject *)](kernel/ioregistryentry/1811507-setproperty.md)
- [setProperty(const OSSymbol *, OSObject *)](kernel/ioregistryentry/1811520-setproperty.md)
- [setPropertyTable](kernel/ioregistryentry/1811536-setpropertytable.md)
