*======================================================================================== * Returns *======================================================================================== Procedure GetFileDACL(tcFile) *-------------------------------------------------------------------------------------- * Declare API functions *-------------------------------------------------------------------------------------- Declare Long GetFileSecurity in Win32API ; String lpFileName, ; Long RequestedInformation, ; String @pSecurityDescriptor, ; Long nLength, ; Long @lpnLengthNeeded Declare Long ConvertSecurityDescriptorToStringSecurityDescriptor in Win32API ; String SecurityDescriptor, ; Long RequestedStringSDRevision, ; Long SecurityInformation, ; Long @StringSecurityDescriptor, ; Long @StringSecurityDescriptorLen *-------------------------------------------------------------------------------------- * Retrieve the DACL *-------------------------------------------------------------------------------------- Local lcDACL, lnNeeded lcDACL = Space(4096) lnNeeded = 0 DACL_SECURITY_INFORMATION = 0x4 GetFileSecurity( ; m.tcFile, ; DACL_SECURITY_INFORMATION, ; @lcDACL, ; Len(m.lcDACL), ; @lnNeeded ; ) lcDACL = Left( m.lcDACL,m.lnNeeded) *-------------------------------------------------------------------------------------- * convert into SDDL *-------------------------------------------------------------------------------------- Local lnSDDL, lnLength, lcSDDL lnSDDL = 0 lnLength = 0 ConvertSecurityDescriptorToStringSecurityDescriptor( ; m.lcDACL, ; 1, ; DACL_SECURITY_INFORMATION, ; @lnSDDL, ; @lnLength ; ) lcSDDL = Chrtran(Sys(2600,m.lnSDDL,m.lnLength),Chr(0),"") Return m.lcSDDL