Function

IOServiceGetMatchingServices

Look up registered IOService objects that match a matching dictionary.

Declaration

kern_return_t IOServiceGetMatchingServices(mach_port_t masterPort, CFDictionaryRef matching, io_iterator_t *existing);

Parameters

masterPort

The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.

matching

A CF dictionary containing matching information, of which one reference is always consumed by this function (Note prior to the Tiger release there was a small chance that the dictionary might not be released if there was an error attempting to serialize the dictionary). IOKitLib can construct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOServiceNameMatching, IOBSDNameMatching.

existing

An iterator handle is returned on success, and should be released by the caller when the iteration is finished.

Return Value

A kern_return_t error code.

Discussion

This is the preferred method of finding IOService objects currently registered by IOKit (that is, objects that have had their registerService() methods invoked). To find IOService objects that aren't yet registered, use an iterator as created by IORegistryEntryCreateIterator(). IOServiceAddMatchingNotification can also supply this information and install a notification of new IOServices. The matching information used in the matching dictionary may vary depending on the class of service being looked up.

See Also

Miscellaneous

IOBSDNameMatching

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

IOConnectAddClient

Inform a connection of a second connection.

IOConnectAddRef

Adds a reference to the connect handle.

IOConnectGetService

Returns the IOService a connect handle was opened on.

IOConnectMapMemory

Map hardware or shared memory into the caller's task.

IOConnectMapMemory64

Map hardware or shared memory into the caller's task.

IOConnectRelease

Remove a reference to the connect handle.

IOConnectSetCFProperties

Set CF container based properties on a connection.

IOConnectSetCFProperty

Set a CF container based property on a connection.

IOConnectSetNotificationPort

Set a port to receive family specific notifications.

IOConnectUnmapMemory

Remove a mapping made with IOConnectMapMemory.

IOConnectUnmapMemory64

Remove a mapping made with IOConnectMapMemory64.

IOCreateReceivePort

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

IODispatchCalloutFromMessage

Dispatches callback notifications from a mach message.

IOIteratorIsValid

Checks an iterator is still valid.

IOIteratorNext

Returns the next object in an iteration.

IOIteratorReset

Resets an iteration back to the beginning.

IOKitGetBusyState

Returns the busyState of all IOServices.

IOKitWaitQuiet

Wait for a all IOServices' busyState to be zero.

IOMasterPort

Returns the mach port used to initiate communication with IOKit.

IONotificationPortCreate

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

IONotificationPortDestroy

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

IONotificationPortGetMachPort

Returns a mach_port to be used to listen for notifications.

IONotificationPortGetRunLoopSource

Returns a CFRunLoopSource to be used to listen for notifications.

IONotificationPortSetDispatchQueue

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

IOObjectConformsTo

Performs an OSDynamicCast operation on an IOKit object.

IOObjectCopyBundleIdentifierForClass

Return the bundle identifier of the given class.

IOObjectCopyClass

Return the class name of an IOKit object.

IOObjectCopySuperclassForClass

Return the superclass name of the given class.

IOObjectGetClass

Return the class name of an IOKit object.

IOObjectGetKernelRetainCount

Returns kernel retain count of an IOKit object.

IOObjectGetRetainCount

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

IOObjectGetUserRetainCount

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

IOObjectIsEqualTo

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

IOObjectRelease

Releases an object handle previously returned by IOKitLib.

IOObjectRetain

Retains an object handle previously returned by IOKitLib.

IORegistryCreateIterator

Create an iterator rooted at the registry root.

IORegistryEntryCreateCFProperties

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

IORegistryEntryCreateCFProperty

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

IORegistryEntryCreateIterator

Create an iterator rooted at a given registry entry.

IORegistryEntryFromPath

Looks up a registry entry by path.

IORegistryEntryGetChildEntry

Returns the first child of a registry entry in a plane.

IORegistryEntryGetChildIterator

Returns an iterator over an registry entry's child entries in a plane.

IORegistryEntryGetLocationInPlane

Returns a C-string location assigned to a registry entry, in a specified plane.

IORegistryEntryGetName

Returns a C-string name assigned to a registry entry.

IORegistryEntryGetNameInPlane

Returns a C-string name assigned to a registry entry, in a specified plane.

IORegistryEntryGetParentEntry

Returns the first parent of a registry entry in a plane.

IORegistryEntryGetParentIterator

Returns an iterator over an registry entry's parent entries in a plane.

IORegistryEntryGetPath

Create a path for a registry entry.

IORegistryEntryGetRegistryEntryID

Returns an ID for the registry entry that is global to all tasks.

IORegistryEntryIDMatching

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

IORegistryEntryInPlane

Determines if the registry entry is attached in a plane.

IORegistryEntrySearchCFProperty

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

IORegistryEntrySetCFProperties

Set CF container based properties in a registry entry.

IORegistryEntrySetCFProperty

Set a CF container based property in a registry entry.

IORegistryGetRootEntry

Return a handle to the registry root.

IORegistryIteratorEnterEntry

Recurse into the current entry in the registry iteration.

IORegistryIteratorExitEntry

Exits a level of recursion, restoring the current entry.

IOServiceAddInterestNotification

Register for notification of state changes in an IOService.

IOServiceAddMatchingNotification

Look up registered IOService objects that match a matching dictionary, and install a notification request of new IOServices that match.

IOServiceClose

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

IOServiceGetBusyState

Returns the busyState of an IOService.

IOServiceGetMatchingService

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

IOServiceMatching

Create a matching dictionary that specifies an IOService class match.

IOServiceMatchPropertyTable

Match an IOService objects with matching dictionary.

IOServiceNameMatching

Create a matching dictionary that specifies an IOService name match.

IOServiceOpen

A request to create a connection to an IOService.

IOServiceRequestProbe

A request to rescan a bus for device changes.

IOServiceWaitQuiet

Wait for an IOService's busyState to be zero.