Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MutexSecurity::RemoveAccessRuleSpecific Method (MutexAccessRule^)

 

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

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

public:
void RemoveAccessRuleSpecific(
	MutexAccessRule^ rule
)

Exception Condition
ArgumentNullException

rule is null.

The rule is removed only if it exactly matches rule in all details, including flags. Other rules with the same user and AccessControlType are not affected.

System_CAPS_importantImportant

A rule represents one or more underlying access control entries (ACE), and these entries are split or combined as necessary when you modify the access security rules for a user. Thus, a rule might no longer exist in the specific form it had when it was added, and in that case the RemoveAccessRuleSpecific method cannot remove it.

The following code example shows that the RemoveAccessRuleSpecific method requires an exact match in order to remove a rule, and that rules to allow and deny rights are independent of each other.

The example creates a MutexSecurity object, adds rules that allow and deny various rights for the current user, and then merges additional rights into the Allow access rule. The example then passes the original Allow rule to the RemoveAccessRuleSpecific method, and displays the results, showing that nothing is deleted. The example then constructs a rule that matches the Allow rule in the MutexSecurity object, and successfully uses the RemoveAccessRuleSpecific method to remove the rule.

System_CAPS_noteNote

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

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

.NET Framework
Available since 2.0
Return to top
Show:
© 2017 Microsoft