Connects the caller to an IOService for the purpose of receiving power state change notifications for the device controlled by the IOService.
- macOS 10.0–10.9Deprecated
Data returned on power state change notifications and not used by the kernel.
Representation of the IOService, probably from IOServiceGetMatchingService.
Pointer to a port on which the caller will receive power state change notifications. The port is allocated by the calling application.
A c-function which is called during the notification.
Pointer to a notifier which caller must keep and pass to subsequent call to IODeregisterApp.
Returns a io_connect_t session for the IOService or MACH_PORT_NULL if request failed. Caller must close return value via IOServiceClose() after calling IODeregisterApp on the notifier argument.
IORegisterApp requires that the IOService of interest implement an IOUserClient. In addition, that IOUserClient must implement the allowPowerChange and cancelPowerChange methods defined in IOPMLibDefs.h. If you're interested in receiving power state notifications from a device without an IOUserClient, try using IOServiceAddInterestNotification with interest type gIOGeneralInterest instead.