Connections & notifications
functionSLSMainConnectionIDcprobed
The calling process's connection to the window server. Almost every other call takes this connection id as its first argument. Non-zero once the process has a window-server connection; a launchd job with no GUI session gets 0.
Swift
let lib = dlopen("/System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight", RTLD_NOW)
typealias SLSMainConnectionID = @convention(c) () -> Int32
let cid = unsafeBitCast(dlsym(lib, "SLSMainConnectionID")!, to: SLSMainConnectionID.self)()
// -> 565531 on the probing machine; the value differs per processint SLSMainConnectionID(void);
also exported by CoreGraphics as
CGSMainConnectionIDNo published signature
| symbol | kind | CoreGraphics name |
|---|---|---|
| SLSConnectionBarrier | function | |
| SLSConnectionDispatchNotificationsToMainQueueIfNotMainThread | function | CGSConnectionDispatchNotificationsToMainQueueIfNotMainThread |
| SLSConnectionGetPID | function | CGSConnectionGetPID |
| SLSConnectionGetPIDAndVersion | function | |
| SLSConnectionHasValidPort | function | |
| SLSConnectionSetSpinning | function | CGSConnectionSetSpinning |
| SLSCoordinatedLocalNotificationCenter | function | |
| SLSCopyConnectionProperty | function | CGSCopyConnectionProperty |
| SLSCopyCoordinatedDistributedNotificationContinuationBlock | function | |
| SLSCopyCoordinatedDistributedNotificationFencePort | function | |
| SLSDefaultConnectionForThread | function | CGSDefaultConnectionForThread |
| SLSGetConnectionIDForPSN | function | CGSGetConnectionIDForPSN |
| SLSGetConnectionPSN | function | CGSGetConnectionPSN |
| SLSInstallRemoteContextNotificationHandler | function | CGSInstallRemoteContextNotificationHandler |
| SLSInstallRemoteContextNotificationHandlerV2 | function | |
| SLSNewConnection | function | CGSNewConnection |
| SLSOverrideAppSleepNotifications | function | CGSOverrideAppSleepNotifications |
| SLSPackagesEnableConnectionOcclusionNotifications | function | CGSPackagesEnableConnectionOcclusionNotifications |
| SLSPersistenceRegisterAsReady | function | CGSPersistenceRegisterAsReady |
| SLSPostBroadcastNotification | function | CGSPostBroadcastNotification |
| SLSPostCoordinatedDistributedNotification | function | |
| SLSPostCoordinatedDistributedNotificationFenced | function | |
| SLSPostNotificationToConnection | function | CGSPostNotificationToConnection |
| SLSRegisterConnectionNotifyProc | function | CGSRegisterConnectionNotifyProc |
| SLSRegisterNotifyProc | function | CGSRegisterNotifyProc |
| SLSReleaseConnection | function | CGSReleaseConnection |
| SLSRemoveConnectionNotifyProc | function | CGSRemoveConnectionNotifyProc |
| SLSRemoveNotifyProc | function | CGSRemoveNotifyProc |
| SLSRemoveRemoteContextNotificationHandler | function | CGSRemoveRemoteContextNotificationHandler |
| SLSServerHasValidConnections | function | CGSServerHasValidConnections |
| SLSServerPort | function | CGSServerPort |
| SLSSetConnectionProperty | function | CGSSetConnectionProperty |
| SLSSetDebugOptionsWithDataObtainingPort | function | |
| SLSSetOtherUniversalConnection | function | CGSSetOtherUniversalConnection |
| SLSShutdownServerConnections | function | CGSShutdownServerConnections |
| SLSSpinControlSetNotificationPort | function | CGSSpinControlSetNotificationPort |
| _SLSDefaultConnection | absent | |
| kSLSConnectionHasPluginPower | data | |
| kSLSConnectionSafeApertureCompatibility | data | |
| kSLSCoordinatedLogoutNotificationName | data | |
| kSLSCoordinatedTileResizeNotificationName | data | |
| kSLSPowerStateNotificationCallbackOptions | data | |
| kSLSPowerStateNotificationPayload | data | |
| kSLSPowerStateNotificationPayloadNone | data | |
| kSLSPowerStateNotificationRegistrationID | data | |
| kSLSPowerStateNotificationRegistrationState | data | |
| kSLSXPCNotificationErrorCode | data | |
| kSLSXPCNotificationErrorDescription | data | |
| kSLSXPCNotificationType | data | |
| kSLSXPCNotificationUUID | data | |
| kSLSXPCNotificationXPCObject | data | |
| kSLSXPCServiceCommand | data | |
| kSLSXPCServiceEndpoint | data | |
| kSLSXPCServicePayload | data | |
| kSLSXPCServicePayloadType | data | |
| kSLSXPCServiceUUID | data |