EventWaitHandleSecurity Class

 

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

Namespace:   System.Security.AccessControl
Assembly:  mscorlib (in mscorlib.dll)


[<Sealed>]
type EventWaitHandleSecurity = 
    class
        inherit NativeObjectSecurity
    end

NameDescription
System_CAPS_pubmethodEventWaitHandleSecurity()

Initializes a new instance of the EventWaitHandleSecurity class with default values.

NameDescription
System_CAPS_pubpropertyAccessRightType

Gets the enumeration type that the EventWaitHandleSecurity class uses to represent access rights.(Overrides ObjectSecurity.AccessRightType.)

System_CAPS_pubpropertyAccessRuleType

Gets the type that the EventWaitHandleSecurity class uses to represent access rules.(Overrides ObjectSecurity.AccessRuleType.)

System_CAPS_pubpropertyAreAccessRulesCanonical

Gets a Boolean value that specifies whether the access rules associated with this ObjectSecurity object are in canonical order.(Inherited from ObjectSecurity.)

System_CAPS_pubpropertyAreAccessRulesProtected

Gets a Boolean value that specifies whether the Discretionary Access Control List (DACL) associated with this ObjectSecurity object is protected.(Inherited from ObjectSecurity.)

System_CAPS_pubpropertyAreAuditRulesCanonical

Gets a Boolean value that specifies whether the audit rules associated with this ObjectSecurity object are in canonical order.(Inherited from ObjectSecurity.)

System_CAPS_pubpropertyAreAuditRulesProtected

Gets a Boolean value that specifies whether the System Access Control List (SACL) associated with this ObjectSecurity object is protected.(Inherited from ObjectSecurity.)

System_CAPS_pubpropertyAuditRuleType

Gets the type that the EventWaitHandleSecurity class uses to represent audit rules.(Overrides ObjectSecurity.AuditRuleType.)

NameDescription
System_CAPS_pubmethodAccessRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AccessControlType)

Creates a new access control rule for the specified user, with the specified access rights, access control, and flags.(Overrides ObjectSecurity.AccessRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AccessControlType).)

System_CAPS_pubmethodAddAccessRule(EventWaitHandleAccessRule)

Searches for a matching access control rule with which the new rule can be merged. If none are found, adds the new rule.

System_CAPS_pubmethodAddAuditRule(EventWaitHandleAuditRule)

Searches for an audit rule with which the new rule can be merged. If none are found, adds the new rule.

System_CAPS_pubmethodAuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags)

Creates a new audit rule, specifying the user the rule applies to, the access rights to audit, and the outcome that triggers the audit rule.(Overrides ObjectSecurity.AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags).)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetAccessRules(Boolean, Boolean, Type)

Gets a collection of the access rules associated with the specified security identifier.(Inherited from CommonObjectSecurity.)

System_CAPS_pubmethodGetAuditRules(Boolean, Boolean, Type)

Gets a collection of the audit rules associated with the specified security identifier.(Inherited from CommonObjectSecurity.)

System_CAPS_pubmethodGetGroup(Type)

Gets the primary group associated with the specified owner.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetOwner(Type)

Gets the owner associated with the specified primary group.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodGetSecurityDescriptorBinaryForm()

Returns an array of byte values that represents the security descriptor information for this ObjectSecurity object.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodGetSecurityDescriptorSddlForm(AccessControlSections)

Returns the Security Descriptor Definition Language (SDDL) representation of the specified sections of the security descriptor associated with this ObjectSecurity object.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodModifyAccessRule(AccessControlModification, AccessRule, Boolean)

Applies the specified modification to the Discretionary Access Control List (DACL) associated with this ObjectSecurity object.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodModifyAuditRule(AccessControlModification, AuditRule, Boolean)

Applies the specified modification to the System Access Control List (SACL) associated with this ObjectSecurity object.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodPurgeAccessRules(IdentityReference)

Removes all access rules associated with the specified IdentityReference.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodPurgeAuditRules(IdentityReference)

Removes all audit rules associated with the specified IdentityReference.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodRemoveAccessRule(EventWaitHandleAccessRule)

Searches for an access control rule with the same user and AccessControlType (allow or deny) as the specified access rule, and with compatible inheritance and propagation flags; if such a rule is found, the rights contained in the specified access rule are removed from it.

System_CAPS_pubmethodRemoveAccessRuleAll(EventWaitHandleAccessRule)

Searches for all access control rules with the same user and AccessControlType (allow or deny) as the specified rule and, if found, removes them.

System_CAPS_pubmethodRemoveAccessRuleSpecific(EventWaitHandleAccessRule)

Searches for an access control rule that exactly matches the specified rule and, if found, removes it.

System_CAPS_pubmethodRemoveAuditRule(EventWaitHandleAuditRule)

