Example #1
0
        public static void SetAccessControl(this Mutex mutex, MutexSecurity mutexSecurity)
        {
            if (mutexSecurity == null)
            {
                throw new ArgumentNullException(nameof(mutexSecurity));
            }

            mutexSecurity.Persist(mutex.GetSafeWaitHandle());
        }
Example #2
0
        [System.Security.SecuritySafeCritical]  // auto-generated
        public static void SetAccessControl(this Mutex mutex, MutexSecurity mutexSecurity)
        {
            if (mutexSecurity == null)
            {
                throw new ArgumentNullException("mutexSecurity");
            }
            Contract.EndContractBlock();

            mutexSecurity.Persist(mutex.GetSafeWaitHandle());
        }
Example #3
0
 public static MutexSecurity GetAccessControl(this Mutex mutex)
 {
     return(new MutexSecurity(mutex.GetSafeWaitHandle(), AccessControlSections.Access | AccessControlSections.Owner | AccessControlSections.Group));
 }
Example #4
0
        public static void SetAccessControl(this Mutex mutex, MutexSecurity mutexSecurity)
        {
            ArgumentNullException.ThrowIfNull(mutexSecurity);

            mutexSecurity.Persist(mutex.GetSafeWaitHandle());
        }