The InitializeAcl function creates a new ACL structure.
An ACL is an access-control list.
BOOL InitializeAcl(
PACL pAcl, |
// address of access-control list |
DWORD nAclLength, |
// size of access-control list |
DWORD dwAclRevision |
// revision level of access-control list |
); |
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The ACL initialized by this function contains no ACEs. It is empty, as opposed to being a nonexistent ACL. If an empty ACL is applied to an object, it implicitly denies all access to that object.
To calculate the size of an ACL, add sizeof(ACL) to the size of all the ACEs to be stored in the ACL. To calculate the size of an ACE, add the size of the ACE structure, such as sizeof(ACCESS_ALLOWED_ACE), to the length of the SID associated with the ACE, and then subtract the size of the SidStart member (which is part of both the ACE structure and the SID). Use the GetSidLength function to get the length of a specified SID.
sizeof (ACCESS_ALLOWED_ACE) - sizeof (ACCESS_ALLOWED_ACE.SidStart) + GetLengthSid (pAceSid);
cbAcl = sizeof (ACL); for (i = 0 ; i < nAceCount ; i++) { // subtract ACE.SidStart from the size cbAce = sizeof (ACE) - sizeof (DWORD); // add this ACE's SID length cbAce += GetLengthSid (pAceSid[i]); // add the length of each ACE to the total ACL length cbAcl += cbAce; }
ACCESS_ALLOWED_ACE, ACCESS_DENIED_ACE, ACL, AddAccessAllowedAce, AddAccessDeniedAce, AddAce, AddAuditAccessAce, DeleteAce, GetAce, GetAclInformation, IsValidAcl, SetAclInformation, SID
file: /Techref/os/win/api/win32/func/src/f49_5.htm, 4KB, , updated: 2000/4/7 11:19, local time: 2024/11/28 04:19,
3.131.13.196:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/techref/os/win/api/win32/func/src/f49_5.htm"> InitializeAcl</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.