EventWaitHandle.SetAccessControl Method (EventWaitHandleSecurity)
Sets the access control security for a named system event.
Assembly: mscorlib (in mscorlib.dll)
eventSecurity is null.
The current EventWaitHandle object does not represent a named system event.
The following code example demonstrates the cross-process behavior of a named system event with access control security. The example uses the OpenExisting(String) method overload to test for the existence of a named event.
If the event does not exist, it is created with initial ownership and access control security that denies the current user the right to use the event, but grants the right to read and change permissions on the event.
If you run the compiled example from two command windows, the second copy will throw an access violation exception on the call to OpenExisting(String). The exception is caught, and the example uses the OpenExisting(String, EventWaitHandleRights) method overload to wait on the event with the rights needed to read and change the permissions.
After the permissions are changed, using themethod, the event is opened with the rights required to wait on it and signal it. If you run the compiled example from a third command window, the example runs using the new permissions.
Available since 2.0