mirror of
https://github.com/darlinghq/darling-security.git
synced 2025-03-01 06:56:12 +00:00
Disable IOKit notification handling
This commit is contained in:
parent
1d7eef9a7e
commit
250e8a5ce4
@ -127,6 +127,7 @@ IOPowerWatcher::setupDarkWake()
|
||||
IOPowerWatcher::IOPowerWatcher() :
|
||||
mKernelPort(0), mIOPMconn(NULL), mIOPMqueue(NULL), mDarkWakeGroup(NULL), mUserActiveHandle(NULL)
|
||||
{
|
||||
#ifndef DARLING
|
||||
if (!(mKernelPort = ::IORegisterForSystemPower(this, &mPortRef, ioCallback, &mHandle)))
|
||||
UnixError::throwMe(EINVAL); // no clue
|
||||
|
||||
@ -140,6 +141,7 @@ IOPowerWatcher::IOPowerWatcher() :
|
||||
mDarkWakeGroup = dispatch_group_create();
|
||||
dispatch_group_enter(mDarkWakeGroup);
|
||||
dispatch_async(mIOPMqueue, ^ { setupDarkWake(); });
|
||||
#endif
|
||||
}
|
||||
|
||||
IOPowerWatcher::~IOPowerWatcher()
|
||||
@ -239,7 +241,9 @@ void IOPowerWatcher::ioCallback(void *refCon, io_service_t service,
|
||||
//
|
||||
PortPowerWatcher::PortPowerWatcher()
|
||||
{
|
||||
#ifndef DARLING
|
||||
port(IONotificationPortGetMachPort(mPortRef));
|
||||
#endif
|
||||
}
|
||||
|
||||
boolean_t PortPowerWatcher::handle(mach_msg_header_t *in)
|
||||
|
@ -58,8 +58,10 @@ Server::Server(CodeSignatures &signatures, const char *bootstrapName)
|
||||
// make me eternal (in the object mesh)
|
||||
ref();
|
||||
|
||||
#ifndef DARLING
|
||||
// engage the subsidiary port handler for sleep notifications
|
||||
add(sleepWatcher);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user