CreateEvent(NULL, FALSE , FALSE, NULL);//auto reset event
In my opinion unnamed events are not shared between processes. I.e. if you set an unnamed event in one application, then other processes will not see this change. Only threads that belong to the first process will detect the event.
Therefore, in case of multiple processes, you have to use named events.
In order to avoid your error, you can try a non-null first parameter of CreateEvent function:
SECURITY_DESCRIPTOR sd = { 0 };::InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION);::SetSecurityDescriptorDacl(&sd, TRUE, 0, FALSE);SECURITY_ATTRIBUTES sa = { 0 };sa.nLength = sizeof(SECURITY_ATTRIBUTES);sa.lpSecurityDescriptor = &sd;
hEvent = ::CreateEvent(&sa, ..., _T("My event name")); // executed in each process
I hope this works.
No comments:
Post a Comment