Event created in the LocalSystem account

G

Guest

I have EventWaitHandle created in the service running in the LocalSystem
account. In the client application running under user account, I try to
create event with the same name - actually to attach to existing event. I
have error "Access to the path <event name> denied".
How can I create event in the client project initializing properly
EventWaitHandleSecurity parameter, to get access to this event?
 
G

Guest

Using API, i can do this by the following way:

SECURITY_DESCRIPTOR sd = {0};
InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorDacl(&sd, TRUE, NULL, FALSE);

SECURITY_ATTRIBUTES sa = {0};
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.bInheritHandle = FALSE;
sa.lpSecurityDescriptor = &sd;

HANDLE h = CreateEvent(&sa, TRUE, FALSE, name1);

Event created by this code is available both from system and user accounts.
How to do the same with managed event?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top