Re: kuncexecute()
Re: kuncexecute()
- Subject: Re: kuncexecute()
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Wed, 09 Jan 2013 14:27:17 +0000
On 9 Jan 2013, at 14:02, Mehdi Esmaeelpour <email@hidden> wrote:
> My user-space program get the current focused window(application's name) and i want to use application's name(string) in kernel-space program
Indeed. This present some serious architectural issues. For example:
o it's possible for no user to be logged in
o it's possible for multiple GUI users to be logged in (via any combination of the console and screen sharing)
o it's possible for GUI users to be logged in but with none of them on the console
What are you expecting KUNCExecute to do in these cases?
This gets back to something I mentioned earlier: KUNCExecute was deprecated because it's fundamentally incompatible with the OS X architecture.
In your case you should have a GUI launchd agent, with one instance per GUI login session, that communicates the state of that session to your kernel extension via standard user-to-kernel IPC. These GUI launchd agents will always be running in the correct GUI login context, avoiding a whole world of grief.
You might also want to look at Technote 2083 "Daemons and Agents", which discusses the background to this issue in laborious detail.
<https://developer.apple.com/library/mac/#technotes/tn2083/_index.html>
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden