jwaaclapi.pas 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360
  1. {******************************************************************************}
  2. { }
  3. { Access Control API interface Unit for Object Pascal }
  4. { }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
  6. { Corporation. All Rights Reserved. }
  7. { }
  8. { The original file is: aclapi.h, released June 2000. The original Pascal }
  9. { code is: AclApi.pas, released December 2000. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
  11. { }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
  13. { Marcel van Brakel. All Rights Reserved. }
  14. { }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  16. { }
  17. { You may retrieve the latest version of this file at the Project JEDI }
  18. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  19. { }
  20. { The contents of this file are used with permission, subject to the Mozilla }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html }
  24. { }
  25. { Software distributed under the License is distributed on an "AS IS" basis, }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License. }
  28. { }
  29. { Alternatively, the contents of this file may be used under the terms of the }
  30. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  31. { provisions of the LGPL License are applicable instead of those above. }
  32. { If you wish to allow use of your version of this file only under the terms }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting the provisions above and }
  35. { replace them with the notice and other provisions required by the LGPL }
  36. { License. If you do not delete the provisions above, a recipient may use }
  37. { your version of this file under either the MPL or the LGPL License. }
  38. { }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. { }
  41. {******************************************************************************}
  42. // $Id: JwaAclApi.pas,v 1.11 2007/09/05 11:58:48 dezipaitor Exp $
  43. {$IFNDEF JWA_OMIT_SECTIONS}
  44. unit JwaAclApi;
  45. {$WEAKPACKAGEUNIT}
  46. {$ENDIF JWA_OMIT_SECTIONS}
  47. {$HPPEMIT ''}
  48. {$HPPEMIT '#include "aclapi.h"'}
  49. {$HPPEMIT ''}
  50. {$IFNDEF JWA_OMIT_SECTIONS}
  51. {$I jediapilib.inc}
  52. interface
  53. uses
  54. JwaAccCtrl, JwaWinNT, JwaWinType;
  55. {$ENDIF JWA_OMIT_SECTIONS}
  56. {$IFNDEF JWA_IMPLEMENTATIONSECTION}
  57. {$IFNDEF JWA_INCLUDEMODE}
  58. //
  59. // Progress Function:
  60. // Caller of tree operation implements this Progress function, then
  61. // passes its function pointer to tree operation.
  62. // Tree operation invokes Progress function to provide progress and error
  63. // information to the caller during the potentially long execution
  64. // of the tree operation. Tree operation provides the name of the object
  65. // last processed and the error status of the operation on that object.
  66. // Tree operation also passes the current InvokeSetting value.
  67. // Caller may change the InvokeSetting value, for example, from "Always"
  68. // to "Only On Error."
  69. //
  70. type
  71. FN_PROGRESS = procedure(
  72. pObjectName: LPWSTR; // name of object just processed
  73. Status: DWORD; // status of operation on object
  74. var pInvokeSetting: PPROG_INVOKE_SETTING; // Never, always,
  75. Args: PVOID; // Caller specific data
  76. SecuritySet: BOOL // Whether security was set
  77. ); stdcall;
  78. {$EXTERNALSYM FN_PROGRESS}
  79. TFnProgress = FN_PROGRESS;
  80. {$ENDIF JWA_INCLUDEMODE}
  81. function SetEntriesInAclA(cCountOfExplicitEntries: ULONG;
  82. pListOfExplicitEntries: PEXPLICIT_ACCESS_A; OldAcl: PACL;
  83. var NewAcl: PACL): DWORD; stdcall;
  84. {$EXTERNALSYM SetEntriesInAclA}
  85. function SetEntriesInAclW(cCountOfExplicitEntries: ULONG;
  86. pListOfExplicitEntries: PEXPLICIT_ACCESS_W; OldAcl: PACL;
  87. var NewAcl: PACL): DWORD; stdcall;
  88. {$EXTERNALSYM SetEntriesInAclW}
  89. function SetEntriesInAcl(cCountOfExplicitEntries: ULONG;
  90. pListOfExplicitEntries: PEXPLICIT_ACCESS; OldAcl: PACL;
  91. var NewAcl: PACL): DWORD; stdcall;
  92. {$EXTERNALSYM SetEntriesInAcl}
  93. function GetExplicitEntriesFromAclA(pacl: PACL; var pcCountOfExplicitEntries: ULONG;
  94. var pListOfExplicitEntries: PEXPLICIT_ACCESS_A): DWORD; stdcall;
  95. {$EXTERNALSYM GetExplicitEntriesFromAclA}
  96. function GetExplicitEntriesFromAclW(pacl: PACL; var pcCountOfExplicitEntries: ULONG;
  97. var pListOfExplicitEntries: PEXPLICIT_ACCESS_W): DWORD; stdcall;
  98. {$EXTERNALSYM GetExplicitEntriesFromAclW}
  99. function GetExplicitEntriesFromAcl(pacl: PACL; var pcCountOfExplicitEntries: ULONG;
  100. var pListOfExplicitEntries: PEXPLICIT_ACCESS): DWORD; stdcall;
  101. {$EXTERNALSYM GetExplicitEntriesFromAcl}
  102. function GetEffectiveRightsFromAclA(pacl: PACL; pTrustee: PTRUSTEE_A;
  103. var pAccessRights: ACCESS_MASK): DWORD; stdcall;
  104. {$EXTERNALSYM GetEffectiveRightsFromAclA}
  105. function GetEffectiveRightsFromAclW(pacl: PACL; pTrustee: PTRUSTEE_W;
  106. var pAccessRights: ACCESS_MASK): DWORD; stdcall;
  107. {$EXTERNALSYM GetEffectiveRightsFromAclW}
  108. function GetEffectiveRightsFromAcl(pacl: PACL; pTrustee: PTRUSTEE;
  109. var pAccessRights: ACCESS_MASK): DWORD; stdcall;
  110. {$EXTERNALSYM GetEffectiveRightsFromAcl}
  111. function GetAuditedPermissionsFromAclA(pacl: PACL; pTrustee: PTRUSTEE_A;
  112. var pSuccessfulAuditedRights, pFailedAuditRights: ACCESS_MASK): DWORD; stdcall;
  113. {$EXTERNALSYM GetAuditedPermissionsFromAclA}
  114. function GetAuditedPermissionsFromAclW(pacl: PACL; pTrustee: PTRUSTEE_W;
  115. var pSuccessfulAuditedRights, pFailedAuditRights: ACCESS_MASK): DWORD; stdcall;
  116. {$EXTERNALSYM GetAuditedPermissionsFromAclW}
  117. function GetAuditedPermissionsFromAcl(pacl: PACL; pTrustee: PTRUSTEE;
  118. var pSuccessfulAuditedRights, pFailedAuditRights: ACCESS_MASK): DWORD; stdcall;
  119. {$EXTERNALSYM GetAuditedPermissionsFromAcl}
  120. function GetNamedSecurityInfoA(pObjectName: LPSTR; ObjectType: SE_OBJECT_TYPE;
  121. SecurityInfo: SECURITY_INFORMATION; ppsidOwner, ppsidGroup: PPSID; ppDacl,
  122. ppSacl: PPACL; var ppSecurityDescriptor: PSECURITY_DESCRIPTOR): DWORD; stdcall;
  123. {$EXTERNALSYM GetNamedSecurityInfoA}
  124. function GetNamedSecurityInfoW(pObjectName: LPWSTR; ObjectType: SE_OBJECT_TYPE;
  125. SecurityInfo: SECURITY_INFORMATION; ppsidOwner, ppsidGroup: PPSID; ppDacl,
  126. ppSacl: PPACL; var ppSecurityDescriptor: PSECURITY_DESCRIPTOR): DWORD; stdcall;
  127. {$EXTERNALSYM GetNamedSecurityInfoW}
  128. function GetNamedSecurityInfo(pObjectName: LPTSTR; ObjectType: SE_OBJECT_TYPE;
  129. SecurityInfo: SECURITY_INFORMATION; ppsidOwner, ppsidGroup: PPSID; ppDacl,
  130. ppSacl: PPACL; var ppSecurityDescriptor: PSECURITY_DESCRIPTOR): DWORD; stdcall;
  131. {$EXTERNALSYM GetNamedSecurityInfo}
  132. function GetSecurityInfo(handle: HANDLE; ObjectType: SE_OBJECT_TYPE;
  133. SecurityInfo: SECURITY_INFORMATION; ppsidOwner: PPSID; ppsidGroup: PPSID;
  134. ppDacl, ppSacl: PPACL; var ppSecurityDescriptor: PSECURITY_DESCRIPTOR): DWORD; stdcall;
  135. {$EXTERNALSYM GetSecurityInfo}
  136. function SetNamedSecurityInfoA(pObjectName: LPSTR; ObjectType: SE_OBJECT_TYPE;
  137. SecurityInfo: SECURITY_INFORMATION; psidOwner, psidGroup: PSID;
  138. pDacl, pSacl: PACL): DWORD; stdcall;
  139. {$EXTERNALSYM SetNamedSecurityInfoA}
  140. function SetNamedSecurityInfoW(pObjectName: LPWSTR; ObjectType: SE_OBJECT_TYPE;
  141. SecurityInfo: SECURITY_INFORMATION; psidOwner, psidGroup: PSID;
  142. pDacl, pSacl: PACL): DWORD; stdcall;
  143. {$EXTERNALSYM SetNamedSecurityInfoW}
  144. function SetNamedSecurityInfo(pObjectName: LPTSTR; ObjectType: SE_OBJECT_TYPE;
  145. SecurityInfo: SECURITY_INFORMATION; psidOwner, psidGroup: PSID;
  146. pDacl, pSacl: PACL): DWORD; stdcall;
  147. {$EXTERNALSYM SetNamedSecurityInfo}
  148. function SetSecurityInfo(handle: HANDLE; ObjectType: SE_OBJECT_TYPE;
  149. SecurityInfo: SECURITY_INFORMATION; psidOwner, psidGroup: PSID;
  150. pDacl, pSacl: PACL): DWORD; stdcall;
  151. {$EXTERNALSYM SetSecurityInfo}
  152. function GetInheritanceSourceA(pObjectName: LPSTR; ObjectType: SE_OBJECT_TYPE;
  153. SecurityInfo: SECURITY_INFORMATION; Container: BOOL; pObjectClassGuids: LPGUID;
  154. GuidCount: DWORD; pAcl: PACL; pfnArray: PFN_OBJECT_MGR_FUNCTS;
  155. pGenericMapping: PGENERIC_MAPPING; pInheritArray: PINHERITED_FROMA): DWORD; stdcall;
  156. {$EXTERNALSYM GetInheritanceSourceA}
  157. function GetInheritanceSourceW(pObjectName: LPWSTR; ObjectType: SE_OBJECT_TYPE;
  158. SecurityInfo: SECURITY_INFORMATION; Container: BOOL; pObjectClassGuids: LPGUID;
  159. GuidCount: DWORD; pAcl: PACL; pfnArray: PFN_OBJECT_MGR_FUNCTS;
  160. pGenericMapping: PGENERIC_MAPPING; pInheritArray: PINHERITED_FROMW): DWORD; stdcall;
  161. {$EXTERNALSYM GetInheritanceSourceW}
  162. function GetInheritanceSource(pObjectName: LPTSTR; ObjectType: SE_OBJECT_TYPE;
  163. SecurityInfo: SECURITY_INFORMATION; Container: BOOL; pObjectClassGuids: LPGUID;
  164. GuidCount: DWORD; pAcl: PACL; pfnArray: PFN_OBJECT_MGR_FUNCTS;
  165. pGenericMapping: PGENERIC_MAPPING; pInheritArray: PINHERITED_FROM): DWORD; stdcall;
  166. {$EXTERNALSYM GetInheritanceSource}
  167. function FreeInheritedFromArray(pInheritArray: PINHERITED_FROMW; AceCnt: USHORT;
  168. pfnArray: PFN_OBJECT_MGR_FUNCTS): DWORD; stdcall;
  169. {$EXTERNALSYM FreeInheritedFromArray}
  170. function TreeResetNamedSecurityInfoA(pObjectName: LPSTR; ObjectType: SE_OBJECT_TYPE;
  171. SecurityInfo: SECURITY_INFORMATION; pOwner, pGroup: PSID; pDacl, pSacl: PACL;
  172. KeepExplicit: BOOL; fnProgress: FN_PROGRESS; ProgressInvokeSetting: PROG_INVOKE_SETTING;
  173. Args: PVOID): DWORD; stdcall;
  174. {$EXTERNALSYM TreeResetNamedSecurityInfoA}
  175. function TreeResetNamedSecurityInfoW(pObjectName: LPWSTR; ObjectType: SE_OBJECT_TYPE;
  176. SecurityInfo: SECURITY_INFORMATION; pOwner, pGroup: PSID; pDacl, pSacl: PACL;
  177. KeepExplicit: BOOL; fnProgress: FN_PROGRESS; ProgressInvokeSetting: PROG_INVOKE_SETTING;
  178. Args: PVOID): DWORD; stdcall;
  179. {$EXTERNALSYM TreeResetNamedSecurityInfoW}
  180. function TreeResetNamedSecurityInfo(pObjectName: LPTSTR; ObjectType: SE_OBJECT_TYPE;
  181. SecurityInfo: SECURITY_INFORMATION; pOwner, pGroup: PSID; pDacl, pSacl: PACL;
  182. KeepExplicit: BOOL; fnProgress: FN_PROGRESS; ProgressInvokeSetting: PROG_INVOKE_SETTING;
  183. Args: PVOID): DWORD; stdcall;
  184. {$EXTERNALSYM TreeResetNamedSecurityInfo}
  185. //----------------------------------------------------------------------------
  186. // The following API are provided for trusted servers to use to
  187. // implement access control on their own objects.
  188. //----------------------------------------------------------------------------
  189. function BuildSecurityDescriptorA(pOwner: PTRUSTEE_A; pGroup: PTRUSTEE_A;
  190. cCountOfAccessEntries: ULONG; pListOfAccessEntries: PEXPLICIT_ACCESS_A;
  191. cCountOfAuditEntries: ULONG; pListOfAuditEntries: PEXPLICIT_ACCESS_A;
  192. pOldSD: PSECURITY_DESCRIPTOR; var pSizeNewSD: ULONG;
  193. var pNewSD: PSECURITY_DESCRIPTOR): DWORD; stdcall;
  194. {$EXTERNALSYM BuildSecurityDescriptorA}
  195. function BuildSecurityDescriptorW(pOwner: PTRUSTEE_W; pGroup: PTRUSTEE_W;
  196. cCountOfAccessEntries: ULONG; pListOfAccessEntries: PEXPLICIT_ACCESS_W;
  197. cCountOfAuditEntries: ULONG; pListOfAuditEntries: PEXPLICIT_ACCESS_W;
  198. pOldSD: PSECURITY_DESCRIPTOR; var pSizeNewSD: ULONG;
  199. var pNewSD: PSECURITY_DESCRIPTOR): DWORD; stdcall;
  200. {$EXTERNALSYM BuildSecurityDescriptorW}
  201. function BuildSecurityDescriptor(pOwner: PTRUSTEE; pGroup: PTRUSTEE;
  202. cCountOfAccessEntries: ULONG; pListOfAccessEntries: PEXPLICIT_ACCESS;
  203. cCountOfAuditEntries: ULONG; pListOfAuditEntries: PEXPLICIT_ACCESS;
  204. pOldSD: PSECURITY_DESCRIPTOR; var pSizeNewSD: ULONG;
  205. var pNewSD: PSECURITY_DESCRIPTOR): DWORD; stdcall;
  206. {$EXTERNALSYM BuildSecurityDescriptor}
  207. function LookupSecurityDescriptorPartsA(pOwner, pGroup: PPTRUSTEE_A;
  208. cCountOfAccessEntries: PULONG; pListOfAccessEntries: PEXPLICIT_ACCESS_A;
  209. cCountOfAuditEntries: PULONG; pListOfAuditEntries: PEXPLICIT_ACCESS_A;
  210. var pSD: SECURITY_DESCRIPTOR): DWORD; stdcall;
  211. {$EXTERNALSYM LookupSecurityDescriptorPartsA}
  212. function LookupSecurityDescriptorPartsW(pOwner, pGroup: PPTRUSTEE_W;
  213. cCountOfAccessEntries: PULONG; pListOfAccessEntries: PEXPLICIT_ACCESS_W;
  214. cCountOfAuditEntries: PULONG; pListOfAuditEntries: PEXPLICIT_ACCESS_W;
  215. var pSD: SECURITY_DESCRIPTOR): DWORD; stdcall;
  216. {$EXTERNALSYM LookupSecurityDescriptorPartsW}
  217. function LookupSecurityDescriptorParts(pOwner, pGroup: PPTRUSTEE;
  218. cCountOfAccessEntries: PULONG; pListOfAccessEntries: PEXPLICIT_ACCESS;
  219. cCountOfAuditEntries: PULONG; pListOfAuditEntries: PEXPLICIT_ACCESS;
  220. var pSD: SECURITY_DESCRIPTOR): DWORD; stdcall;
  221. {$EXTERNALSYM LookupSecurityDescriptorParts}
  222. //----------------------------------------------------------------------------
  223. // The following helper API are provided for building
  224. // access control structures.
  225. //----------------------------------------------------------------------------
  226. procedure BuildExplicitAccessWithNameA(pExplicitAccess: PEXPLICIT_ACCESS_A;
  227. pTrusteeName: LPSTR; AccessPermissions: DWORD; AccessMode: ACCESS_MODE;
  228. Inheritance: DWORD); stdcall;
  229. {$EXTERNALSYM BuildExplicitAccessWithNameA}
  230. procedure BuildExplicitAccessWithNameW(pExplicitAccess: PEXPLICIT_ACCESS_W;
  231. pTrusteeName: LPWSTR; AccessPermissions: DWORD; AccessMode: ACCESS_MODE;
  232. Inheritance: DWORD); stdcall;
  233. {$EXTERNALSYM BuildExplicitAccessWithNameW}
  234. procedure BuildExplicitAccessWithName(pExplicitAccess: PEXPLICIT_ACCESS;
  235. pTrusteeName: LPTSTR; AccessPermissions: DWORD; AccessMode: ACCESS_MODE;
  236. Inheritance: DWORD); stdcall;
  237. {$EXTERNALSYM BuildExplicitAccessWithName}
  238. procedure BuildImpersonateExplicitAccessWithNameA(pExplicitAccess: PEXPLICIT_ACCESS_A;
  239. pTrusteeName: LPSTR; pTrustee: PTRUSTEE_A; AccessPermissions: DWORD;
  240. AccessMode: ACCESS_MODE; Inheritance: DWORD); stdcall;
  241. {$EXTERNALSYM BuildImpersonateExplicitAccessWithNameA}
  242. procedure BuildImpersonateExplicitAccessWithNameW(pExplicitAccess: PEXPLICIT_ACCESS_W;
  243. pTrusteeName: LPWSTR; pTrustee: PTRUSTEE_W; AccessPermissions: DWORD;
  244. AccessMode: ACCESS_MODE; Inheritance: DWORD); stdcall;
  245. {$EXTERNALSYM BuildImpersonateExplicitAccessWithNameW}
  246. procedure BuildImpersonateExplicitAccessWithName(pExplicitAccess: PEXPLICIT_ACCESS;
  247. pTrusteeName: LPTSTR; pTrustee: PTRUSTEE; AccessPermissions: DWORD;
  248. AccessMode: ACCESS_MODE; Inheritance: DWORD); stdcall;
  249. {$EXTERNALSYM BuildImpersonateExplicitAccessWithName}
  250. procedure BuildTrusteeWithNameA(pTrustee: PTRUSTEE_A; pName: LPSTR); stdcall;
  251. {$EXTERNALSYM BuildTrusteeWithNameA}
  252. procedure BuildTrusteeWithNameW(pTrustee: PTRUSTEE_W; pName: LPWSTR); stdcall;
  253. {$EXTERNALSYM BuildTrusteeWithNameW}
  254. procedure BuildTrusteeWithName(pTrustee: PTRUSTEE; pName: LPTSTR); stdcall;
  255. {$EXTERNALSYM BuildTrusteeWithName}
  256. procedure BuildImpersonateTrusteeA(pTrustee: PTRUSTEE_A;
  257. pImpersonateTrustee: PTRUSTEE_A); stdcall;
  258. {$EXTERNALSYM BuildImpersonateTrusteeA}
  259. procedure BuildImpersonateTrusteeW(pTrustee: PTRUSTEE_W;
  260. pImpersonateTrustee: PTRUSTEE_W); stdcall;
  261. {$EXTERNALSYM BuildImpersonateTrusteeW}
  262. procedure BuildImpersonateTrustee(pTrustee: PTRUSTEE;
  263. pImpersonateTrustee: PTRUSTEE); stdcall;
  264. {$EXTERNALSYM BuildImpersonateTrustee}
  265. procedure BuildTrusteeWithSidA(pTrustee: PTRUSTEE_A; pSid: PSID); stdcall;
  266. {$EXTERNALSYM BuildTrusteeWithSidA}
  267. procedure BuildTrusteeWithSidW(pTrustee: PTRUSTEE_W; pSid: PSID); stdcall;
  268. {$EXTERNALSYM BuildTrusteeWithSidW}
  269. procedure BuildTrusteeWithSid(pTrustee: PTRUSTEE; pSid: PSID); stdcall;
  270. {$EXTERNALSYM BuildTrusteeWithSid}
  271. procedure BuildTrusteeWithObjectsAndSidA(pTrustee: PTRUSTEE_A;
  272. pObjSid: POBJECTS_AND_SID; pObjectGuid: PGUID; pInheritedObjectGuid: PGUID;
  273. pSid: PSID); stdcall;
  274. {$EXTERNALSYM BuildTrusteeWithObjectsAndSidA}
  275. procedure BuildTrusteeWithObjectsAndSidW(pTrustee: PTRUSTEE_W;
  276. pObjSid: POBJECTS_AND_SID; pObjectGuid: PGUID; pInheritedObjectGuid: PGUID;
  277. pSid: PSID); stdcall;
  278. {$EXTERNALSYM BuildTrusteeWithObjectsAndSidW}
  279. procedure BuildTrusteeWithObjectsAndSid(pTrustee: PTRUSTEE;
  280. pObjSid: POBJECTS_AND_SID; pObjectGuid: PGUID; pInheritedObjectGuid: PGUID;
  281. pSid: PSID); stdcall;
  282. {$EXTERNALSYM BuildTrusteeWithObjectsAndSid}
  283. procedure BuildTrusteeWithObjectsAndNameA(pTrustee: PTRUSTEE_A;
  284. pObjName: POBJECTS_AND_NAME_A; ObjectType: SE_OBJECT_TYPE;
  285. ObjectTypeName, InheritedObjectTypeName, Name: LPSTR); stdcall;
  286. {$EXTERNALSYM BuildTrusteeWithObjectsAndNameA}
  287. procedure BuildTrusteeWithObjectsAndNameW(pTrustee: PTRUSTEE_W;
  288. pObjName: POBJECTS_AND_NAME_W; ObjectType: SE_OBJECT_TYPE;
  289. ObjectTypeName, InheritedObjectTypeName, Name: LPWSTR); stdcall;
  290. {$EXTERNALSYM BuildTrusteeWithObjectsAndNameW}
  291. procedure BuildTrusteeWithObjectsAndName(pTrustee: PTRUSTEE;
  292. pObjName: POBJECTS_AND_NAME; ObjectType: SE_OBJECT_TYPE;
  293. ObjectTypeName, InheritedObjectTypeName, Name: LPTSTR); stdcall;
  294. {$EXTERNALSYM BuildTrusteeWithObjectsAndName}
  295. function GetTrusteeNameA(pTrustee: PTRUSTEE_A): LPSTR; stdcall;
  296. {$EXTERNALSYM GetTrusteeNameA}
  297. function GetTrusteeNameW(pTrustee: PTRUSTEE_W): LPWSTR; stdcall;
  298. {$EXTERNALSYM GetTrusteeNameW}
  299. function GetTrusteeName(pTrustee: PTRUSTEE): LPTSTR; stdcall;
  300. {$EXTERNALSYM GetTrusteeName}
  301. function GetTrusteeTypeA(pTrustee: PTRUSTEE_A): TRUSTEE_TYPE; stdcall;
  302. {$EXTERNALSYM GetTrusteeTypeA}
  303. function GetTrusteeTypeW(pTrustee: PTRUSTEE_W): TRUSTEE_TYPE; stdcall;
  304. {$EXTERNALSYM GetTrusteeTypeW}
  305. function GetTrusteeType(pTrustee: PTRUSTEE): TRUSTEE_TYPE; stdcall;
  306. {$EXTERNALSYM GetTrusteeType}
  307. function GetTrusteeFormA(pTrustee: PTRUSTEE_A): TRUSTEE_FORM; stdcall;
  308. {$EXTERNALSYM GetTrusteeFormA}
  309. function GetTrusteeFormW(pTrustee: PTRUSTEE_W): TRUSTEE_FORM; stdcall;
  310. {$EXTERNALSYM GetTrusteeFormW}
  311. function GetTrusteeForm(pTrustee: PTRUSTEE): TRUSTEE_FORM; stdcall;
  312. {$EXTERNALSYM GetTrusteeForm}
  313. function GetMultipleTrusteeOperationA(pTrustee: PTRUSTEE_A): MULTIPLE_TRUSTEE_OPERATION; stdcall;
  314. {$EXTERNALSYM GetMultipleTrusteeOperationA}
  315. function GetMultipleTrusteeOperationW(pTrustee: PTRUSTEE_W): MULTIPLE_TRUSTEE_OPERATION; stdcall;
  316. {$EXTERNALSYM GetMultipleTrusteeOperationW}
  317. function GetMultipleTrusteeOperation(pTrustee: PTRUSTEE): MULTIPLE_TRUSTEE_OPERATION; stdcall;
  318. {$EXTERNALSYM GetMultipleTrusteeOperation}
  319. function GetMultipleTrusteeA(pTrustee: PTRUSTEE_A): PTRUSTEE_A; stdcall;
  320. {$EXTERNALSYM GetMultipleTrusteeA}
  321. function GetMultipleTrusteeW(pTrustee: PTRUSTEE_W): PTRUSTEE_W; stdcall;
  322. {$EXTERNALSYM GetMultipleTrusteeW}
  323. function GetMultipleTrustee(pTrustee: PTRUSTEE): PTRUSTEE; stdcall;
  324. {$EXTERNALSYM GetMultipleTrustee}
  325. {$ENDIF JWA_IMPLEMENTATIONSECTION}
  326. {$IFNDEF JWA_OMIT_SECTIONS}
  327. implementation
  328. //uses ...
  329. {$ENDIF JWA_OMIT_SECTIONS}
  330. {$IFNDEF JWA_INTERFACESECTION}
  331. {$IFNDEF JWA_INCLUDEMODE}
  332. const
  333. aclapilib = 'advapi32.dll';
  334. {$IFDEF UNICODE}
  335. AWSuffix = 'W';
  336. {$ELSE}
  337. AWSuffix = 'A';
  338. {$ENDIF UNICODE}
  339. {$ENDIF JWA_INCLUDEMODE}
  340. {$IFDEF DYNAMIC_LINK}
  341. var
  342. _SetEntriesInAclA: Pointer;
  343. function SetEntriesInAclA;
  344. begin
  345. GetProcedureAddress(_SetEntriesInAclA, aclapilib, 'SetEntriesInAclA');
  346. asm
  347. MOV ESP, EBP
  348. POP EBP
  349. JMP [_SetEntriesInAclA]
  350. end;
  351. end;
  352. var
  353. _SetEntriesInAclW: Pointer;
  354. function SetEntriesInAclW;
  355. begin
  356. GetProcedureAddress(_SetEntriesInAclW, aclapilib, 'SetEntriesInAclW');
  357. asm
  358. MOV ESP, EBP
  359. POP EBP
  360. JMP [_SetEntriesInAclW]
  361. end;
  362. end;
  363. var
  364. _SetEntriesInAcl: Pointer;
  365. function SetEntriesInAcl;
  366. begin
  367. GetProcedureAddress(_SetEntriesInAcl, aclapilib, 'SetEntriesInAcl' + AWSuffix);
  368. asm
  369. MOV ESP, EBP
  370. POP EBP
  371. JMP [_SetEntriesInAcl]
  372. end;
  373. end;
  374. var
  375. _GetExplicitEntriesFromAclA: Pointer;
  376. function GetExplicitEntriesFromAclA;
  377. begin
  378. GetProcedureAddress(_GetExplicitEntriesFromAclA, aclapilib, 'GetExplicitEntriesFromAclA');
  379. asm
  380. MOV ESP, EBP
  381. POP EBP
  382. JMP [_GetExplicitEntriesFromAclA]
  383. end;
  384. end;
  385. var
  386. _GetExplicitEntriesFromAclW: Pointer;
  387. function GetExplicitEntriesFromAclW;
  388. begin
  389. GetProcedureAddress(_GetExplicitEntriesFromAclW, aclapilib, 'GetExplicitEntriesFromAclW');
  390. asm
  391. MOV ESP, EBP
  392. POP EBP
  393. JMP [_GetExplicitEntriesFromAclW]
  394. end;
  395. end;
  396. var
  397. _GetExplicitEntriesFromAcl: Pointer;
  398. function GetExplicitEntriesFromAcl;
  399. begin
  400. GetProcedureAddress(_GetExplicitEntriesFromAcl, aclapilib, 'GetExplicitEntriesFromAcl' + AWSuffix);
  401. asm
  402. MOV ESP, EBP
  403. POP EBP
  404. JMP [_GetExplicitEntriesFromAcl]
  405. end;
  406. end;
  407. var
  408. _GetEffectiveRightsFromAclA: Pointer;
  409. function GetEffectiveRightsFromAclA;
  410. begin
  411. GetProcedureAddress(_GetEffectiveRightsFromAclA, aclapilib, 'GetEffectiveRightsFromAclA');
  412. asm
  413. MOV ESP, EBP
  414. POP EBP
  415. JMP [_GetEffectiveRightsFromAclA]
  416. end;
  417. end;
  418. var
  419. _GetEffectiveRightsFromAclW: Pointer;
  420. function GetEffectiveRightsFromAclW;
  421. begin
  422. GetProcedureAddress(_GetEffectiveRightsFromAclW, aclapilib, 'GetEffectiveRightsFromAclW');
  423. asm
  424. MOV ESP, EBP
  425. POP EBP
  426. JMP [_GetEffectiveRightsFromAclW]
  427. end;
  428. end;
  429. var
  430. _GetEffectiveRightsFromAcl: Pointer;
  431. function GetEffectiveRightsFromAcl;
  432. begin
  433. GetProcedureAddress(_GetEffectiveRightsFromAcl, aclapilib, 'GetEffectiveRightsFromAcl' + AWSuffix);
  434. asm
  435. MOV ESP, EBP
  436. POP EBP
  437. JMP [_GetEffectiveRightsFromAcl]
  438. end;
  439. end;
  440. var
  441. _GetAuditedPermissionsFromAclA: Pointer;
  442. function GetAuditedPermissionsFromAclA;
  443. begin
  444. GetProcedureAddress(_GetAuditedPermissionsFromAclA, aclapilib, 'GetAuditedPermissionsFromAclA');
  445. asm
  446. MOV ESP, EBP
  447. POP EBP
  448. JMP [_GetAuditedPermissionsFromAclA]
  449. end;
  450. end;
  451. var
  452. _GetAuditedPermissionsFromAclW: Pointer;
  453. function GetAuditedPermissionsFromAclW;
  454. begin
  455. GetProcedureAddress(_GetAuditedPermissionsFromAclW, aclapilib, 'GetAuditedPermissionsFromAclW');
  456. asm
  457. MOV ESP, EBP
  458. POP EBP
  459. JMP [_GetAuditedPermissionsFromAclW]
  460. end;
  461. end;
  462. var
  463. _GetAuditedPermissionsFromAcl: Pointer;
  464. function GetAuditedPermissionsFromAcl;
  465. begin
  466. GetProcedureAddress(_GetAuditedPermissionsFromAcl, aclapilib, 'GetAuditedPermissionsFromAcl' + AWSuffix);
  467. asm
  468. MOV ESP, EBP
  469. POP EBP
  470. JMP [_GetAuditedPermissionsFromAcl]
  471. end;
  472. end;
  473. var
  474. _GetNamedSecurityInfoA: Pointer;
  475. function GetNamedSecurityInfoA;
  476. begin
  477. GetProcedureAddress(_GetNamedSecurityInfoA, aclapilib, 'GetNamedSecurityInfoA');
  478. asm
  479. MOV ESP, EBP
  480. POP EBP
  481. JMP [_GetNamedSecurityInfoA]
  482. end;
  483. end;
  484. var
  485. _GetNamedSecurityInfoW: Pointer;
  486. function GetNamedSecurityInfoW;
  487. begin
  488. GetProcedureAddress(_GetNamedSecurityInfoW, aclapilib, 'GetNamedSecurityInfoW');
  489. asm
  490. MOV ESP, EBP
  491. POP EBP
  492. JMP [_GetNamedSecurityInfoW]
  493. end;
  494. end;
  495. var
  496. _GetNamedSecurityInfo: Pointer;
  497. function GetNamedSecurityInfo;
  498. begin
  499. GetProcedureAddress(_GetNamedSecurityInfo, aclapilib, 'GetNamedSecurityInfo' + AWSuffix);
  500. asm
  501. MOV ESP, EBP
  502. POP EBP
  503. JMP [_GetNamedSecurityInfo]
  504. end;
  505. end;
  506. var
  507. _GetSecurityInfo: Pointer;
  508. function GetSecurityInfo;
  509. begin
  510. GetProcedureAddress(_GetSecurityInfo, aclapilib, 'GetSecurityInfo');
  511. asm
  512. MOV ESP, EBP
  513. POP EBP
  514. JMP [_GetSecurityInfo]
  515. end;
  516. end;
  517. var
  518. _SetNamedSecurityInfoA: Pointer;
  519. function SetNamedSecurityInfoA;
  520. begin
  521. GetProcedureAddress(_SetNamedSecurityInfoA, aclapilib, 'SetNamedSecurityInfoA');
  522. asm
  523. MOV ESP, EBP
  524. POP EBP
  525. JMP [_SetNamedSecurityInfoA]
  526. end;
  527. end;
  528. var
  529. _SetNamedSecurityInfoW: Pointer;
  530. function SetNamedSecurityInfoW;
  531. begin
  532. GetProcedureAddress(_SetNamedSecurityInfoW, aclapilib, 'SetNamedSecurityInfoW');
  533. asm
  534. MOV ESP, EBP
  535. POP EBP
  536. JMP [_SetNamedSecurityInfoW]
  537. end;
  538. end;
  539. var
  540. _SetNamedSecurityInfo: Pointer;
  541. function SetNamedSecurityInfo;
  542. begin
  543. GetProcedureAddress(_SetNamedSecurityInfo, aclapilib, 'SetNamedSecurityInfo' + AWSuffix);
  544. asm
  545. MOV ESP, EBP
  546. POP EBP
  547. JMP [_SetNamedSecurityInfo]
  548. end;
  549. end;
  550. var
  551. _SetSecurityInfo: Pointer;
  552. function SetSecurityInfo;
  553. begin
  554. GetProcedureAddress(_SetSecurityInfo, aclapilib, 'SetSecurityInfo');
  555. asm
  556. MOV ESP, EBP
  557. POP EBP
  558. JMP [_SetSecurityInfo]
  559. end;
  560. end;
  561. var
  562. _GetInheritanceSourceA: Pointer;
  563. function GetInheritanceSourceA;
  564. begin
  565. GetProcedureAddress(_GetInheritanceSourceA, aclapilib, 'GetInheritanceSourceA');
  566. asm
  567. MOV ESP, EBP
  568. POP EBP
  569. JMP [_GetInheritanceSourceA]
  570. end;
  571. end;
  572. var
  573. _GetInheritanceSourceW: Pointer;
  574. function GetInheritanceSourceW;
  575. begin
  576. GetProcedureAddress(_GetInheritanceSourceW, aclapilib, 'GetInheritanceSourceW');
  577. asm
  578. MOV ESP, EBP
  579. POP EBP
  580. JMP [_GetInheritanceSourceW]
  581. end;
  582. end;
  583. var
  584. _GetInheritanceSource: Pointer;
  585. function GetInheritanceSource;
  586. begin
  587. GetProcedureAddress(_GetInheritanceSource, aclapilib, 'GetInheritanceSource' + AWSuffix);
  588. asm
  589. MOV ESP, EBP
  590. POP EBP
  591. JMP [_GetInheritanceSource]
  592. end;
  593. end;
  594. var
  595. _FreeInheritedFromArray: Pointer;
  596. function FreeInheritedFromArray;
  597. begin
  598. GetProcedureAddress(_FreeInheritedFromArray, aclapilib, 'FreeInheritedFromArray');
  599. asm
  600. MOV ESP, EBP
  601. POP EBP
  602. JMP [_FreeInheritedFromArray]
  603. end;
  604. end;
  605. var
  606. _TreeResetNamedSecurityInfoA: Pointer;
  607. function TreeResetNamedSecurityInfoA;
  608. begin
  609. GetProcedureAddress(_TreeResetNamedSecurityInfoA, aclapilib, 'TreeResetNamedSecurityInfoA');
  610. asm
  611. MOV ESP, EBP
  612. POP EBP
  613. JMP [_TreeResetNamedSecurityInfoA]
  614. end;
  615. end;
  616. var
  617. _TreeResetNamedSecurityInfoW: Pointer;
  618. function TreeResetNamedSecurityInfoW;
  619. begin
  620. GetProcedureAddress(_TreeResetNamedSecurityInfoW, aclapilib, 'TreeResetNamedSecurityInfoW');
  621. asm
  622. MOV ESP, EBP
  623. POP EBP
  624. JMP [_TreeResetNamedSecurityInfoW]
  625. end;
  626. end;
  627. var
  628. _TreeResetNamedSecurityInfo: Pointer;
  629. function TreeResetNamedSecurityInfo;
  630. begin
  631. GetProcedureAddress(_TreeResetNamedSecurityInfo, aclapilib, 'TreeResetNamedSecurityInfo' + AWSuffix);
  632. asm
  633. MOV ESP, EBP
  634. POP EBP
  635. JMP [_TreeResetNamedSecurityInfo]
  636. end;
  637. end;
  638. var
  639. _BuildSecurityDescriptorA: Pointer;
  640. function BuildSecurityDescriptorA;
  641. begin
  642. GetProcedureAddress(_BuildSecurityDescriptorA, aclapilib, 'BuildSecurityDescriptorA');
  643. asm
  644. MOV ESP, EBP
  645. POP EBP
  646. JMP [_BuildSecurityDescriptorA]
  647. end;
  648. end;
  649. var
  650. _BuildSecurityDescriptorW: Pointer;
  651. function BuildSecurityDescriptorW;
  652. begin
  653. GetProcedureAddress(_BuildSecurityDescriptorW, aclapilib, 'BuildSecurityDescriptorW');
  654. asm
  655. MOV ESP, EBP
  656. POP EBP
  657. JMP [_BuildSecurityDescriptorW]
  658. end;
  659. end;
  660. var
  661. _BuildSecurityDescriptor: Pointer;
  662. function BuildSecurityDescriptor;
  663. begin
  664. GetProcedureAddress(_BuildSecurityDescriptor, aclapilib, 'BuildSecurityDescriptor' + AWSuffix);
  665. asm
  666. MOV ESP, EBP
  667. POP EBP
  668. JMP [_BuildSecurityDescriptor]
  669. end;
  670. end;
  671. var
  672. _LookupSecurityDescriptorPartsA: Pointer;
  673. function LookupSecurityDescriptorPartsA;
  674. begin
  675. GetProcedureAddress(_LookupSecurityDescriptorPartsA, aclapilib, 'LookupSecurityDescriptorPartsA');
  676. asm
  677. MOV ESP, EBP
  678. POP EBP
  679. JMP [_LookupSecurityDescriptorPartsA]
  680. end;
  681. end;
  682. var
  683. _LookupSecurityDescriptorPartsW: Pointer;
  684. function LookupSecurityDescriptorPartsW;
  685. begin
  686. GetProcedureAddress(_LookupSecurityDescriptorPartsW, aclapilib, 'LookupSecurityDescriptorPartsW');
  687. asm
  688. MOV ESP, EBP
  689. POP EBP
  690. JMP [_LookupSecurityDescriptorPartsW]
  691. end;
  692. end;
  693. var
  694. _LookupSecurityDescriptorParts: Pointer;
  695. function LookupSecurityDescriptorParts;
  696. begin
  697. GetProcedureAddress(_LookupSecurityDescriptorParts, aclapilib, 'LookupSecurityDescriptorParts' + AWSuffix);
  698. asm
  699. MOV ESP, EBP
  700. POP EBP
  701. JMP [_LookupSecurityDescriptorParts]
  702. end;
  703. end;
  704. var
  705. _BuildExplicitAccessWithNameA: Pointer;
  706. procedure BuildExplicitAccessWithNameA;
  707. begin
  708. GetProcedureAddress(_BuildExplicitAccessWithNameA, aclapilib, 'BuildExplicitAccessWithNameA');
  709. asm
  710. MOV ESP, EBP
  711. POP EBP
  712. JMP [_BuildExplicitAccessWithNameA]
  713. end;
  714. end;
  715. var
  716. _BuildExplicitAccessWithNameW: Pointer;
  717. procedure BuildExplicitAccessWithNameW;
  718. begin
  719. GetProcedureAddress(_BuildExplicitAccessWithNameW, aclapilib, 'BuildExplicitAccessWithNameW');
  720. asm
  721. MOV ESP, EBP
  722. POP EBP
  723. JMP [_BuildExplicitAccessWithNameW]
  724. end;
  725. end;
  726. var
  727. _BuildExplicitAccessWithName: Pointer;
  728. procedure BuildExplicitAccessWithName;
  729. begin
  730. GetProcedureAddress(_BuildExplicitAccessWithName, aclapilib, 'BuildExplicitAccessWithName' + AWSuffix);
  731. asm
  732. MOV ESP, EBP
  733. POP EBP
  734. JMP [_BuildExplicitAccessWithName]
  735. end;
  736. end;
  737. var
  738. _BuildImpersonateExplAccWNA: Pointer;
  739. procedure BuildImpersonateExplicitAccessWithNameA;
  740. begin
  741. GetProcedureAddress(_BuildImpersonateExplAccWNA, aclapilib, 'BuildImpersonateExplicitAccessWithNameA');
  742. asm
  743. MOV ESP, EBP
  744. POP EBP
  745. JMP [_BuildImpersonateExplAccWNA]
  746. end;
  747. end;
  748. var
  749. _BuildImpersonateExplAccWNW: Pointer;
  750. procedure BuildImpersonateExplicitAccessWithNameW;
  751. begin
  752. GetProcedureAddress(_BuildImpersonateExplAccWNW, aclapilib, 'BuildImpersonateExplicitAccessWithNameW');
  753. asm
  754. MOV ESP, EBP
  755. POP EBP
  756. JMP [_BuildImpersonateExplAccWNW]
  757. end;
  758. end;
  759. var
  760. _BuildImpersonateExplAccWN: Pointer;
  761. procedure BuildImpersonateExplicitAccessWithName;
  762. begin
  763. GetProcedureAddress(_BuildImpersonateExplAccWN, aclapilib, 'BuildImpersonateExplicitAccessWithName' + AWSuffix);
  764. asm
  765. MOV ESP, EBP
  766. POP EBP
  767. JMP [_BuildImpersonateExplAccWN]
  768. end;
  769. end;
  770. var
  771. _BuildTrusteeWithNameA: Pointer;
  772. procedure BuildTrusteeWithNameA;
  773. begin
  774. GetProcedureAddress(_BuildTrusteeWithNameA, aclapilib, 'BuildTrusteeWithNameA');
  775. asm
  776. MOV ESP, EBP
  777. POP EBP
  778. JMP [_BuildTrusteeWithNameA]
  779. end;
  780. end;
  781. var
  782. _BuildTrusteeWithNameW: Pointer;
  783. procedure BuildTrusteeWithNameW;
  784. begin
  785. GetProcedureAddress(_BuildTrusteeWithNameW, aclapilib, 'BuildTrusteeWithNameW');
  786. asm
  787. MOV ESP, EBP
  788. POP EBP
  789. JMP [_BuildTrusteeWithNameW]
  790. end;
  791. end;
  792. var
  793. _BuildTrusteeWithName: Pointer;
  794. procedure BuildTrusteeWithName;
  795. begin
  796. GetProcedureAddress(_BuildTrusteeWithName, aclapilib, 'BuildTrusteeWithName' + AWSuffix);
  797. asm
  798. MOV ESP, EBP
  799. POP EBP
  800. JMP [_BuildTrusteeWithName]
  801. end;
  802. end;
  803. var
  804. _BuildImpersonateTrusteeA: Pointer;
  805. procedure BuildImpersonateTrusteeA;
  806. begin
  807. GetProcedureAddress(_BuildImpersonateTrusteeA, aclapilib, 'BuildImpersonateTrusteeA');
  808. asm
  809. MOV ESP, EBP
  810. POP EBP
  811. JMP [_BuildImpersonateTrusteeA]
  812. end;
  813. end;
  814. var
  815. _BuildImpersonateTrusteeW: Pointer;
  816. procedure BuildImpersonateTrusteeW;
  817. begin
  818. GetProcedureAddress(_BuildImpersonateTrusteeW, aclapilib, 'BuildImpersonateTrusteeW');
  819. asm
  820. MOV ESP, EBP
  821. POP EBP
  822. JMP [_BuildImpersonateTrusteeW]
  823. end;
  824. end;
  825. var
  826. _BuildImpersonateTrustee: Pointer;
  827. procedure BuildImpersonateTrustee;
  828. begin
  829. GetProcedureAddress(_BuildImpersonateTrustee, aclapilib, 'BuildImpersonateTrustee' + AWSuffix);
  830. asm
  831. MOV ESP, EBP
  832. POP EBP
  833. JMP [_BuildImpersonateTrustee]
  834. end;
  835. end;
  836. var
  837. _BuildTrusteeWithSidA: Pointer;
  838. procedure BuildTrusteeWithSidA;
  839. begin
  840. GetProcedureAddress(_BuildTrusteeWithSidA, aclapilib, 'BuildTrusteeWithSidA');
  841. asm
  842. MOV ESP, EBP
  843. POP EBP
  844. JMP [_BuildTrusteeWithSidA]
  845. end;
  846. end;
  847. var
  848. _BuildTrusteeWithSidW: Pointer;
  849. procedure BuildTrusteeWithSidW;
  850. begin
  851. GetProcedureAddress(_BuildTrusteeWithSidW, aclapilib, 'BuildTrusteeWithSidW');
  852. asm
  853. MOV ESP, EBP
  854. POP EBP
  855. JMP [_BuildTrusteeWithSidW]
  856. end;
  857. end;
  858. var
  859. _BuildTrusteeWithSid: Pointer;
  860. procedure BuildTrusteeWithSid;
  861. begin
  862. GetProcedureAddress(_BuildTrusteeWithSid, aclapilib, 'BuildTrusteeWithSid' + AWSuffix);
  863. asm
  864. MOV ESP, EBP
  865. POP EBP
  866. JMP [_BuildTrusteeWithSid]
  867. end;
  868. end;
  869. var
  870. _BuildTrusteeWithObjectsAndSidA: Pointer;
  871. procedure BuildTrusteeWithObjectsAndSidA;
  872. begin
  873. GetProcedureAddress(_BuildTrusteeWithObjectsAndSidA, aclapilib, 'BuildTrusteeWithObjectsAndSidA');
  874. asm
  875. MOV ESP, EBP
  876. POP EBP
  877. JMP [_BuildTrusteeWithObjectsAndSidA]
  878. end;
  879. end;
  880. var
  881. _BuildTrusteeWithObjectsAndSidW: Pointer;
  882. procedure BuildTrusteeWithObjectsAndSidW;
  883. begin
  884. GetProcedureAddress(_BuildTrusteeWithObjectsAndSidW, aclapilib, 'BuildTrusteeWithObjectsAndSidW');
  885. asm
  886. MOV ESP, EBP
  887. POP EBP
  888. JMP [_BuildTrusteeWithObjectsAndSidW]
  889. end;
  890. end;
  891. var
  892. _BuildTrusteeWithObjectsAndSid: Pointer;
  893. procedure BuildTrusteeWithObjectsAndSid;
  894. begin
  895. GetProcedureAddress(_BuildTrusteeWithObjectsAndSid, aclapilib, 'BuildTrusteeWithObjectsAndSid' + AWSuffix);
  896. asm
  897. MOV ESP, EBP
  898. POP EBP
  899. JMP [_BuildTrusteeWithObjectsAndSid]
  900. end;
  901. end;
  902. var
  903. _BuildTrusteeWithObjectsAndNameA: Pointer;
  904. procedure BuildTrusteeWithObjectsAndNameA;
  905. begin
  906. GetProcedureAddress(_BuildTrusteeWithObjectsAndNameA, aclapilib, 'BuildTrusteeWithObjectsAndNameA');
  907. asm
  908. MOV ESP, EBP
  909. POP EBP
  910. JMP [_BuildTrusteeWithObjectsAndNameA]
  911. end;
  912. end;
  913. var
  914. _BuildTrusteeWithObjectsAndNameW: Pointer;
  915. procedure BuildTrusteeWithObjectsAndNameW;
  916. begin
  917. GetProcedureAddress(_BuildTrusteeWithObjectsAndNameW, aclapilib, 'BuildTrusteeWithObjectsAndNameW');
  918. asm
  919. MOV ESP, EBP
  920. POP EBP
  921. JMP [_BuildTrusteeWithObjectsAndNameW]
  922. end;
  923. end;
  924. var
  925. _BuildTrusteeWithObjectsAndName: Pointer;
  926. procedure BuildTrusteeWithObjectsAndName;
  927. begin
  928. GetProcedureAddress(_BuildTrusteeWithObjectsAndName, aclapilib, 'BuildTrusteeWithObjectsAndName' + AWSuffix);
  929. asm
  930. MOV ESP, EBP
  931. POP EBP
  932. JMP [_BuildTrusteeWithObjectsAndName]
  933. end;
  934. end;
  935. var
  936. _GetTrusteeNameA: Pointer;
  937. function GetTrusteeNameA;
  938. begin
  939. GetProcedureAddress(_GetTrusteeNameA, aclapilib, 'GetTrusteeNameA');
  940. asm
  941. MOV ESP, EBP
  942. POP EBP
  943. JMP [_GetTrusteeNameA]
  944. end;
  945. end;
  946. var
  947. _GetTrusteeNameW: Pointer;
  948. function GetTrusteeNameW;
  949. begin
  950. GetProcedureAddress(_GetTrusteeNameW, aclapilib, 'GetTrusteeNameW');
  951. asm
  952. MOV ESP, EBP
  953. POP EBP
  954. JMP [_GetTrusteeNameW]
  955. end;
  956. end;
  957. var
  958. _GetTrusteeName: Pointer;
  959. function GetTrusteeName;
  960. begin
  961. GetProcedureAddress(_GetTrusteeName, aclapilib, 'GetTrusteeName' + AWSuffix);
  962. asm
  963. MOV ESP, EBP
  964. POP EBP
  965. JMP [_GetTrusteeName]
  966. end;
  967. end;
  968. var
  969. _GetTrusteeTypeA: Pointer;
  970. function GetTrusteeTypeA;
  971. begin
  972. GetProcedureAddress(_GetTrusteeTypeA, aclapilib, 'GetTrusteeTypeA');
  973. asm
  974. MOV ESP, EBP
  975. POP EBP
  976. JMP [_GetTrusteeTypeA]
  977. end;
  978. end;
  979. var
  980. _GetTrusteeTypeW: Pointer;
  981. function GetTrusteeTypeW;
  982. begin
  983. GetProcedureAddress(_GetTrusteeTypeW, aclapilib, 'GetTrusteeTypeW');
  984. asm
  985. MOV ESP, EBP
  986. POP EBP
  987. JMP [_GetTrusteeTypeW]
  988. end;
  989. end;
  990. var
  991. _GetTrusteeType: Pointer;
  992. function GetTrusteeType;
  993. begin
  994. GetProcedureAddress(_GetTrusteeType, aclapilib, 'GetTrusteeType' + AWSuffix);
  995. asm
  996. MOV ESP, EBP
  997. POP EBP
  998. JMP [_GetTrusteeType]
  999. end;
  1000. end;
  1001. var
  1002. _GetTrusteeFormA: Pointer;
  1003. function GetTrusteeFormA;
  1004. begin
  1005. GetProcedureAddress(_GetTrusteeFormA, aclapilib, 'GetTrusteeFormA');
  1006. asm
  1007. MOV ESP, EBP
  1008. POP EBP
  1009. JMP [_GetTrusteeFormA]
  1010. end;
  1011. end;
  1012. var
  1013. _GetTrusteeFormW: Pointer;
  1014. function GetTrusteeFormW;
  1015. begin
  1016. GetProcedureAddress(_GetTrusteeFormW, aclapilib, 'GetTrusteeFormW');
  1017. asm
  1018. MOV ESP, EBP
  1019. POP EBP
  1020. JMP [_GetTrusteeFormW]
  1021. end;
  1022. end;
  1023. var
  1024. _GetTrusteeForm: Pointer;
  1025. function GetTrusteeForm;
  1026. begin
  1027. GetProcedureAddress(_GetTrusteeForm, aclapilib, 'GetTrusteeForm' + AWSuffix);
  1028. asm
  1029. MOV ESP, EBP
  1030. POP EBP
  1031. JMP [_GetTrusteeForm]
  1032. end;
  1033. end;
  1034. var
  1035. _GetMultipleTrusteeOperationA: Pointer;
  1036. function GetMultipleTrusteeOperationA;
  1037. begin
  1038. GetProcedureAddress(_GetMultipleTrusteeOperationA, aclapilib, 'GetMultipleTrusteeOperationA');
  1039. asm
  1040. MOV ESP, EBP
  1041. POP EBP
  1042. JMP [_GetMultipleTrusteeOperationA]
  1043. end;
  1044. end;
  1045. var
  1046. _GetMultipleTrusteeOperationW: Pointer;
  1047. function GetMultipleTrusteeOperationW;
  1048. begin
  1049. GetProcedureAddress(_GetMultipleTrusteeOperationW, aclapilib, 'GetMultipleTrusteeOperationW');
  1050. asm
  1051. MOV ESP, EBP
  1052. POP EBP
  1053. JMP [_GetMultipleTrusteeOperationW]
  1054. end;
  1055. end;
  1056. var
  1057. _GetMultipleTrusteeOperation: Pointer;
  1058. function GetMultipleTrusteeOperation;
  1059. begin
  1060. GetProcedureAddress(_GetMultipleTrusteeOperation, aclapilib, 'GetMultipleTrusteeOperation' + AWSuffix);
  1061. asm
  1062. MOV ESP, EBP
  1063. POP EBP
  1064. JMP [_GetMultipleTrusteeOperation]
  1065. end;
  1066. end;
  1067. var
  1068. _GetMultipleTrusteeA: Pointer;
  1069. function GetMultipleTrusteeA;
  1070. begin
  1071. GetProcedureAddress(_GetMultipleTrusteeA, aclapilib, 'GetMultipleTrusteeA');
  1072. asm
  1073. MOV ESP, EBP
  1074. POP EBP
  1075. JMP [_GetMultipleTrusteeA]
  1076. end;
  1077. end;
  1078. var
  1079. _GetMultipleTrusteeW: Pointer;
  1080. function GetMultipleTrusteeW;
  1081. begin
  1082. GetProcedureAddress(_GetMultipleTrusteeW, aclapilib, 'GetMultipleTrusteeW');
  1083. asm
  1084. MOV ESP, EBP
  1085. POP EBP
  1086. JMP [_GetMultipleTrusteeW]
  1087. end;
  1088. end;
  1089. var
  1090. _GetMultipleTrustee: Pointer;
  1091. function GetMultipleTrustee;
  1092. begin
  1093. GetProcedureAddress(_GetMultipleTrustee, aclapilib, 'GetMultipleTrustee' + AWSuffix);
  1094. asm
  1095. MOV ESP, EBP
  1096. POP EBP
  1097. JMP [_GetMultipleTrustee]
  1098. end;
  1099. end;
  1100. {$ELSE}
  1101. function SetEntriesInAclA; external aclapilib name 'SetEntriesInAclA';
  1102. function SetEntriesInAclW; external aclapilib name 'SetEntriesInAclW';
  1103. function SetEntriesInAcl; external aclapilib name 'SetEntriesInAcl' + AWSuffix;
  1104. function GetExplicitEntriesFromAclA; external aclapilib name 'GetExplicitEntriesFromAclA';
  1105. function GetExplicitEntriesFromAclW; external aclapilib name 'GetExplicitEntriesFromAclW';
  1106. function GetExplicitEntriesFromAcl; external aclapilib name 'GetExplicitEntriesFromAcl' + AWSuffix;
  1107. function GetEffectiveRightsFromAclA; external aclapilib name 'GetEffectiveRightsFromAclA';
  1108. function GetEffectiveRightsFromAclW; external aclapilib name 'GetEffectiveRightsFromAclW';
  1109. function GetEffectiveRightsFromAcl; external aclapilib name 'GetEffectiveRightsFromAcl' + AWSuffix;
  1110. function GetAuditedPermissionsFromAclA; external aclapilib name 'GetAuditedPermissionsFromAclA';
  1111. function GetAuditedPermissionsFromAclW; external aclapilib name 'GetAuditedPermissionsFromAclW';
  1112. function GetAuditedPermissionsFromAcl; external aclapilib name 'GetAuditedPermissionsFromAcl' + AWSuffix;
  1113. function GetNamedSecurityInfoA; external aclapilib name 'GetNamedSecurityInfoA';
  1114. function GetNamedSecurityInfoW; external aclapilib name 'GetNamedSecurityInfoW';
  1115. function GetNamedSecurityInfo; external aclapilib name 'GetNamedSecurityInfo' + AWSuffix;
  1116. function GetSecurityInfo; external aclapilib name 'GetSecurityInfo';
  1117. function SetNamedSecurityInfoA; external aclapilib name 'SetNamedSecurityInfoA';
  1118. function SetNamedSecurityInfoW; external aclapilib name 'SetNamedSecurityInfoW';
  1119. function SetNamedSecurityInfo; external aclapilib name 'SetNamedSecurityInfo' + AWSuffix;
  1120. function SetSecurityInfo; external aclapilib name 'SetSecurityInfo';
  1121. function GetInheritanceSourceA; external aclapilib name 'GetInheritanceSourceA';
  1122. function GetInheritanceSourceW; external aclapilib name 'GetInheritanceSourceW';
  1123. function GetInheritanceSource; external aclapilib name 'GetInheritanceSource' + AWSuffix;
  1124. function FreeInheritedFromArray; external aclapilib name 'FreeInheritedFromArray';
  1125. function TreeResetNamedSecurityInfoA; external aclapilib name 'TreeResetNamedSecurityInfoA';
  1126. function TreeResetNamedSecurityInfoW; external aclapilib name 'TreeResetNamedSecurityInfoW';
  1127. function TreeResetNamedSecurityInfo; external aclapilib name 'TreeResetNamedSecurityInfo' + AWSuffix;
  1128. function BuildSecurityDescriptorA; external aclapilib name 'BuildSecurityDescriptorA';
  1129. function BuildSecurityDescriptorW; external aclapilib name 'BuildSecurityDescriptorW';
  1130. function BuildSecurityDescriptor; external aclapilib name 'BuildSecurityDescriptor' + AWSuffix;
  1131. function LookupSecurityDescriptorPartsA; external aclapilib name 'LookupSecurityDescriptorPartsA';
  1132. function LookupSecurityDescriptorPartsW; external aclapilib name 'LookupSecurityDescriptorPartsW';
  1133. function LookupSecurityDescriptorParts; external aclapilib name 'LookupSecurityDescriptorParts' + AWSuffix;
  1134. procedure BuildExplicitAccessWithNameA; external aclapilib name 'BuildExplicitAccessWithNameA';
  1135. procedure BuildExplicitAccessWithNameW; external aclapilib name 'BuildExplicitAccessWithNameW';
  1136. procedure BuildExplicitAccessWithName; external aclapilib name 'BuildExplicitAccessWithName' + AWSuffix;
  1137. procedure BuildImpersonateExplicitAccessWithNameA; external aclapilib name 'BuildImpersonateExplicitAccessWithNameA';
  1138. procedure BuildImpersonateExplicitAccessWithNameW; external aclapilib name 'BuildImpersonateExplicitAccessWithNameW';
  1139. procedure BuildImpersonateExplicitAccessWithName; external aclapilib name 'BuildImpersonateExplicitAccessWithName' + AWSuffix;
  1140. procedure BuildTrusteeWithNameA; external aclapilib name 'BuildTrusteeWithNameA';
  1141. procedure BuildTrusteeWithNameW; external aclapilib name 'BuildTrusteeWithNameW';
  1142. procedure BuildTrusteeWithName; external aclapilib name 'BuildTrusteeWithName' + AWSuffix;
  1143. procedure BuildImpersonateTrusteeA; external aclapilib name 'BuildImpersonateTrusteeA';
  1144. procedure BuildImpersonateTrusteeW; external aclapilib name 'BuildImpersonateTrusteeW';
  1145. procedure BuildImpersonateTrustee; external aclapilib name 'BuildImpersonateTrustee' + AWSuffix;
  1146. procedure BuildTrusteeWithSidA; external aclapilib name 'BuildTrusteeWithSidA';
  1147. procedure BuildTrusteeWithSidW; external aclapilib name 'BuildTrusteeWithSidW';
  1148. procedure BuildTrusteeWithSid; external aclapilib name 'BuildTrusteeWithSid' + AWSuffix;
  1149. procedure BuildTrusteeWithObjectsAndSidA; external aclapilib name 'BuildTrusteeWithObjectsAndSidA';
  1150. procedure BuildTrusteeWithObjectsAndSidW; external aclapilib name 'BuildTrusteeWithObjectsAndSidW';
  1151. procedure BuildTrusteeWithObjectsAndSid; external aclapilib name 'BuildTrusteeWithObjectsAndSid' + AWSuffix;
  1152. procedure BuildTrusteeWithObjectsAndNameA; external aclapilib name 'BuildTrusteeWithObjectsAndNameA';
  1153. procedure BuildTrusteeWithObjectsAndNameW; external aclapilib name 'BuildTrusteeWithObjectsAndNameW';
  1154. procedure BuildTrusteeWithObjectsAndName; external aclapilib name 'BuildTrusteeWithObjectsAndName' + AWSuffix;
  1155. function GetTrusteeNameA; external aclapilib name 'GetTrusteeNameA';
  1156. function GetTrusteeNameW; external aclapilib name 'GetTrusteeNameW';
  1157. function GetTrusteeName; external aclapilib name 'GetTrusteeName' + AWSuffix;
  1158. function GetTrusteeTypeA; external aclapilib name 'GetTrusteeTypeA';
  1159. function GetTrusteeTypeW; external aclapilib name 'GetTrusteeTypeW';
  1160. function GetTrusteeType; external aclapilib name 'GetTrusteeType' + AWSuffix;
  1161. function GetTrusteeFormA; external aclapilib name 'GetTrusteeFormA';
  1162. function GetTrusteeFormW; external aclapilib name 'GetTrusteeFormW';
  1163. function GetTrusteeForm; external aclapilib name 'GetTrusteeForm' + AWSuffix;
  1164. function GetMultipleTrusteeOperationA; external aclapilib name 'GetMultipleTrusteeOperationA';
  1165. function GetMultipleTrusteeOperationW; external aclapilib name 'GetMultipleTrusteeOperationW';
  1166. function GetMultipleTrusteeOperation; external aclapilib name 'GetMultipleTrusteeOperation' + AWSuffix;
  1167. function GetMultipleTrusteeA; external aclapilib name 'GetMultipleTrusteeA';
  1168. function GetMultipleTrusteeW; external aclapilib name 'GetMultipleTrusteeW';
  1169. function GetMultipleTrustee; external aclapilib name 'GetMultipleTrustee' + AWSuffix;
  1170. {$ENDIF DYNAMIC_LINK}
  1171. {$ENDIF JWA_INTERFACESECTION}
  1172. {$IFNDEF JWA_OMIT_SECTIONS}
  1173. end.
  1174. {$ENDIF JWA_OMIT_SECTIONS}