Beispiel #1
0
bool AppleALC::start(IOService *provider) {
	DBGLOG("init @ starting AppleALC");
	
	if (!IOService::start(provider)) {
		SYSLOG("init @ failed to start the parent");
		return false;
	}
	
	getBootArguments();
	
	if (!isEnabled) {
		DBGLOG("init @ no boot arguments or found a disabling argument, exiting");
		return false;
	}

	bool res = enabler.init();
	if (!res) enabler.deinit();
	return res;
}
Beispiel #2
0
bool AppleALC::init(OSDictionary *dict) {
	if (!IOService::init(dict)) {
		SYSLOG("init @ failed to initalise the parent");
		return false;
	}
	
	getBootArguments();
	
	if (isDisabled) {
		SYSLOG("init @ found a disabling argument or no arguments, exiting");
		return false;
	}
	
	if (mode == StartMode::Policy) {
		DBGLOG("init @ initialising AppleALC with policy mode");
		
		if (mac_policy_register(&policyConf, &policyHandle, NULL)) {
			SYSLOG("init @ failed to register the policy");
			return false;
		}
	}
	
	return true;
}