Returns the IOService a connect handle was opened on.
SDKs
- macOS 10.0+
- Mac Catalyst 13.0+
Framework
- IOKit
Declaration
func IOConnectGetService(_ connect: io _connect _t, _ service: Unsafe Mutable Pointer<io _service _t>!) -> kern _return _t
Parameters
connect
The connect handle created by IOServiceOpen.
service
On succes, the service handle the connection was opened on, which should be released with IOObjectRelease.
Return Value
A kern_return_t error code.
Discussion
Finds the service object a connection was opened on.