SetSecurityDescriptorDacl (advapi32)
Last changed: -81.95.21.122

.
Summary
Sets information in a discretionary access control list (DACL)

C# Signature:

[DllImport("advapi32.dll", SetLastError=true)]
static extern bool SetSecurityDescriptorDacl(ref SECURITY_DESCRIPTOR sd, bool daclPresent, IntPtr dacl, bool daclDefaulted);

VB Signature:

Declare Function SetSecurityDescriptorDacl Lib "advapi32.dll" (TODO) As TODO

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

// Initialize the security descriptor structure

SECURITY_DESCRIPTOR securityDesc = new SECURITY_DESCRIPTOR();

InitializeSecurityDescriptor(out securityDesc, 1);

SetSecurityDescriptorDacl(ref securityDesc, true, IntPtr.Zero, false);

Documentation