Searches for an audit rule with the same user as the specified rule, and with compatible inheritance and propagation flags; if a compatible rule is found, the rights contained in the specified rule are removed from it.

System_CAPS_pubmethodRemoveAuditRuleAll(EventWaitHandleAuditRule)

Searches for all audit rules with the same user as the specified rule and, if found, removes them.

System_CAPS_pubmethodRemoveAuditRuleSpecific(EventWaitHandleAuditRule)

Searches for an audit rule that exactly matches the specified rule and, if found, removes it.

System_CAPS_pubmethodResetAccessRule(EventWaitHandleAccessRule)

Removes all access control rules with the same user as the specified rule, regardless of AccessControlType, and then adds the specified rule.

System_CAPS_pubmethodSetAccessRule(EventWaitHandleAccessRule)

Removes all access control rules with the same user and AccessControlType (allow or deny) as the specified rule, and then adds the specified rule.

System_CAPS_pubmethodSetAccessRuleProtection(Boolean, Boolean)

Sets or removes protection of the access rules associated with this ObjectSecurity object. Protected access rules cannot be modified by parent objects through inheritance.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodSetAuditRule(EventWaitHandleAuditRule)

Removes all audit rules with the same user as the specified rule, regardless of the AuditFlags value, and then adds the specified rule.

System_CAPS_pubmethodSetAuditRuleProtection(Boolean, Boolean)

Sets or removes protection of the audit rules associated with this ObjectSecurity object. Protected audit rules cannot be modified by parent objects through inheritance.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodSetGroup(IdentityReference)

Sets the primary group for the security descriptor associated with this ObjectSecurity object.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodSetOwner(IdentityReference)

Sets the owner for the security descriptor associated with this ObjectSecurity object.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodSetSecurityDescriptorBinaryForm(Byte[])

Sets the security descriptor for this ObjectSecurity object from the specified array of byte values.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodSetSecurityDescriptorBinaryForm(Byte[], AccessControlSections)

Sets the specified sections of the security descriptor for this ObjectSecurity object from the specified array of byte values.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodSetSecurityDescriptorSddlForm(String)

Sets the security descriptor for this ObjectSecurity object from the specified Security Descriptor Definition Language (SDDL) string.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodSetSecurityDescriptorSddlForm(String, AccessControlSections)

Sets the specified sections of the security descriptor for this ObjectSecurity object from the specified Security Descriptor Definition Language (SDDL) string.(Inherited from ObjectSecurity.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

An 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 EventWaitHandleAccessRule object. Each auditing rule is represented by an 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 EventWaitHandleAccessRule or EventWaitHandleAuditRule object might represent more than one ACE.

System_CAPS_noteNote

An 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 EventWaitHandleSecurity, EventWaitHandleAccessRule, and 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:

  • Creating a security descriptor with a null DACL. A null reference to a DACL allows any user to add access rules to an object, potentially creating a denial-of-service attack. A new EventWaitHandleSecurity object always starts with an empty DACL, which denies all access for all users.

  • Violating the canonical ordering of ACEs. If the ACE list in the DACL is not kept in the canonical order, users might inadvertently be given access to the secured object. For example, denied access rights must always appear before allowed access rights. EventWaitHandleSecurity objects maintain the correct order internally.

  • Manipulating security descriptor flags, which should be under resource manager control only.

  • Creating invalid combinations of ACE flags.

  • Manipulating inherited ACEs. Inheritance and propagation are handled by the resource manager, in response to changes you make to access and audit rules.

  • Inserting meaningless ACEs into ACLs.

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:

  • Low-level tasks that are normally performed by the resource manager.

  • Adding or removing access control entries in ways that do not maintain the canonical ordering.

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

System_CAPS_importantImportant

Changes you make to an EventWaitHandleSecurity object do not affect the access levels of the named wait handle until you call the EventWaitHandle.SetAccessControl 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 EventWaitHandle.GetAccessControl method to get an EventWaitHandleSecurity object representing the access and audit rules for the first wait handle, and then use the EventWaitHandle.SetAccessControl method, or a constructor that accepts an 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 SetSecurityDescriptorSddlForm method to set access rules for a named wait handle, and the GetSecurityDescriptorSddlForm method to obtain a string that represents the access rules in SDDL format. This is not recommended for new development.

The following code example demonstrates the separation between Allow rules and Deny rules, and shows the combination of rights in compatible rules. The example creates an EventWaitHandleSecurity object, adds rules that allow and deny various rights for the current user, and displays the resulting pair of rules. The example then allows new rights for the current user and displays the result, showing that the new rights are merged with the existing Allow rule.

System_CAPS_noteNote

This example does not attach the security object to a EventWaitHandle object. Examples that attach security objects can be found inEventWaitHandle.GetAccessControl and EventWaitHandle.SetAccessControl.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: