 ! : ImpersonateLoggedOnUser ;
 ! : ImpersonateNamedPipeClient ;
 ! : ImpersonateSelf ;
-! : InitializeAcl ;
+FUNCTION: BOOL InitializeAcl ( PACL pAcl, DWORD nAclLength, DWORD dwAclRevision ) ;
 ! : InitializeSecurityDescriptor ;
 ! : InitializeSid ;
 ! : InitiateSystemShutdownA ;

! : AddAccessDeniedAce ;
! : AddAccessDeniedAceEx ;
! : AddAccessDeniedObjectAce ;
! : AddAce ;
! : AddAuditAccessAce ;
! : AddAuditAccessAceEx ;
! : AddAuditAccessObjectAce ;

: CRYPT_DELETEKEYSET   HEX: 10 ; inline
: CRYPT_MACHINE_KEYSET HEX: 20 ; inline
: CRYPT_SILENT         HEX: 40 ; inline

C-STRUCT: ACL
    { "BYTE" "AclRevision" }
    { "BYTE" "Sbz1" }
    { "WORD" "AclSize" }
    { "WORD" "AceCount" }
    { "WORD" "Sbz2" } ;

TYPEDEF: ACL* PACL

: ACCESS_ALLOWED_ACE_TYPE 0 ; inline
: ACCESS_DENIED_ACE_TYPE 1 ; inline
: SYSTEM_AUDIT_ACE_TYPE 2 ; inline
: SYSTEM_ALARM_ACE_TYPE 3 ; inline

: OBJECT_INHERIT_ACE HEX: 1 ; inline
: CONTAINER_INHERIT_ACE HEX: 2 ; inline
: NO_PROPAGATE_INHERIT_ACE HEX: 4 ; inline
: INHERIT_ONLY_ACE HEX: 8 ; inline
: VALID_INHERIT_FLAGS HEX: f ; inline

C-STRUCT: ACE_HEADER
    { "BYTE" "AceType" }
    { "BYTE" "AceFlags" }
    { "WORD" "AceSize" } ;

TYPEDEF: ACE_HEADER* PACE_HEADER

C-STRUCT: ACCESS_ALLOWED_ACE
    { "ACE_HEADER" "Header" }
    { "DWORD" "Mask" }
    { "DWORD" "SidStart" } ;

TYPEDEF: ACCESS_ALLOWED_ACE* PACCESS_ALLOWED_ACE

C-STRUCT: ACCESS_DENIED_ACE
    { "ACE_HEADER" "Header" }
    { "DWORD" "Mask" }
    { "DWORD" "SidStart" } ;
TYPEDEF: ACCESS_DENIED_ACE* PACCESS_DENIED_ACE


C-STRUCT: SYSTEM_AUDIT_ACE
    { "ACE_HEADER" "Header" }
    { "DWORD" "Mask" }
    { "DWORD" "SidStart" } ;

TYPEDEF: SYSTEM_AUDIT_ACE* PSYSTEM_AUDIT_ACE

C-STRUCT: SYSTEM_ALARM_ACE
    { "ACE_HEADER" "Header" }
    { "DWORD" "Mask" }
    { "DWORD" "SidStart" } ;

TYPEDEF: SYSTEM_ALARM_ACE* PSYSTEM_ALARM_ACE

C-STRUCT: ACCESS_ALLOWED_CALLBACK_ACE
    { "ACE_HEADER" "Header" }
    { "DWORD" "Mask" }
    { "DWORD" "SidStart" } ;

TYPEDEF: ACCESS_ALLOWED_CALLBACK_ACE* PACCESS_ALLOWED_CALLBACK_ACE


! typedef enum _TOKEN_INFORMATION_CLASS {
: TokenUser 1 ; inline
: TokenGroups 2 ; inline
: TokenPrivileges 3 ; inline
: TokenOwner 4 ; inline
: TokenPrimaryGroup 5 ; inline
: TokenDefaultDacl 6 ; inline
: TokenSource 7 ; inline
: TokenType 8 ; inline
: TokenImpersonationLevel 9 ; inline
: TokenStatistics 10 ; inline
: TokenRestrictedSids 11 ; inline
: TokenSessionId 12 ; inline
: TokenGroupsAndPrivileges 13 ; inline
: TokenSessionReference 14 ; inline
: TokenSandBoxInert 15 ; inline
! } TOKEN_INFORMATION_CLASS;

: DELETE                     HEX: 00010000 ; inline
: READ_CONTROL               HEX: 00020000 ; inline
: WRITE_DAC                  HEX: 00040000 ; inline
: WRITE_OWNER                HEX: 00080000 ; inline
: SYNCHRONIZE                HEX: 00100000 ; inline
: STANDARD_RIGHTS_REQUIRED   HEX: 000f0000 ; inline

: STANDARD_RIGHTS_READ       READ_CONTROL ; inline
: STANDARD_RIGHTS_WRITE      READ_CONTROL ; inline
: STANDARD_RIGHTS_EXECUTE    READ_CONTROL ; inline

: TOKEN_TOKEN_ADJUST_DEFAULT   HEX: 0080 ; inline
: TOKEN_ADJUST_GROUPS          HEX: 0040 ; inline
: TOKEN_ADJUST_PRIVILEGES      HEX: 0020 ; inline
: TOKEN_ADJUST_SESSIONID       HEX: 0100 ; inline
: TOKEN_ASSIGN_PRIMARY         HEX: 0001 ; inline
: TOKEN_DUPLICATE              HEX: 0002 ; inline
: TOKEN_EXECUTE                STANDARD_RIGHTS_EXECUTE ; inline
: TOKEN_IMPERSONATE            HEX: 0004 ; inline
: TOKEN_QUERY                  HEX: 0008 ; inline
: TOKEN_QUERY_SOURCE           HEX: 0010 ; inline
: TOKEN_ADJUST_DEFAULT         HEX: 0080 ; inline
: TOKEN_READ STANDARD_RIGHTS_READ TOKEN_QUERY bitor ;

: TOKEN_WRITE
    {
        STANDARD_RIGHTS_WRITE
        TOKEN_ADJUST_PRIVILEGES
        TOKEN_ADJUST_GROUPS
        TOKEN_ADJUST_DEFAULT
    } flags ; foldable

: TOKEN_ALL_ACCESS
    {
        STANDARD_RIGHTS_REQUIRED
        TOKEN_ASSIGN_PRIMARY
        TOKEN_DUPLICATE
        TOKEN_IMPERSONATE
        TOKEN_QUERY
        TOKEN_QUERY_SOURCE
        TOKEN_ADJUST_PRIVILEGES
        TOKEN_ADJUST_GROUPS
        TOKEN_ADJUST_SESSIONID
        TOKEN_ADJUST_DEFAULT
    } flags ; foldable


! : I_ScGetCurrentGroupStateW ;
