AddAce

  BOOL AddAce(Acl, AceRevision, StartingAceIndex, AceList, AceListLength)    
  PACL Acl;    
  DWORD AceRevision;    
  DWORD StartingAceIndex;    
  LPVOID AceList;    
  DWORD AceListLength;    

The AddAce function adds one or more ACEs to an existing ACL. An ACE is an access control entry. An ACL is an access control list.

The caller specifies an ACL to modify, a list of ACEs to add, and a position within the ACL at which to add the ACEs.

Parameters

Acl

Pointer to an existing ACL data structure. The ACEs will be added to this ACL.

The ACL data structure has the following form:

typedef struct _ACL { /* acl */

BYTE AclRevision;

BYTE Sbz1;

WORD AclSize;

WORD AceCount;

WORD Sbz2;

} ACL;

AceRevision

Specifies the revision level of the ACEs being added to the ACL. This ACE revision level must match the ACL's revision level.

StartingAceIndex

A zero-based index value that specifies a position within the ACL's list of ACEs at which to add the new ACEs. A value of 0 inserts the ACEs at the beginning of the ACL's list of ACEs. A value of MAXDWORD appends the ACEs to the end of the ACL's list of ACEs.

AceList

Pointer to a list of one or more ACEs stored contiguously.

AceListLength

The size in bytes of the input buffer pointed to by AceList.

Return Value

If the function is successful, the return value is TRUE.

If the function fails, the return value is FALSE. Call GetLastError for more detailed error information.

See Also

AddAccessAllowedAce, DeleteAce, GetAce, GetAclInformation, InitializeAcl, IsValidAcl, SetAclInformation