<PackageReference Include="System.Threading.AccessControl" Version="10.0.8" />

System.Security.AccessControl.MutexSecurity

public sealed class MutexSecurity : NativeObjectSecurity
Represents the Windows access control security for a named mutex. This class cannot be inherited.
public MutexSecurity()

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

public MutexSecurity(string name, AccessControlSections includeSections)

Initializes a new instance of the MutexSecurity class with the specified sections of the access control security rules from the system mutex with the specified name.

public void AddAccessRule(MutexAccessRule rule)

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

public void AddAuditRule(MutexAuditRule rule)

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

Searches for an access control rule with the same user and AccessControlType (allow or deny) as the specified 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.

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

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

public bool RemoveAuditRule(MutexAuditRule rule)

Searches for an audit control 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.

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

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

public void ResetAccessRule(MutexAccessRule rule)

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

public void SetAccessRule(MutexAccessRule rule)

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

public void SetAuditRule(MutexAuditRule rule)

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