diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2012-03-22 10:09:29 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-03-25 16:29:47 +0200 |
commit | 757f569715ad53760b5853c36d6ac5164c07b442 (patch) | |
tree | c0c1a7abc018e96cce23f24cfdb050cb56617aa4 | |
parent | ced08bf37a9ea807ac5755fff7c120eeec09dc30 (diff) |
Signaler's global event is now accessible by everyone
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
-rw-r--r-- | src/signaler.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/signaler.cpp b/src/signaler.cpp index 2ba6285..d9a308e 100644 --- a/src/signaler.cpp +++ b/src/signaler.cpp @@ -245,11 +245,22 @@ int xs::signaler_t::make_fdpair (fd_t *r_, fd_t *w_) // implement IOCP polling mechanism that allows to poll on both sockets // and in-process synchronisation objects. + // Make the following critical section accessible to everyone. + SECURITY_ATTRIBUTES sa = {0}; + sa.nLength = sizeof (sa); + sa.bInheritHandle = FALSE; + SECURITY_DESCRIPTOR sd; + BOOL ok = InitializeSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION); + win_assert (ok); + ok = SetSecurityDescriptorDacl(&sd, TRUE, (PACL) NULL, FALSE); + win_assert (ok); + sa.lpSecurityDescriptor = &sd; + // This function has to be in a system-wide critical section so that // two instances of the library don't accidentally create signaler // crossing the process boundary. // We'll use named event object to implement the critical section. - HANDLE sync = CreateEvent (NULL, FALSE, TRUE, "xs-signaler-port-sync"); + HANDLE sync = CreateEvent (&sa, FALSE, TRUE, "xs-signaler-port-sync"); win_assert (sync != NULL); // Enter the critical section. |