<p>I would like to create events for certain resources that are used across various processes and access these events by name. The problem seems to be that the names of the events must be known to all applications referring to them.</p>

<p>Is there maybe a way to get a list of names events in the system?</p>

<p>I am aware that I might use some standard names, but it seems rather inflexible with regard to future extensibility (all application would require a recompile).</p>

<hr>

<p>I'm afraid, I can't even consider ZwOpenDirectoryObject, because it is described as needing Windows XP or higher, so it is out of question. Thanks for the suggestion though.</p>

<p>I am a little unsure about shared memory, because I haven't tried it so far. Might do some reading in that area I guess. Configuration files and registry are a slight problem, because they do tend to fail with Vista due to access problems. I am a bit afraid, that shared memory will have the same problem.</p>

<p>The idea with ProcessExplorer sounds promising. Does anyone know an API that could be used for listing events for a process? And, does it work without administrative rights?</p>

<hr>

<p>Thank you for the clarification.</p>

<p>There is not really a master process. It is more of a driver dll that is used from different processes and the events would be used to "lock" resources used by these processes.</p>

<p>I am thinking about setting up a central service that has sufficient access rights even under Vista. It will certainly complicate things, but it might be the only thing left facing the problems with security.</p>

[{'answer_id': 35788, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>No, there is not any facility to enumerate named events. You could enumerate all objects in the respective object manager directory using ZwOpenDirectoryObject and then filter for events. But this routine is undocumented and therefore should not be used without good reason.</p>\n\n<p>Why not use a separate mechanism to share the event names? You could list them in a configuration file, a registry key or maybe even in shared memory.</p>\n'}, {'answer_id': 35799, 'author': 'Barak Schiller', 'author_id': 1651, 'author_profile': 'https://Stackoverflow.com/users/1651', 'pm_score': 1, 'selected': False, 'text': '<p><a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="nofollow noreferrer">ProcessExplorer</a> is able to enumerate all the named events held by some specific process. You could go over the entire process list and do something similar although I have now clue as to what API is used to get the list...</p>\n'}, {'answer_id': 35908, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': True, 'text': '<p>Do not mix up the user mode ZwOpenDirectoryObject with the kernel mode ZwOpenDirectoryObject -- the kernel mode API (<a href="http://msdn.microsoft.com/en-us/library/ms800966.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms800966.aspx</a>) indeed seems to available as of XP only, but the user mode version should be available at least since NT 4. Anyway, I would not recommend using ZwOpenDirectoryObject.</p>\n\n<p>Why should configuration files and registry keys fail on Vista? Of course, you have to get the security settings right -- but you would have to do that for your named events as well -- so there should not be a big difference here. Maybe you should tell us some more details about the nature of your processes -- do they all run within the same logon session or do they run as different users even? And is there some master process or who creates the events in the first place?</p>\n\n<p>Frankly, I tend to find the Process Explorer idea to be not a very good one. Despite the fact that you probably will not be able to accomplish that without using undocumented APIs and/or a device driver, I do not think that a process should be spelunking around in the handle table of another process just to find out the names of some kernel objects. And, of course, the same security issues apply again.</p>\n'}]
['https://Stackoverflow.com/questions/35748', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1398/']