AddAce function (securitybaseapi.h)
BOOL AddAce( [in, out] PACL pAcl, [in] DWORD dwAceRevision, [in] DWORD dwStartingAceIndex, [in] LPVOID pAceList, [in] DWORD nAceListLength );
[in, out] pAcl
A pointer to an ACL. This function adds an ACE to this ACL.
Specifies the revision level of the ACL being modified.
This value can be ACL_REVISION or ACL_REVISION_DS. Use ACL_REVISION_DS if the ACL contains object-specific ACEs. This value must be compatible with the AceType field of all ACEs in pAceList. Otherwise, the function will fail and set the last error to ERROR_INVALID_PARAMETER.
Specifies the position in the ACL's list of ACEs at which to add new ACEs. A value of zero inserts the ACEs at the beginning of the list. A value of MAXDWORD appends the ACEs to the end of the list.
A pointer to a list of one or more ACEs to be added to the specified ACL. The ACEs in the list must be stored contiguously.
Specifies the size, in bytes, of the input buffer pointed to by the pAceList parameter.
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 following are possible error values.
||The new ACE does not fit into the ACL. A larger ACL buffer is required.|
||The specified ACL is not properly formed.|
||The ACE was successfully added.|
Applications frequently use the FindFirstFreeAce and GetAce functions when using the AddAce function to manipulate an ACL. In addition, the ACL_SIZE_INFORMATION structure retrieved by the GetAclInformation function contains the size of the ACL and the number of ACEs it contains.
For an example that uses this function, see Starting an Interactive Client Process.
|Minimum supported client||Windows XP [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2003 [desktop apps | UWP apps]|
|Header||securitybaseapi.h (include Windows.h)|