Register for notification of state changes in an IOService.
- macOS 10.0+
- Mac Catalyst 13.0+Beta
A IONotificationPortRef object that controls how messages will be sent when the notification is fired. See IONotificationPortCreate.
A notification type from IOKitKeys.h
kIOGeneralInterest General state changes delivered via the IOService::message API.
kIOBusyInterest Delivered when the IOService changes its busy state to or from zero. The message argument contains the new busy state causing the notification.
A callback function called when the notification fires, with messageType and messageArgument for the state change.
A reference constant for the callbacks use.
An object handle is returned on success, and should be released by the caller when the notification is to be destroyed.
A kern_return_t error code.
IOService objects deliver notifications of their state changes to their clients via the IOService::message API, and to other interested parties including callers of this function. Message type s are defined IOKit/IOMessage.h.
Create a matching dictionary that specifies an IOService match based on BSD device name.
Creates and returns a mach port suitable for receiving IOKit messages of the specified type.
Returns the mach port used to initiate communication with IOKit.
Creates and returns a notification object for receiving IOKit notifications of new devices or state changes.
Returns kernel retain count of an IOKit object. Identical to IOObjectGetKernelRetainCount() but available prior to Mac OS 10.6.
Checks two object handles to see if they represent the same kernel object.
Retains an object handle previously returned by IOKitLib.
Look up registered IOService objects that match a matching dictionary, and install a notification request of new IOServices that match.
Close a connection to an IOService and destroy the connect handle.
Create a matching dictionary that specifies an IOService class match.
This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.Learn more about using Apple's beta software