' ########################################################################################
' Microsoft Windows
' File: AclApi.inc
' Contents: Structure/constant definitions and typedefines for the Win32 Access Control APIs
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_AclAPI_PBI)
#DEFINE PBX_AclAPI_PBI
%EQUATE `ACLAPI_INC = 1
#INCLUDE ONCE "Core/Windows.inc"
#INCLUDE ONCE "Legacy/UI/AccCtrl.inc"
'//
'// Progress Function:
'// Caller of tree operation implements this Progress function, then
'// passes its function pointer to tree operation.
'// Tree operation invokes Progress function to provide progress and error
'// information to the caller during the potentially long execution
'// of the tree operation. Tree operation provides the name of the object
'// last processed and the error status of the operation on that object.
'// Tree operation also passes the current InvokeSetting value.
'// Caller may change the InvokeSetting value, for example, from "Always"
'// to "Only On Error."
'//
'typedef VOID (*FN_PROGRESS) (
' );
'DECLARE SUB FN_PROGRESS ( ' BYREF pObjectName AS WSTRINGZ
' , BYVAL Status AS DWORD
' , BYREF pInvokeSetting AS PROG_INVOKE_SETTING_ENUM
' , BYVAL Args AS DWORD
' , BYVAL SecuritySet AS LONG
' ) ' void
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetEntriesInAclA LIB "ADVAPI32.dll" ALIAS "SetEntriesInAclA" ( BYVAL cCountOfExplicitEntries AS QUAD, BYVAL pListOfExplicitEntries AS EXPLICIT_ACCESS_A PTR, BYVAL OldAcl AS ACL PTR, NewAcl AS QUAD ) AS QUAD ' ACL PTR PTR
#ELSE
DECLARE FUNCTION SetEntriesInAclA LIB "advapi32.dll" ALIAS "SetEntriesInAclA" ( BYVAL cCountOfExplicitEntries AS QUAD , BYREF pListOfExplicitEntries AS EXPLICIT_ACCESS_A , BYVAL OldAcl AS ACL PTR , BYREF NewAcl AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetEntriesInAclW LIB "ADVAPI32.dll" ALIAS "SetEntriesInAclW" ( BYVAL cCountOfExplicitEntries AS QUAD, BYVAL pListOfExplicitEntries AS EXPLICIT_ACCESS_W PTR, BYVAL OldAcl AS ACL PTR, NewAcl AS QUAD ) AS QUAD ' ACL PTR PTR
#ELSE
DECLARE FUNCTION SetEntriesInAclW LIB "advapi32.dll" ALIAS "SetEntriesInAclW" ( BYVAL cCountOfExplicitEntries AS QUAD , BYREF pListOfExplicitEntries AS EXPLICIT_ACCESS_W , BYVAL OldAcl AS ACL PTR , BYREF NewAcl AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
MACRO SetEntriesInAcl = SetEntriesInAclW
#ELSE
MACRO SetEntriesInAcl = SetEntriesInAclA
#ENDIF
DECLARE FUNCTION GetExplicitEntriesFromAclA LIB "advapi32.dll" ALIAS "GetExplicitEntriesFromAclA" ( BYVAL pacl AS ACL PTR , BYREF pcCountOfExplicitEntries AS QUAD , BYREF pListOfExplicitEntries AS QUAD ) AS QUAD
DECLARE FUNCTION GetExplicitEntriesFromAclW LIB "advapi32.dll" ALIAS "GetExplicitEntriesFromAclW" ( BYVAL Apacl AS ACL PTR
 , BYREF pcCountOfExplicitEntries AS DWORD
 , BYREF pListOfExplicitEntries AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
MACRO GetExplicitEntriesFromAcl = GetExplicitEntriesFromAclW
#ELSE
MACRO GetExplicitEntriesFromAcl = GetExplicitEntriesFromAclA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetEffectiveRightsFromAclA LIB "ADVAPI32.dll" ALIAS "GetEffectiveRightsFromAclA" ( pacl AS ACL, pTrustee AS TRUSTEE_A, pAccessRights AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION GetEffectiveRightsFromAclA LIB "advapi32.dll" ALIAS "GetEffectiveRightsFromAclA" ( BYVAL pacl AS ACL PTR , BYREF pTrustee AS TRUSTEE_A , BYREF pAccessRights AS ACCESS_MASK ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetEffectiveRightsFromAclW LIB "ADVAPI32.dll" ALIAS "GetEffectiveRightsFromAclW" ( pacl AS ACL, pTrustee AS TRUSTEE_W, pAccessRights AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION GetEffectiveRightsFromAclW LIB "advapi32.dll" ALIAS "GetEffectiveRightsFromAclW" ( BYVAL pacl AS ACL PTR , BYREF pTrustee AS TRUSTEE_W , BYREF pAccessRights AS ACCESS_MASK ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
MACRO GetEffectiveRightsFromAcl = GetEffectiveRightsFromAclW
#ELSE
MACRO GetEffectiveRightsFromAcl = GetEffectiveRightsFromAclA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetAuditedPermissionsFromAclA LIB "ADVAPI32.dll" ALIAS "GetAuditedPermissionsFromAclA" ( pacl AS ACL, pTrustee AS TRUSTEE_A, pSuccessfulAuditedRights AS QUAD, pFailedAuditRights AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION GetAuditedPermissionsFromAclA LIB "advapi32.dll" ALIAS "GetAuditedPermissionsFromAclA" ( BYVAL pacl AS ACL PTR , BYREF pTrustee AS TRUSTEE_A , BYREF pSuccessfulAuditedRights AS ACCESS_MASK , BYREF pFailedAuditRights AS ACCESS_MASK ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetAuditedPermissionsFromAclW LIB "ADVAPI32.dll" ALIAS "GetAuditedPermissionsFromAclW" ( pacl AS ACL, pTrustee AS TRUSTEE_W, pSuccessfulAuditedRights AS QUAD, pFailedAuditRights AS QUAD ) AS QUAD
#ELSE
DECLARE FUNCTION GetAuditedPermissionsFromAclW LIB "advapi32.dll" ALIAS "GetAuditedPermissionsFromAclW" ( BYVAL pacl AS ACL PTR , BYREF pTrustee AS TRUSTEE_W , BYREF pSuccessfulAuditedRights AS ACCESS_MASK , BYREF pFailedAuditRights AS ACCESS_MASK ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
MACRO GetAuditedPermissionsFromAcl = GetAuditedPermissionsFromAclW
#ELSE
MACRO GetAuditedPermissionsFromAcl = GetAuditedPermissionsFromAclA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetNamedSecurityInfoA LIB "ADVAPI32.dll" ALIAS "GetNamedSecurityInfoA" ( pObjectName AS ASCIIZ, BYVAL ObjectType AS SE_OBJECT_TYPE_enum, BYVAL SecurityInfo AS SECURITY_INFORMATION, ppsidOwner AS QUAD, ' SID PTR PTR
 ppsidGroup AS DWORD, ' SID PTR PTR
 ppDacl AS DWORD, ' ACL PTR PTR
 ppSacl AS DWORD, ' ACL PTR PTR
 ppSecurityDescriptor AS DWORD ' SECURITY_DESCRIPTOR PTR PTR
 ) AS DWORD
#ELSE
DECLARE FUNCTION GetNamedSecurityInfoA LIB "advapi32.dll" ALIAS "GetNamedSecurityInfoA" ( BYREF pObjectName AS ASCIIZ , BYVAL ObjectType AS SE_OBJECT_TYPE_ENUM , BYVAL SecurityInfo AS SECURITY_INFORMATION , OPTIONAL BYREF ppsidOwner AS QUAD , OPTIONAL BYREF ppsidGroup AS QUAD , OPTIONAL BYREF ppDacl AS QUAD , OPTIONAL BYREF ppSacl AS QUAD , OPTIONAL BYREF ppSecurityDescriptor AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetNamedSecurityInfoW LIB "ADVAPI32.dll" ALIAS "GetNamedSecurityInfoW" ( pObjectName AS WSTRINGZ, BYVAL ObjectType AS SE_OBJECT_TYPE_enum, BYVAL SecurityInfo AS SECURITY_INFORMATION, ppsidOwner AS QUAD, ' SID PTR PTR
 ppsidGroup AS DWORD, ' SID PTR PTR
 ppDacl AS DWORD, ' ACL PTR PTR
 ppSacl AS DWORD, ' ACL PTR PTR
 ppSecurityDescriptor AS DWORD ' SECURITY_DESCRIPTOR PTR PTR
 ) AS DWORD
#ELSE
DECLARE FUNCTION GetNamedSecurityInfoW LIB "advapi32.dll" ALIAS "GetNamedSecurityInfoW" ( BYREF pObjectName AS WSTRINGZ , BYVAL ObjectType AS SE_OBJECT_TYPE_ENUM , BYVAL SecurityInfo AS SECURITY_INFORMATION , OPTIONAL BYREF ppsidOwner AS QUAD , OPTIONAL BYREF ppsidGroup AS QUAD , OPTIONAL BYREF ppDacl AS QUAD , OPTIONAL BYREF ppSacl AS QUAD , OPTIONAL BYREF ppSecurityDescriptor AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
MACRO GetNamedSecurityInfo = GetNamedSecurityInfoW
#ELSE
MACRO GetNamedSecurityInfo = GetNamedSecurityInfoA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetSecurityInfo LIB "ADVAPI32.dll" ALIAS "GetSecurityInfo" ( BYVAL shandle AS QUAD, BYVAL ObjectType AS SE_OBJECT_TYPE_enum, BYVAL SecurityInfo AS SECURITY_INFORMATION, ppsidOwner AS QUAD, ' SID PTR PTR
 ppsidGroup AS DWORD, ' SID PTR PTR
 ppDacl AS DWORD, ' ACL PTR PTR
 ppSacl AS DWORD, ' ACL PTR PTR
 ppSecurityDescriptor AS DWORD ' SECURITY_DESCRIPTOR PTR PTR
 ) AS DWORD
#ELSE
DECLARE FUNCTION GetSecurityInfo LIB "advapi32.dll" ALIAS "GetSecurityInfo" ( BYVAL handle AS QUAD , BYVAL ObjectType AS SE_OBJECT_TYPE_ENUM , BYVAL SecurityInfo AS SECURITY_INFORMATION , OPTIONAL BYREF ppsidOwner AS QUAD , OPTIONAL BYREF ppsidGroup AS QUAD , OPTIONAL BYREF ppDacl AS QUAD , OPTIONAL BYREF ppSacl AS QUAD , OPTIONAL BYREF ppSecurityDescriptor AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetNamedSecurityInfoA LIB "ADVAPI32.dll" ALIAS "SetNamedSecurityInfoA" ( pObjectName AS ASCIIZ, BYVAL ObjectType AS SE_OBJECT_TYPE_enum, BYVAL SecurityInfo AS SECURITY_INFORMATION, ppsidOwner AS QUAD, ' SID PTR PTR
 ppsidGroup AS DWORD, ' SID PTR PTR
 ppDacl AS DWORD, ' ACL PTR PTR
 ppSacl AS DWORD ' ACL PTR PTR
 ) AS DWORD
#ELSE
DECLARE FUNCTION SetNamedSecurityInfoA LIB "advapi32.dll" ALIAS "SetNamedSecurityInfoA" ( BYREF pObjectName AS ASCIIZ , BYVAL ObjectType AS SE_OBJECT_TYPE_ENUM , BYVAL SecurityInfo AS SECURITY_INFORMATION , OPTIONAL BYVAL psidOwner AS SID PTR , OPTIONAL BYVAL psidGroup AS SID PTR , OPTIONAL BYVAL pDacl AS ACL PTR , OPTIONAL BYVAL pSacl AS ACL PTR ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetNamedSecurityInfoW LIB "ADVAPI32.dll" ALIAS "SetNamedSecurityInfoW" ( pObjectName AS WSTRINGZ, BYVAL ObjectType AS SE_OBJECT_TYPE_enum, BYVAL SecurityInfo AS SECURITY_INFORMATION, ppsidOwner AS QUAD, ' SID PTR PTR
 ppsidGroup AS DWORD, ' SID PTR PTR
 ppDacl AS DWORD, ' ACL PTR PTR
 ppSacl AS DWORD ' ACL PTR PTR
 ) AS DWORD
#ELSE
DECLARE FUNCTION SetNamedSecurityInfoW LIB "advapi32.dll" ALIAS "SetNamedSecurityInfoW" ( BYREF pObjectName AS WSTRINGZ , BYVAL ObjectType AS SE_OBJECT_TYPE_ENUM , BYVAL SecurityInfo AS SECURITY_INFORMATION , OPTIONAL BYVAL psidOwner AS SID PTR , OPTIONAL BYVAL psidGroup AS SID PTR , OPTIONAL BYVAL pDacl AS ACL PTR , OPTIONAL BYVAL pSacl AS ACL PTR ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
MACRO SetNamedSecurityInfo = SetNamedSecurityInfoW
#ELSE
MACRO SetNamedSecurityInfo = SetNamedSecurityInfoA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION SetSecurityInfo LIB "ADVAPI32.dll" ALIAS "SetSecurityInfo" ( BYVAL shandle AS QUAD, BYVAL ObjectType AS SE_OBJECT_TYPE_enum, BYVAL SecurityInfo AS SECURITY_INFORMATION, ppsidOwner AS QUAD, ' SID PTR PTR
 ppsidGroup AS DWORD, ' SID PTR PTR
 ppDacl AS DWORD, ' ACL PTR PTR
 ppSacl AS DWORD ' ACL PTR PTR
 ) AS DWORD
#ELSE
DECLARE FUNCTION SetSecurityInfo LIB "advapi32.dll" ALIAS "SetSecurityInfo" ( BYVAL handle AS QUAD , BYVAL ObjectType AS SE_OBJECT_TYPE_ENUM , BYVAL SecurityInfo AS SECURITY_INFORMATION , BYVAL psidOwner AS SID PTR , BYVAL psidGroup AS SID PTR , BYVAL pDacl AS ACL PTR , BYVAL pSacl AS ACL PTR ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetInheritanceSourceA LIB "ADVAPI32.dll" ALIAS "GetInheritanceSourceA" ( pObjectName AS ASCIIZ, BYVAL ObjectType AS SE_OBJECT_TYPE_enum, BYVAL SecurityInfo AS SECURITY_INFORMATION, BYVAL Container AS LONG, pObjectClassGuids AS QUAD, ' GUID PTR PTR
 BYVAL GuidCount AS DWORD, pAcl AS ACL, pfnArray AS DWORD, ' OBJECT_MGR_FUNCTS PTR
 pGenericMapping AS GENERIC_MAPPING, pInheritArray AS DWORD ' INHERITED_FROM PTR (to one or more)
 ) AS DWORD
#ELSE
DECLARE FUNCTION GetInheritanceSourceA LIB "advapi32.dll" ALIAS "GetInheritanceSourceA" ( BYREF pObjectName AS ASCIIZ , BYVAL ObjectType AS SE_OBJECT_TYPE_ENUM , BYVAL SecurityInfo AS SECURITY_INFORMATION , BYVAL Container AS LONG , BYREF pObjectClassGuids AS GUID , BYVAL GuidCount AS QUAD , BYVAL pAcl AS ACL PTR , BYVAL pfnArray AS QUAD , BYREF pGenericMapping AS GENERIC_MAPPING , BYREF pInheritArray AS INHERITED_FROMA ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetInheritanceSourceW LIB "ADVAPI32.dll" ALIAS "GetInheritanceSourceW" ( pObjectName AS WSTRINGZ, BYVAL ObjectType AS SE_OBJECT_TYPE_enum, BYVAL SecurityInfo AS SECURITY_INFORMATION, BYVAL Container AS LONG, pObjectClassGuids AS QUAD, ' GUID PTR PTR
 BYVAL GuidCount AS DWORD, pAcl AS ACL, pfnArray AS DWORD, ' OBJECT_MGR_FUNCTS PTR
 pGenericMapping AS GENERIC_MAPPING, pInheritArray AS DWORD ' INHERITED_FROM PTR (to one or more)
 ) AS DWORD
#ELSE
DECLARE FUNCTION GetInheritanceSourceW LIB "advapi32.dll" ALIAS "GetInheritanceSourceW" ( BYREF pObjectName AS WSTRINGZ , BYVAL ObjectType AS SE_OBJECT_TYPE_ENUM , BYVAL SecurityInfo AS SECURITY_INFORMATION , BYVAL Container AS LONG , BYREF pObjectClassGuids AS GUID , BYVAL GuidCount AS QUAD , BYVAL pAcl AS ACL PTR , BYVAL pfnArray AS QUAD , BYREF pGenericMapping AS GENERIC_MAPPING , BYREF pInheritArray AS INHERITED_FROMW ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
MACRO GetInheritanceSource = GetInheritanceSourceW
#ELSE
MACRO GetInheritanceSource = GetInheritanceSourceA
#ENDIF
' NOTE: The first parameter has been declared as ANY to allow to be used with
' both INHERITED_FROM and INHERITED_FROMW arrays.
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION FreeInheritedFromArray LIB "ADVAPI32.dll" ALIAS "FreeInheritedFromArray" ( BYVAL pInheritArray AS INHERITED_FROM PTR, BYVAL AceCnt AS WORD, OPTIONAL BYVAL pfnArray AS QUAD ) AS QUAD ' OBJECT_MGR_FUNCTS PTR
#ELSE
DECLARE FUNCTION FreeInheritedFromArray LIB "advapi32.dll" ALIAS "FreeInheritedFromArray" ( BYREF pInheritArray AS ANY , BYVAL AceCnt AS WORD , OPTIONAL BYVAL pfnArray AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION TreeResetNamedSecurityInfoA LIB "ADVAPI32.dll" ALIAS "TreeResetNamedSecurityInfoA" ( pObjectName AS ASCIIZ, BYVAL ObjectType AS SE_OBJECT_TYPE_enum, BYVAL SecurityInfo AS SECURITY_INFORMATION, pOwner AS SID, pGroup AS SID, pDacl AS ACL, pSacl AS ACL, BYVAL KeepExplicit AS LONG, BYVAL fnProgress AS QUAD, ' FN_PROGRESS
 BYVAL ProgressInvokeSetting AS LONG, ' PROG_INVOKE_SETTING
 Args AS ANY ) AS DWORD
#ELSE
DECLARE FUNCTION TreeResetNamedSecurityInfoA LIB "advapi32.dll" ALIAS "TreeResetNamedSecurityInfoA" ( BYREF pObjectName AS ASCIIZ , BYVAL ObjectType AS SE_OBJECT_TYPE_ENUM , BYVAL SecurityInfo AS SECURITY_INFORMATION , BYVAL pOwner AS SID PTR , BYVAL pGroup AS SID PTR , BYVAL pDacl AS ACL PTR , BYVAL pSacl AS ACL PTR , BYVAL KeepExplicit AS LONG , BYVAL fnProgress AS QUAD , BYVAL ProgressInvokeSetting AS PROG_INVOKE_SETTING_ENUM , OPTIONAL BYREF Args AS ANY ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION TreeResetNamedSecurityInfoW LIB "ADVAPI32.dll" ALIAS "TreeResetNamedSecurityInfoW" ( pObjectName AS WSTRINGZ, BYVAL ObjectType AS SE_OBJECT_TYPE_enum, BYVAL SecurityInfo AS SECURITY_INFORMATION, pOwner AS SID, pGroup AS SID, pDacl AS ACL, pSacl AS ACL, BYVAL KeepExplicit AS LONG, BYVAL fnProgress AS QUAD, ' FN_PROGRESS
 BYVAL ProgressInvokeSetting AS LONG, ' PROG_INVOKE_SETTING
 Args AS ANY ) AS DWORD
#ELSE
DECLARE FUNCTION TreeResetNamedSecurityInfoW LIB "advapi32.dll" ALIAS "TreeResetNamedSecurityInfoW" ( BYREF pObjectName AS WSTRINGZ , BYVAL ObjectType AS SE_OBJECT_TYPE_ENUM , BYVAL SecurityInfo AS SECURITY_INFORMATION , BYVAL pOwner AS SID PTR , BYVAL pGroup AS SID PTR , BYVAL pDacl AS ACL PTR , BYVAL pSacl AS ACL PTR , BYVAL KeepExplicit AS LONG , BYVAL fnProgress AS QUAD , BYVAL ProgressInvokeSetting AS PROG_INVOKE_SETTING_ENUM , OPTIONAL BYREF Args AS ANY ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
MACRO TreeResetNamedSecurityInfo = TreeResetNamedSecurityInfoW
#ELSE
MACRO TreeResetNamedSecurityInfo = TreeResetNamedSecurityInfoA
#ENDIF
'#if (NTDDI_VERSION >= NTDDI_VISTA)
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION TreeSetNamedSecurityInfoA LIB "ADVAPI32.dll" ALIAS "TreeSetNamedSecurityInfoA" ( pObjectName AS ASCIIZ, BYVAL ObjectType AS SE_OBJECT_TYPE_enum, BYVAL SecurityInfo AS SECURITY_INFORMATION, pOwner AS SID, pGroup AS SID, pDacl AS ACL, pSacl AS ACL, BYVAL dwAction AS QUAD, BYVAL fnProgress AS QUAD, ' FN_PROGRESS
 ProgressInvokeSetting AS LONG, ' PROG_INVOKE_SETTING
 Args AS ANY ) AS DWORD
#ELSE
DECLARE FUNCTION TreeSetNamedSecurityInfoA LIB "advapi32.dll" ALIAS "TreeSetNamedSecurityInfoA" ( BYREF pObjectName AS ASCIIZ , BYVAL ObjectType AS SE_OBJECT_TYPE_ENUM , BYVAL SecurityInfo AS SECURITY_INFORMATION , BYVAL pOwner AS SID PTR , BYVAL pGroup AS SID PTR , BYVAL pDacl AS ACL PTR , BYVAL pSacl AS ACL PTR , BYVAL dwAction AS QUAD , BYVAL fnProgress AS QUAD , BYVAL ProgressInvokeSetting AS PROG_INVOKE_SETTING_ENUM , OPTIONAL BYREF Args AS ANY ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION TreeSetNamedSecurityInfoW LIB "ADVAPI32.dll" ALIAS "TreeSetNamedSecurityInfoW" ( pObjectName AS WSTRINGZ, BYVAL ObjectType AS SE_OBJECT_TYPE_enum, BYVAL SecurityInfo AS SECURITY_INFORMATION, pOwner AS SID, pGroup AS SID, pDacl AS ACL, pSacl AS ACL, BYVAL dwAction AS QUAD, BYVAL fnProgress AS QUAD, ' FN_PROGRESS
 ProgressInvokeSetting AS LONG, ' PROG_INVOKE_SETTING
 Args AS ANY ) AS DWORD
#ELSE
DECLARE FUNCTION TreeSetNamedSecurityInfoW LIB "advapi32.dll" ALIAS "TreeSetNamedSecurityInfoW" ( BYREF pObjectName AS WSTRINGZ , BYVAL ObjectType AS SE_OBJECT_TYPE_ENUM , BYVAL SecurityInfo AS SECURITY_INFORMATION , BYVAL pOwner AS SID PTR , BYVAL pGroup AS SID PTR , BYVAL pDacl AS ACL PTR , BYVAL pSacl AS ACL PTR , BYVAL dwAction AS QUAD , BYVAL fnProgress AS QUAD , BYVAL ProgressInvokeSetting AS PROG_INVOKE_SETTING_ENUM , OPTIONAL BYREF Args AS ANY ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
MACRO TreeSetNamedSecurityInfo = TreeSetNamedSecurityInfoW
#ELSE
MACRO TreeSetNamedSecurityInfo = TreeSetNamedSecurityInfoA
#ENDIF
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
'//----------------------------------------------------------------------------
'// The following API are provided for trusted servers to use to
'// implement access control on their own objects.
'//----------------------------------------------------------------------------
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION BuildSecurityDescriptorA LIB "ADVAPI32.dll" ALIAS "BuildSecurityDescriptorA" ( pOwner AS TRUSTEE_A, pGroup AS TRUSTEE_A, BYVAL cCountOfAccessEntries AS QUAD, BYVAL pListOfAccessEntries AS EXPLICIT_ACCESS_A PTR, BYVAL cCountOfAuditEntries AS QUAD, BYVAL pListOfAuditEntries AS EXPLICIT_ACCESS_A PTR, pOldSD AS SECURITY_DESCRIPTOR, pSizeNewSD AS QUAD, pNewSD AS SECURITY_DESCRIPTOR ) AS QUAD
#ELSE
DECLARE FUNCTION BuildSecurityDescriptorA LIB "advapi32.dll" ALIAS "BuildSecurityDescriptorA" ( BYREF pOwner AS TRUSTEE_A , BYREF pGroup AS TRUSTEE_A , BYVAL cCountOfAccessEntries AS QUAD , BYREF pListOfAccessEntries AS EXPLICIT_ACCESS_A , BYVAL cCountOfAuditEntries AS QUAD , BYREF pListOfAuditEntries AS EXPLICIT_ACCESS_A , BYREF pOldSD AS SECURITY_DESCRIPTOR , BYREF pSizeNewSD AS QUAD , BYREF pNewSD AS SECURITY_DESCRIPTOR ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION BuildSecurityDescriptorW LIB "ADVAPI32.dll" ALIAS "BuildSecurityDescriptorW" ( pOwner AS TRUSTEE_W, pGroup AS TRUSTEE_W, BYVAL cCountOfAccessEntries AS QUAD, BYVAL pListOfAccessEntries AS EXPLICIT_ACCESS PTR, BYVAL cCountOfAuditEntries AS QUAD, BYVAL pListOfAuditEntries AS EXPLICIT_ACCESS PTR, pOldSD AS SECURITY_DESCRIPTOR, pSizeNewSD AS QUAD, pNewSD AS SECURITY_DESCRIPTOR ) AS QUAD
#ELSE
DECLARE FUNCTION BuildSecurityDescriptorW LIB "advapi32.dll" ALIAS "BuildSecurityDescriptorW" ( BYREF pOwner AS TRUSTEE_W , BYREF pGroup AS TRUSTEE_W , BYVAL cCountOfAccessEntries AS QUAD , BYREF pListOfAccessEntries AS EXPLICIT_ACCESS_W , BYVAL cCountOfAuditEntries AS QUAD , BYREF pListOfAuditEntries AS EXPLICIT_ACCESS_W , BYREF pOldSD AS SECURITY_DESCRIPTOR , BYREF pSizeNewSD AS QUAD , BYREF pNewSD AS SECURITY_DESCRIPTOR ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
MACRO BuildSecurityDescriptor = BuildSecurityDescriptorW
#ELSE
MACRO BuildSecurityDescriptor = BuildSecurityDescriptorA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION LookupSecurityDescriptorPartsA LIB "ADVAPI32.dll" ALIAS "LookupSecurityDescriptorPartsA" ( pOwner AS TRUSTEE_A, pGroup AS TRUSTEE_A, BYVAL cCountOfAccessEntries AS QUAD, BYVAL pListOfAccessEntries AS EXPLICIT_ACCESS_A PTR, BYVAL cCountOfAuditEntries AS QUAD, BYVAL pListOfAuditEntries AS EXPLICIT_ACCESS_A PTR, pSD AS SECURITY_DESCRIPTOR ) AS QUAD
#ELSE
DECLARE FUNCTION LookupSecurityDescriptorPartsA LIB "advapi32.dll" ALIAS "LookupSecurityDescriptorPartsA" ( BYREF ppOwner AS TRUSTEE_A , BYREF ppGroup AS TRUSTEE_A , BYREF pcCountOfAccessEntries AS QUAD , BYREF ppListOfAccessEntries AS QUAD , BYREF pcCountOfAuditEntries AS QUAD , BYREF ppListOfAuditEntries AS QUAD , BYREF pSD AS SECURITY_DESCRIPTOR ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION LookupSecurityDescriptorPartsW LIB "ADVAPI32.dll" ALIAS "LookupSecurityDescriptorPartsW" ( pOwner AS TRUSTEE_W, pGroup AS TRUSTEE_W, BYVAL cCountOfAccessEntries AS QUAD, BYVAL pListOfAccessEntries AS EXPLICIT_ACCESS_W PTR, BYVAL cCountOfAuditEntries AS QUAD, BYVAL pListOfAuditEntries AS EXPLICIT_ACCESS_W PTR, pSD AS SECURITY_DESCRIPTOR ) AS QUAD
#ELSE
DECLARE FUNCTION LookupSecurityDescriptorPartsW LIB "advapi32.dll" ALIAS "LookupSecurityDescriptorPartsW" ( BYREF ppOwner AS TRUSTEE_W , BYREF ppGroup AS TRUSTEE_W , BYREF pcCountOfAccessEntries AS QUAD , BYREF ppListOfAccessEntries AS QUAD , BYREF pcCountOfAuditEntries AS QUAD , BYREF ppListOfAuditEntries AS QUAD , BYREF pSD AS SECURITY_DESCRIPTOR ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
MACRO LookupSecurityDescriptorParts = LookupSecurityDescriptorPartsW
#ELSE
MACRO LookupSecurityDescriptorParts = LookupSecurityDescriptorPartsA
#ENDIF
'//----------------------------------------------------------------------------
'// The following helper API are provided for building
'// access control structures.
'//----------------------------------------------------------------------------
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildExplicitAccessWithNameA LIB "ADVAPI32.dll" ALIAS "BuildExplicitAccessWithNameA" ( BYVAL pExplicitAccess AS EXPLICIT_ACCESS_A PTR, pTrusteeName AS ASCIIZ, BYVAL AccessPermissions AS QUAD, BYVAL AccessMode AS ACCESS_MODE_enum, BYVAL Inheritance AS QUAD )
#ELSE
DECLARE FUNCTION BuildExplicitAccessWithNameA LIB "advapi32.dll" ALIAS "BuildExplicitAccessWithNameA" ( BYREF pExplicitAccess AS EXPLICIT_ACCESS_A , BYREF pTrusteeName AS ASCIIZ , BYVAL AccessPermissions AS QUAD , BYVAL AccessMode AS ACCESS_MODE_ENUM , BYVAL Inheritance AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildExplicitAccessWithNameW LIB "ADVAPI32.dll" ALIAS "BuildExplicitAccessWithNameW" ( BYVAL pExplicitAccess AS EXPLICIT_ACCESS_W PTR, pTrusteeName AS WSTRINGZ, BYVAL AccessPermissions AS QUAD, BYVAL AccessMode AS ACCESS_MODE_enum, BYVAL Inheritance AS QUAD )
#ELSE
DECLARE FUNCTION BuildExplicitAccessWithNameW LIB "advapi32.dll" ALIAS "BuildExplicitAccessWithNameW" ( BYREF pExplicitAccess AS EXPLICIT_ACCESS_W , BYREF pTrusteeName AS WSTRINGZ , BYVAL AccessPermissions AS QUAD , BYVAL AccessMode AS ACCESS_MODE_ENUM , BYVAL Inheritance AS QUAD ) AS QUAD
#ENDIF
#IF %DEF(%UNICODE)
MACRO BuildExplicitAccessWithName = BuildExplicitAccessWithNameW
#ELSE
MACRO BuildExplicitAccessWithName = BuildExplicitAccessWithNameA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildImpersonateExplicitAccessWithNameA LIB "ADVAPI32.dll" ALIAS "BuildImpersonateExplicitAccessWithNameA" ( BYVAL pExplicitAccess AS EXPLICIT_ACCESS_A PTR, pTrusteeName AS ASCIIZ, pTrustee AS TRUSTEE_A, BYVAL AccessPermissions AS QUAD, BYVAL AccessMode AS ACCESS_MODE_enum, BYVAL Inheritance AS QUAD )
#ELSE
DECLARE SUB BuildImpersonateExplicitAccessWithNameA LIB "advapi32.dll" ALIAS "BuildImpersonateExplicitAccessWithNameA" ( BYREF pExplicitAccess AS EXPLICIT_ACCESS_A , BYREF pTrusteeName AS ASCIIZ , BYREF pTrustee AS TRUSTEE_A , BYVAL AccessPermissions AS QUAD , BYVAL AccessMode AS ACCESS_MODE_ENUM , BYVAL Inheritance AS QUAD ) ' void
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildImpersonateExplicitAccessWithNameW LIB "ADVAPI32.dll" ALIAS "BuildImpersonateExplicitAccessWithNameW" ( BYVAL pExplicitAccess AS EXPLICIT_ACCESS_W PTR, pTrusteeName AS WSTRINGZ, pTrustee AS TRUSTEE_A, BYVAL AccessPermissions AS QUAD, BYVAL AccessMode AS ACCESS_MODE_enum, BYVAL Inheritance AS QUAD )
#ELSE
DECLARE SUB BuildImpersonateExplicitAccessWithNameW LIB "advapi32.dll" ALIAS "BuildImpersonateExplicitAccessWithNameW" ( BYREF pExplicitAccess AS EXPLICIT_ACCESS_W , BYREF pTrusteeName AS WSTRINGZ , BYREF pTrustee AS TRUSTEE_W , BYVAL AccessPermissions AS QUAD , BYVAL AccessMode AS ACCESS_MODE_ENUM , BYVAL Inheritance AS QUAD ) ' void
#ENDIF
#IF %DEF(%UNICODE)
MACRO BuildImpersonateExplicitAccessWithName = BuildImpersonateExplicitAccessWithNameW
#ELSE
MACRO BuildImpersonateExplicitAccessWithName = BuildImpersonateExplicitAccessWithNameA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildTrusteeWithNameA LIB "ADVAPI32.dll" ALIAS "BuildTrusteeWithNameA" ( pTrustee AS TRUSTEE_A, pName AS ASCIIZ )
#ELSE
DECLARE SUB BuildTrusteeWithNameA LIB "advapi32.dll" ALIAS "BuildTrusteeWithNameA" ( BYREF pTrustee AS TRUSTEE_A , OPTIONAL BYREF pName AS ASCIIZ ) ' void
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildTrusteeWithNameW LIB "ADVAPI32.dll" ALIAS "BuildTrusteeWithNameW" ( pTrustee AS TRUSTEE_W, pName AS WSTRINGZ )
#ELSE
DECLARE SUB BuildTrusteeWithNameW LIB "advapi32.dll" ALIAS "BuildTrusteeWithNameW" ( BYREF pTrustee AS TRUSTEE_W , OPTIONAL BYREF pName AS WSTRINGZ ) ' void
#ENDIF
#IF %DEF(%UNICODE)
MACRO BuildTrusteeWithName = BuildTrusteeWithNameW
#ELSE
MACRO BuildTrusteeWithName = BuildTrusteeWithNameA
#ENDIF
' Obsolete. Do not use.
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildImpersonateTrusteeA LIB "ADVAPI32.dll" ALIAS "BuildImpersonateTrusteeA" ( pTrustee AS TRUSTEE_A, pImpersonateTrustee AS TRUSTEE_A )
#ELSE
DECLARE SUB BuildImpersonateTrusteeA LIB "advapi32.dll" ALIAS "BuildImpersonateTrusteeA" ( BYREF pTrustee AS TRUSTEE_A , OPTIONAL BYREF pImpersonateTrustee AS TRUSTEE_A ) ' void
#ENDIF
' Obsolete. Do not use.
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildImpersonateTrusteeW LIB "ADVAPI32.dll" ALIAS "BuildImpersonateTrusteeW" ( pTrustee AS TRUSTEE_W, pImpersonateTrustee AS TRUSTEE_W )
#ELSE
DECLARE SUB BuildImpersonateTrusteeW LIB "advapi32.dll" ALIAS "BuildImpersonateTrusteeW" ( BYREF pTrustee AS TRUSTEE_W , OPTIONAL BYREF pImpersonateTrustee AS TRUSTEE_W ) ' void
#ENDIF
#IF %DEF(%UNICODE)
MACRO BuildImpersonateTrustee = BuildImpersonateTrusteeW
#ELSE
MACRO BuildImpersonateTrustee = BuildImpersonateTrusteeA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildTrusteeWithSidA LIB "ADVAPI32.dll" ALIAS "BuildTrusteeWithSidA" ( pTrustee AS TRUSTEE_A, BYVAL pSid AS SID PTR )
#ELSE
DECLARE SUB BuildTrusteeWithSidA LIB "advapi32.dll" ALIAS "BuildTrusteeWithSidA" ( BYREF pTrustee AS TRUSTEE_A , OPTIONAL BYVAL pSid AS SID PTR ) ' void
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildTrusteeWithSidW LIB "ADVAPI32.dll" ALIAS "BuildTrusteeWithSidW" ( pTrustee AS TRUSTEE_W, BYVAL pSid AS SID PTR )
#ELSE
DECLARE SUB BuildTrusteeWithSidW LIB "advapi32.dll" ALIAS "BuildTrusteeWithSidW" ( BYREF pTrustee AS TRUSTEE_W , OPTIONAL BYVAL pSid AS SID PTR ) ' void
#ENDIF
#IF %DEF(%UNICODE)
MACRO BuildTrusteeWithSid = BuildTrusteeWithSidW
#ELSE
MACRO BuildTrusteeWithSid = BuildTrusteeWithSidA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildTrusteeWithObjectsAndSidA LIB "ADVAPI32.dll" ALIAS "BuildTrusteeWithObjectsAndSidA" ( pTrustee AS TRUSTEE_A, pObjSid AS OBJECTS_AND_SID, pObjectGuid AS GUID, pInheritedObjectGuid AS GUID, BYVAL pSid AS SID PTR )
#ELSE
DECLARE SUB BuildTrusteeWithObjectsAndSidA LIB "advapi32.dll" ALIAS "BuildTrusteeWithObjectsAndSidA" ( BYREF pTrustee AS TRUSTEE_A , OPTIONAL BYREF pObjSid AS OBJECTS_AND_SID , OPTIONAL BYREF pObjectGuid AS GUID , OPTIONAL BYREF pInheritedObjectGuid AS GUID , OPTIONAL BYVAL pSid AS SID PTR ) ' void
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildTrusteeWithObjectsAndSidW LIB "ADVAPI32.dll" ALIAS "BuildTrusteeWithObjectsAndSidW" ( pTrustee AS TRUSTEE_W, pObjSid AS OBJECTS_AND_SID, pObjectGuid AS GUID, pInheritedObjectGuid AS GUID, BYVAL pSid AS SID PTR )
#ELSE
DECLARE SUB BuildTrusteeWithObjectsAndSidW LIB "advapi32.dll" ALIAS "BuildTrusteeWithObjectsAndSidW" ( BYREF pTrustee AS TRUSTEE_W , OPTIONAL BYREF pObjSid AS OBJECTS_AND_SID , OPTIONAL BYREF pObjectGuid AS GUID , OPTIONAL BYREF pInheritedObjectGuid AS GUID , OPTIONAL BYVAL pSid AS SID PTR ) ' void
#ENDIF
#IF %DEF(%UNICODE)
MACRO BuildTrusteeWithObjectsAndSid = BuildTrusteeWithObjectsAndSidW
#ELSE
MACRO BuildTrusteeWithObjectsAndSid = BuildTrusteeWithObjectsAndSidA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildTrusteeWithObjectsAndNameA LIB "ADVAPI32.dll" ALIAS "BuildTrusteeWithObjectsAndNameA" ( pTrustee AS TRUSTEE_A, pObjName AS OBJECTS_AND_NAME, ObjectType AS SE_OBJECT_TYPE_enum, ObjectTypeName AS ASCIIZ, InheritedObjectTypeName AS ASCIIZ, TrusteeName AS ASCIIZ )
#ELSE
DECLARE SUB BuildTrusteeWithObjectsAndNameA LIB "advapi32.dll" ALIAS "BuildTrusteeWithObjectsAndNameA" ( BYREF pTrustee AS TRUSTEE_A , OPTIONAL BYREF pObjName AS OBJECTS_AND_NAME , OPTIONAL BYVAL ObjectType AS SE_OBJECT_TYPE_ENUM , OPTIONAL BYREF ObjectTypeName AS ASCIIZ , OPTIONAL BYREF InheritedObjectTypeName AS ASCIIZ , OPTIONAL BYREF Name AS ASCIIZ ) ' void
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE SUB BuildTrusteeWithObjectsAndNameW LIB "ADVAPI32.dll" ALIAS "BuildTrusteeWithObjectsAndNameW" ( pTrustee AS TRUSTEE_W, pObjName AS OBJECTS_AND_NAME, ObjectType AS SE_OBJECT_TYPE_enum, ObjectTypeName AS WSTRINGZ, InheritedObjectTypeName AS WSTRINGZ, TrusteeName AS WSTRINGZ )
#ELSE
DECLARE SUB BuildTrusteeWithObjectsAndNameW LIB "advapi32.dll" ALIAS "BuildTrusteeWithObjectsAndNameW" ( BYREF pTrustee AS TRUSTEE_W , OPTIONAL BYREF pObjName AS OBJECTS_AND_NAME_W , OPTIONAL BYREF ObjectType AS SE_OBJECT_TYPE_ENUM , OPTIONAL BYREF ObjectTypeName AS WSTRINGZ , OPTIONAL BYREF InheritedObjectTypeName AS WSTRINGZ , OPTIONAL BYVAL Name AS QUAD ) ' void
#ENDIF
#IF %DEF(%UNICODE)
MACRO BuildTrusteeWithObjectsAndName = BuildTrusteeWithObjectsAndNameW
#ELSE
MACRO BuildTrusteeWithObjectsAndName = BuildTrusteeWithObjectsAndNameA
#ENDIF
DECLARE FUNCTION GetTrusteeNameA LIB "advapi32.dll" ALIAS "GetTrusteeNameA" ( BYREF pTrustee AS TRUSTEE_A ) AS QUAD
DECLARE FUNCTION GetTrusteeNameW LIB "advapi32.dll" ALIAS "GetTrusteeNameW" ( BYREF pTrustee AS TRUSTEE_W
 ) AS DWORD
#IF %DEF(%UNICODE)
MACRO GetTrusteeName = GetTrusteeNameW
#ELSE
MACRO GetTrusteeName = GetTrusteeNameA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetTrusteeTypeA LIB "ADVAPI32.dll" ALIAS "GetTrusteeTypeA" ( pTrustee AS TRUSTEE_A ) AS TRUSTEE_TYPE_enum
#ELSE
DECLARE FUNCTION GetTrusteeTypeA LIB "advapi32.dll" ALIAS "GetTrusteeTypeA" ( OPTIONAL BYREF pTrustee AS TRUSTEE_A ) AS TRUSTEE_TYPE_ENUM ' TRUSTEE_TYPE
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetTrusteeTypeW LIB "ADVAPI32.dll" ALIAS "GetTrusteeTypeW" ( pTrustee AS TRUSTEE_W ) AS TRUSTEE_TYPE_enum
#ELSE
DECLARE FUNCTION GetTrusteeTypeW LIB "advapi32.dll" ALIAS "GetTrusteeTypeW" ( OPTIONAL BYREF pTrustee AS TRUSTEE_W ) AS TRUSTEE_TYPE_ENUM ' TRUSTEE_TYPE
#ENDIF
#IF %DEF(%UNICODE)
MACRO GetTrusteeType = GetTrusteeTypeW
#ELSE
MACRO GetTrusteeType = GetTrusteeTypeA
#ENDIF
DECLARE FUNCTION GetTrusteeFormA LIB "advapi32.dll" ALIAS "GetTrusteeFormA" ( BYREF pTrustee AS TRUSTEE_A ) AS TRUSTEE_FORM_ENUM ' TRUSTEE_FORM
DECLARE FUNCTION GetTrusteeFormW LIB "advapi32.dll" ALIAS "GetTrusteeFormW" ( BYREF pTrustee AS TRUSTEE_W ) AS TRUSTEE_FORM_ENUM ' TRUSTEE_FORM
#IF %DEF(%UNICODE)
MACRO GetTrusteeForm = GetTrusteeFormW
#ELSE
MACRO GetTrusteeForm = GetTrusteeFormA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetMultipleTrusteeOperationA LIB "ADVAPI32.dll" ALIAS "GetMultipleTrusteeOperationA" ( pTrustee AS TRUSTEE_A ) AS MULTIPLE_TRUSTEE_OPERATION_enum
#ELSE
DECLARE FUNCTION GetMultipleTrusteeOperationA LIB "advapi32.dll" ALIAS "GetMultipleTrusteeOperationA" ( OPTIONAL BYREF pTrustee AS TRUSTEE_A ) AS MULTIPLE_TRUSTEE_OPERATION_ENUM ' MULTIPLE_TRUSTEE_OPERATION
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetMultipleTrusteeOperationW LIB "ADVAPI32.dll" ALIAS "GetMultipleTrusteeOperationW" ( pTrustee AS TRUSTEE_W ) AS MULTIPLE_TRUSTEE_OPERATION_enum
#ELSE
DECLARE FUNCTION GetMultipleTrusteeOperationW LIB "advapi32.dll" ALIAS "GetMultipleTrusteeOperationW" ( OPTIONAL BYREF pTrustee AS TRUSTEE_W ) AS MULTIPLE_TRUSTEE_OPERATION_ENUM ' MULTIPLE_TRUSTEE_OPERATION
#ENDIF
#IF %DEF(%UNICODE)
MACRO GetMultipleTrusteeOperation = GetMultipleTrusteeOperationW
#ELSE
MACRO GetMultipleTrusteeOperation = GetMultipleTrusteeOperationA
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetMultipleTrusteeA LIB "ADVAPI32.dll" ALIAS "GetMultipleTrusteeA" ( pTrustee AS TRUSTEE_A ) AS QUAD
#ELSE
DECLARE FUNCTION GetMultipleTrusteeA LIB "advapi32.dll" ALIAS "GetMultipleTrusteeA" ( OPTIONAL BYREF pTrustee AS TRUSTEE_A ) AS QUAD ' PTRUSTEE_A
#ENDIF
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION GetMultipleTrusteeW LIB "ADVAPI32.dll" ALIAS "GetMultipleTrusteeW" ( pTrustee AS TRUSTEE_W ) AS QUAD
#ELSE
DECLARE FUNCTION GetMultipleTrusteeW LIB "advapi32.dll" ALIAS "GetMultipleTrusteeW" ( OPTIONAL BYREF pTrustee AS TRUSTEE_W ) AS QUAD ' PTRUSTEE_W
#ENDIF
#IF %DEF(%UNICODE)
MACRO GetMultipleTrustee = GetMultipleTrusteeW
#ELSE
MACRO GetMultipleTrustee = GetMultipleTrusteeA
#ENDIF
#ENDIF
