Пример #1
0
 /// <summary>
 /// Creates a SECURITY_DESCRIPTOR with DACL = null, which allows full access to Everyone.
 /// </summary>
 /// <param name="sd">The SECURITY_DESCRIPTOR structure.</param>
 #endregion
 public static void GetNullDaclSecurityDescriptor(out SECURITY_DESCRIPTOR sd)
 {
     if (NamedPipeNative.InitializeSecurityDescriptor(out sd, 1))
     {
         if (!NamedPipeNative.SetSecurityDescriptorDacl(ref sd, true, IntPtr.Zero, false))
         {
             throw new NamedPipeIOException("Error setting SECURITY_DESCRIPTOR attributes. Internal error: " + NamedPipeNative.GetLastError().ToString(), NamedPipeNative.GetLastError());
         }
     }
     else
     {
         throw new NamedPipeIOException("Error setting SECURITY_DESCRIPTOR attributes. Internal error: " + NamedPipeNative.GetLastError().ToString(), NamedPipeNative.GetLastError());
     }
 }
Пример #2
0
 public static void GetNullDaclSecurityDescriptor(out SECURITY_DESCRIPTOR sd)
 {
     if (NamedPipeNative.InitializeSecurityDescriptor(out sd, 1))
     {
         if (!NamedPipeNative.SetSecurityDescriptorDacl(ref sd, true, IntPtr.Zero, false))
         {
             throw new NamedPipeIOException("Error setting SECURITY_DESCRIPTOR attributes. Internal error: " +
                 NamedPipeNative.GetLastError().ToString(), NamedPipeNative.GetLastError());
         }
     }
     else
     {
         throw new NamedPipeIOException("Error setting SECURITY_DESCRIPTOR attributes. Internal error: " +
             NamedPipeNative.GetLastError().ToString(), NamedPipeNative.GetLastError());
     }
 }
Пример #3
0
		public static extern bool InitializeSecurityDescriptor(out SECURITY_DESCRIPTOR sd, int dwRevision);
Пример #4
0
		public static extern bool SetSecurityDescriptorDacl(ref SECURITY_DESCRIPTOR sd, bool bDaclPresent, IntPtr Dacl, bool bDaclDefaulted);
Пример #5
0
 public static extern bool InitializeSecurityDescriptor(out SECURITY_DESCRIPTOR sd, int dwRevision);
Пример #6
0
 public static extern bool SetSecurityDescriptorDacl(ref SECURITY_DESCRIPTOR sd, bool bDaclPresent, IntPtr Dacl, bool bDaclDefaulted);