System.Security.AccessControl.EventWaitHandleSecurity Class

Represents the Windows access control security applied to a named system wait handle. This class cannot be inherited.

See Also: EventWaitHandleSecurity Members


public sealed class EventWaitHandleSecurity : NativeObjectSecurity


An System.Security.AccessControl.EventWaitHandleSecurity object specifies access rights for a named system wait handle, and also specifies the way access attempts are audited. Access rights to the wait handle are expressed as rules, with each access rule represented by an System.Security.AccessControl.EventWaitHandleAccessRule object. Each auditing rule is represented by an System.Security.AccessControl.EventWaitHandleAuditRule object.

This mirrors the underlying Windows security system, in which each securable object has at most one discretionary access control list (DACL) that controls access to the secured object, and at most one system access control list (SACL) that specifies which access attempts are audited. The DACL and SACL are ordered lists of access control entries (ACE) that specify access and auditing for users and groups. An System.Security.AccessControl.EventWaitHandleAccessRule or System.Security.AccessControl.EventWaitHandleAuditRule object might represent more than one ACE.


An System.Threading.EventWaitHandle object can represent a local wait handle or a named system wait handle. Windows access control security is meaningful only for named system wait handles.

The System.Security.AccessControl.EventWaitHandleSecurity, System.Security.AccessControl.EventWaitHandleAccessRule, and System.Security.AccessControl.EventWaitHandleAuditRule classes hide the implementation details of ACLs and ACEs. They allow you to ignore the seventeen different ACE types and the complexity of correctly maintaining inheritance and propagation of access rights. These objects are also designed to prevent the following common access control errors:

The only capabilities not supported by the .NET security objects are dangerous activities that should be avoided by the majority of application developers, such as the following:

To modify Windows access control security for a named wait handle, use the System.Threading.EventWaitHandle.GetAccessControl method to get the System.Security.AccessControl.EventWaitHandleSecurity object. Modify the security object by adding and removing rules, and then use the System.Threading.EventWaitHandle.SetAccessControl(EventWaitHandleSecurity) method to reattach it.


Changes you make to an System.Security.AccessControl.EventWaitHandleSecurity object do not affect the access levels of the named wait handle until you call the System.Threading.EventWaitHandle.SetAccessControl(EventWaitHandleSecurity) method to assign the altered security object to the named wait handle.

To copy access control security from one wait handle to another, use the System.Threading.EventWaitHandle.GetAccessControl method to get an System.Security.AccessControl.EventWaitHandleSecurity object representing the access and audit rules for the first wait handle, and then use the System.Threading.EventWaitHandle.SetAccessControl(EventWaitHandleSecurity) method, or a constructor that accepts an System.Security.AccessControl.EventWaitHandleSecurity object, to assign those rules to the second wait handle.

Users with an investment in the security descriptor definition language (SDDL) can use the ObjectSecurity.SetSecurityDescriptorSddlForm(string) method to set access rules for a named wait handle, and the ObjectSecurity.GetSecurityDescriptorSddlForm(AccessControlSections) method to obtain a string that represents the access rules in SDDL format. This is not recommended for new development.


Namespace: System.Security.AccessControl
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions:,
Since: .NET 2.0