internal static void GetNullDaclSecurityDescriptor(out SECURITY_DESC sd) { if (InitializeSecurityDescriptor(out sd, 1)) { if (!SetSecurityDescriptorDacl(ref sd, true, IntPtr.Zero, false)) { throw new Win32Exception(Marshal.GetLastWin32Error()); } } else { throw new Win32Exception(Marshal.GetLastWin32Error()); } }
private static extern bool InitializeSecurityDescriptor(out SECURITY_DESC sd, int dwRevision);
private static extern bool SetSecurityDescriptorDacl(ref SECURITY_DESC sd, bool bDaclPresent, IntPtr Dacl, bool bDaclDefaulted);