jwaaclapi.pas 44 KB

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