Create a CF representation of a registry entry's property.


func IORegistryEntrySearchCFProperty(_ entry: io_registry_entry_t, _ plane: UnsafePointer<Int8>!, _ key: CFString!, _ allocator: CFAllocator!, _ options: IOOptionBits) -> CFTypeRef!



The registry entry at which to start the search.


The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.


A CFString specifying the property name.


The CF allocator to use when creating the CF container.


kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard IORegistryEntryCreateCFProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children.

Return Value

A CF container is created and returned the caller on success. The caller should release with CFRelease.


This function creates an instantaneous snapshot of a registry entry property, creating a CF container analogue in the caller's task. Not every object available in the kernel is represented as a CF container; currently OSDictionary, OSArray, OSSet, OSSymbol, OSString, OSData, OSNumber, OSBoolean are created as their CF counterparts. This function will search for a property, starting first with specified registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the same semantics as IORegistryEntryCreateCFProperty. The iteration keeps track of entries that have been recursed into previously to avoid loops.

See Also


func IOBSDNameMatching(mach_port_t, UInt32, UnsafePointer<Int8>!) -> CFMutableDictionary!

Create a matching dictionary that specifies an IOService match based on BSD device name.

func IOConnectAddRef(io_connect_t) -> kern_return_t

Adds a reference to the connect handle.

func IOConnectRelease(io_connect_t) -> kern_return_t

Remove a reference to the connect handle.

func IOConnectSetCFProperties(io_connect_t, CFTypeRef!) -> kern_return_t

Set CF container based properties on a connection.

func IOCreateReceivePort(UInt32, UnsafeMutablePointer<mach_port_t>!) -> kern_return_t

Creates and returns a mach port suitable for receiving IOKit messages of the specified type.

func IOIteratorIsValid(io_iterator_t) -> boolean_t

Checks an iterator is still valid.

func IOIteratorNext(io_iterator_t) -> io_object_t

Returns the next object in an iteration.

func IOIteratorReset(io_iterator_t)

Resets an iteration back to the beginning.

func IOMasterPort(mach_port_t, UnsafeMutablePointer<mach_port_t>!) -> kern_return_t

Returns the mach port used to initiate communication with IOKit.

func IONotificationPortCreate(mach_port_t) -> IONotificationPortRef!

Creates and returns a notification object for receiving IOKit notifications of new devices or state changes.

func IONotificationPortDestroy(IONotificationPortRef!)

Destroys a notification object created with IONotificationPortCreate. Also destroys any mach_port's or CFRunLoopSources obatined from IONotificationPortGetRunLoopSource(_:) or IONotificationPortGetMachPort(_:)

func IONotificationPortGetMachPort(IONotificationPortRef!) -> mach_port_t

Returns a mach_port to be used to listen for notifications.

func IONotificationPortGetRunLoopSource(IONotificationPortRef!) -> Unmanaged<CFRunLoopSource>!

Returns a CFRunLoopSource to be used to listen for notifications.

func IONotificationPortSetDispatchQueue(IONotificationPortRef!, DispatchQueue!)

Sets a dispatch queue to be used to listen for notifications.

func IOObjectConformsTo(io_object_t, UnsafePointer<Int8>!) -> boolean_t

Performs an OSDynamicCast operation on an IOKit object.

func IOObjectCopyClass(io_object_t) -> Unmanaged<CFString>!

Return the class name of an IOKit object.

func IOObjectGetKernelRetainCount(io_object_t) -> UInt32

Returns kernel retain count of an IOKit object.

func IOObjectGetRetainCount(io_object_t) -> UInt32

Returns kernel retain count of an IOKit object. Identical to IOObjectGetKernelRetainCount() but available prior to Mac OS 10.6.

func IOObjectGetUserRetainCount(io_object_t) -> UInt32

Returns the retain count for the current process of an IOKit object.

func IOObjectIsEqualTo(io_object_t, io_object_t) -> boolean_t

Checks two object handles to see if they represent the same kernel object.

func IOObjectRelease(io_object_t) -> kern_return_t

Releases an object handle previously returned by IOKitLib.

func IOObjectRetain(io_object_t) -> kern_return_t

Retains an object handle previously returned by IOKitLib.

func IORegistryEntryIDMatching(UInt64) -> CFMutableDictionary!

Create a matching dictionary that specifies an IOService match based on a registry entry ID.

func IORegistryEntryInPlane(io_registry_entry_t, UnsafePointer<Int8>!) -> boolean_t

Determines if the registry entry is attached in a plane.

func IORegistryIteratorEnterEntry(io_iterator_t) -> kern_return_t

Recurse into the current entry in the registry iteration.

func IORegistryIteratorExitEntry(io_iterator_t) -> kern_return_t

Exits a level of recursion, restoring the current entry.

func IOServiceClose(io_connect_t) -> kern_return_t

Close a connection to an IOService and destroy the connect handle.

func IOServiceGetMatchingService(mach_port_t, CFDictionary!) -> io_service_t

Look up a registered IOService object that matches a matching dictionary.

func IOServiceMatching(UnsafePointer<Int8>!) -> CFMutableDictionary!

Create a matching dictionary that specifies an IOService class match.

func IOServiceNameMatching(UnsafePointer<Int8>!) -> CFMutableDictionary!

Create a matching dictionary that specifies an IOService name match.

func IOServiceRequestProbe(io_service_t, UInt32) -> kern_return_t

A request to rescan a bus for device changes.