jwasddl.pas 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. {******************************************************************************}
  2. { }
  3. { Security Descriptor Definition Language 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: sddl.h, released June 2000. The original Pascal }
  9. { code is: Sddl.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: JwaSddl.pas,v 1.9 2005/09/06 16:36:50 marquardt Exp $
  43. unit JwaSddl;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "sddl.h"'}
  47. {$HPPEMIT ''}
  48. {$I jediapilib.inc}
  49. interface
  50. uses
  51. JwaWindows;
  52. //
  53. // SDDL Version information
  54. //
  55. const
  56. SDDL_REVISION_1 = 1;
  57. {$EXTERNALSYM SDDL_REVISION_1}
  58. SDDL_REVISION = SDDL_REVISION_1;
  59. {$EXTERNALSYM SDDL_REVISION}
  60. //
  61. // SDDL Component tags
  62. //
  63. SDDL_OWNER = 'O'; // Owner tag
  64. {$EXTERNALSYM SDDL_OWNER}
  65. SDDL_GROUP = 'G'; // Group tag
  66. {$EXTERNALSYM SDDL_GROUP}
  67. SDDL_DACL = 'D'; // DACL tag
  68. {$EXTERNALSYM SDDL_DACL}
  69. SDDL_SACL = 'S'; // SACL tag
  70. {$EXTERNALSYM SDDL_SACL}
  71. //
  72. // SDDL Security descriptor controls
  73. //
  74. SDDL_PROTECTED = 'P'; // DACL or SACL Protected
  75. {$EXTERNALSYM SDDL_PROTECTED}
  76. SDDL_AUTO_INHERIT_REQ = 'AR'; // Auto inherit request
  77. {$EXTERNALSYM SDDL_AUTO_INHERIT_REQ}
  78. SDDL_AUTO_INHERITED = 'AI'; // DACL/SACL are auto inherited
  79. {$EXTERNALSYM SDDL_AUTO_INHERITED}
  80. //
  81. // SDDL Ace types
  82. //
  83. SDDL_ACCESS_ALLOWED = 'A'; // Access allowed
  84. {$EXTERNALSYM SDDL_ACCESS_ALLOWED}
  85. SDDL_ACCESS_DENIED = 'D'; // Access denied
  86. {$EXTERNALSYM SDDL_ACCESS_DENIED}
  87. SDDL_OBJECT_ACCESS_ALLOWED = 'OA'; // Object access allowed
  88. {$EXTERNALSYM SDDL_OBJECT_ACCESS_ALLOWED}
  89. SDDL_OBJECT_ACCESS_DENIED = 'OD'; // Object access denied
  90. {$EXTERNALSYM SDDL_OBJECT_ACCESS_DENIED}
  91. SDDL_AUDIT = 'AU'; // Audit
  92. {$EXTERNALSYM SDDL_AUDIT}
  93. SDDL_ALARM = 'AL'; // Alarm
  94. {$EXTERNALSYM SDDL_ALARM}
  95. SDDL_OBJECT_AUDIT = 'OU'; // Object audit
  96. {$EXTERNALSYM SDDL_OBJECT_AUDIT}
  97. SDDL_OBJECT_ALARM = 'OL'; // Object alarm
  98. {$EXTERNALSYM SDDL_OBJECT_ALARM}
  99. //
  100. // SDDL Ace flags
  101. //
  102. SDDL_CONTAINER_INHERIT = 'CI'; // Container inherit
  103. {$EXTERNALSYM SDDL_CONTAINER_INHERIT}
  104. SDDL_OBJECT_INHERIT = 'OI'; // Object inherit
  105. {$EXTERNALSYM SDDL_OBJECT_INHERIT}
  106. SDDL_NO_PROPAGATE = 'NP'; // Inherit no propagate
  107. {$EXTERNALSYM SDDL_NO_PROPAGATE}
  108. SDDL_INHERIT_ONLY = 'IO'; // Inherit only
  109. {$EXTERNALSYM SDDL_INHERIT_ONLY}
  110. SDDL_INHERITED = 'ID'; // Inherited
  111. {$EXTERNALSYM SDDL_INHERITED}
  112. SDDL_AUDIT_SUCCESS = 'SA'; // Audit success
  113. {$EXTERNALSYM SDDL_AUDIT_SUCCESS}
  114. SDDL_AUDIT_FAILURE = 'FA'; // Audit failure
  115. {$EXTERNALSYM SDDL_AUDIT_FAILURE}
  116. //
  117. // SDDL Rights
  118. //
  119. SDDL_READ_PROPERTY = 'RP';
  120. {$EXTERNALSYM SDDL_READ_PROPERTY}
  121. SDDL_WRITE_PROPERTY = 'WP';
  122. {$EXTERNALSYM SDDL_WRITE_PROPERTY}
  123. SDDL_CREATE_CHILD = 'CC';
  124. {$EXTERNALSYM SDDL_CREATE_CHILD}
  125. SDDL_DELETE_CHILD = 'DC';
  126. {$EXTERNALSYM SDDL_DELETE_CHILD}
  127. SDDL_LIST_CHILDREN = 'LC';
  128. {$EXTERNALSYM SDDL_LIST_CHILDREN}
  129. SDDL_SELF_WRITE = 'SW';
  130. {$EXTERNALSYM SDDL_SELF_WRITE}
  131. SDDL_LIST_OBJECT = 'LO';
  132. {$EXTERNALSYM SDDL_LIST_OBJECT}
  133. SDDL_DELETE_TREE = 'DT';
  134. {$EXTERNALSYM SDDL_DELETE_TREE}
  135. SDDL_CONTROL_ACCESS = 'CR';
  136. {$EXTERNALSYM SDDL_CONTROL_ACCESS}
  137. SDDL_READ_CONTROL = 'RC';
  138. {$EXTERNALSYM SDDL_READ_CONTROL}
  139. SDDL_WRITE_DAC = 'WD';
  140. {$EXTERNALSYM SDDL_WRITE_DAC}
  141. SDDL_WRITE_OWNER = 'WO';
  142. {$EXTERNALSYM SDDL_WRITE_OWNER}
  143. SDDL_STANDARD_DELETE = 'SD';
  144. {$EXTERNALSYM SDDL_STANDARD_DELETE}
  145. SDDL_GENERIC_ALL = 'GA';
  146. {$EXTERNALSYM SDDL_GENERIC_ALL}
  147. SDDL_GENERIC_READ = 'GR';
  148. {$EXTERNALSYM SDDL_GENERIC_READ}
  149. SDDL_GENERIC_WRITE = 'GW';
  150. {$EXTERNALSYM SDDL_GENERIC_WRITE}
  151. SDDL_GENERIC_EXECUTE = 'GX';
  152. {$EXTERNALSYM SDDL_GENERIC_EXECUTE}
  153. SDDL_FILE_ALL = 'FA';
  154. {$EXTERNALSYM SDDL_FILE_ALL}
  155. SDDL_FILE_READ = 'FR';
  156. {$EXTERNALSYM SDDL_FILE_READ}
  157. SDDL_FILE_WRITE = 'FW';
  158. {$EXTERNALSYM SDDL_FILE_WRITE}
  159. SDDL_FILE_EXECUTE = 'FX';
  160. {$EXTERNALSYM SDDL_FILE_EXECUTE}
  161. SDDL_KEY_ALL = 'KA';
  162. {$EXTERNALSYM SDDL_KEY_ALL}
  163. SDDL_KEY_READ = 'KR';
  164. {$EXTERNALSYM SDDL_KEY_READ}
  165. SDDL_KEY_WRITE = 'KW';
  166. {$EXTERNALSYM SDDL_KEY_WRITE}
  167. SDDL_KEY_EXECUTE = 'KX';
  168. {$EXTERNALSYM SDDL_KEY_EXECUTE}
  169. //
  170. // SDDL User alias max size
  171. // - currently, upto two supported eg. "DA"
  172. // - modify this if more WCHARs need to be there in future e.g. "DAX"
  173. //
  174. SDDL_ALIAS_SIZE = 2;
  175. {$EXTERNALSYM SDDL_ALIAS_SIZE}
  176. //
  177. // SDDL User aliases
  178. //
  179. SDDL_DOMAIN_ADMINISTRATORS = 'DA'; // Domain admins
  180. {$EXTERNALSYM SDDL_DOMAIN_ADMINISTRATORS}
  181. SDDL_DOMAIN_GUESTS = 'DG'; // Domain guests
  182. {$EXTERNALSYM SDDL_DOMAIN_GUESTS}
  183. SDDL_DOMAIN_USERS = 'DU'; // Domain users
  184. {$EXTERNALSYM SDDL_DOMAIN_USERS}
  185. SDDL_ENTERPRISE_DOMAIN_CONTROLLERS = 'ED'; // Enterprise domain controllers
  186. {$EXTERNALSYM SDDL_ENTERPRISE_DOMAIN_CONTROLLERS}
  187. SDDL_DOMAIN_DOMAIN_CONTROLLERS = 'DD'; // Domain domain controllers
  188. {$EXTERNALSYM SDDL_DOMAIN_DOMAIN_CONTROLLERS}
  189. SDDL_DOMAIN_COMPUTERS = 'DC'; // Domain computers
  190. {$EXTERNALSYM SDDL_DOMAIN_COMPUTERS}
  191. SDDL_BUILTIN_ADMINISTRATORS = 'BA'; // Builtin (local ) administrators
  192. {$EXTERNALSYM SDDL_BUILTIN_ADMINISTRATORS}
  193. SDDL_BUILTIN_GUESTS = 'BG'; // Builtin (local ) guests
  194. {$EXTERNALSYM SDDL_BUILTIN_GUESTS}
  195. SDDL_BUILTIN_USERS = 'BU'; // Builtin (local ) users
  196. {$EXTERNALSYM SDDL_BUILTIN_USERS}
  197. SDDL_LOCAL_ADMIN = 'LA'; // Local administrator account
  198. {$EXTERNALSYM SDDL_LOCAL_ADMIN}
  199. SDDL_LOCAL_GUEST = 'LG'; // Local group account
  200. {$EXTERNALSYM SDDL_LOCAL_GUEST}
  201. SDDL_ACCOUNT_OPERATORS = 'AO'; // Account operators
  202. {$EXTERNALSYM SDDL_ACCOUNT_OPERATORS}
  203. SDDL_BACKUP_OPERATORS = 'BO'; // Backup operators
  204. {$EXTERNALSYM SDDL_BACKUP_OPERATORS}
  205. SDDL_PRINTER_OPERATORS = 'PO'; // Printer operators
  206. {$EXTERNALSYM SDDL_PRINTER_OPERATORS}
  207. SDDL_SERVER_OPERATORS = 'SO'; // Server operators
  208. {$EXTERNALSYM SDDL_SERVER_OPERATORS}
  209. SDDL_AUTHENTICATED_USERS = 'AU'; // Authenticated users
  210. {$EXTERNALSYM SDDL_AUTHENTICATED_USERS}
  211. SDDL_PERSONAL_SELF = 'PS'; // Personal self
  212. {$EXTERNALSYM SDDL_PERSONAL_SELF}
  213. SDDL_CREATOR_OWNER = 'CO'; // Creator owner
  214. {$EXTERNALSYM SDDL_CREATOR_OWNER}
  215. SDDL_CREATOR_GROUP = 'CG'; // Creator group
  216. {$EXTERNALSYM SDDL_CREATOR_GROUP}
  217. SDDL_LOCAL_SYSTEM = 'SY'; // Local system
  218. {$EXTERNALSYM SDDL_LOCAL_SYSTEM}
  219. SDDL_POWER_USERS = 'PU'; // Power users
  220. {$EXTERNALSYM SDDL_POWER_USERS}
  221. SDDL_EVERYONE = 'WD'; // Everyone ( World )
  222. {$EXTERNALSYM SDDL_EVERYONE}
  223. SDDL_REPLICATOR = 'RE'; // Replicator
  224. {$EXTERNALSYM SDDL_REPLICATOR}
  225. SDDL_INTERACTIVE = 'IU'; // Interactive logon user
  226. {$EXTERNALSYM SDDL_INTERACTIVE}
  227. SDDL_NETWORK = 'NU'; // Nework logon user
  228. {$EXTERNALSYM SDDL_NETWORK}
  229. SDDL_SERVICE = 'SU'; // Service logon user
  230. {$EXTERNALSYM SDDL_SERVICE}
  231. SDDL_RESTRICTED_CODE = 'RC'; // Restricted code
  232. {$EXTERNALSYM SDDL_RESTRICTED_CODE}
  233. SDDL_ANONYMOUS = 'AN'; // Anonymous Logon
  234. {$EXTERNALSYM SDDL_ANONYMOUS}
  235. SDDL_SCHEMA_ADMINISTRATORS = 'SA'; // Schema Administrators
  236. {$EXTERNALSYM SDDL_SCHEMA_ADMINISTRATORS}
  237. SDDL_CERT_SERV_ADMINISTRATORS = 'CA'; // Certificate Server Administrators
  238. {$EXTERNALSYM SDDL_CERT_SERV_ADMINISTRATORS}
  239. SDDL_RAS_SERVERS = 'RS'; // RAS servers group
  240. {$EXTERNALSYM SDDL_RAS_SERVERS}
  241. SDDL_ENTERPRISE_ADMINS = 'EA'; // Enterprise administrators
  242. {$EXTERNALSYM SDDL_ENTERPRISE_ADMINS}
  243. SDDL_GROUP_POLICY_ADMINS = 'PA'; // Group Policy administrators
  244. {$EXTERNALSYM SDDL_GROUP_POLICY_ADMINS}
  245. SDDL_ALIAS_PREW2KCOMPACC = 'RU'; // alias to allow previous windows 2000
  246. {$EXTERNALSYM SDDL_ALIAS_PREW2KCOMPACC}
  247. SDDL_LOCAL_SERVICE = 'LS'; // Local service account (for services)
  248. {$EXTERNALSYM SDDL_LOCAL_SERVICE}
  249. SDDL_NETWORK_SERVICE = 'NS'; // Network service account (for services)
  250. {$EXTERNALSYM SDDL_NETWORK_SERVICE}
  251. SDDL_REMOTE_DESKTOP = 'RD'; // Remote desktop users (for terminal server)
  252. {$EXTERNALSYM SDDL_REMOTE_DESKTOP}
  253. SDDL_NETWORK_CONFIGURATION_OPS = 'NO'; // Network configuration operators ( to manage configuration of networking features)
  254. {$EXTERNALSYM SDDL_NETWORK_CONFIGURATION_OPS}
  255. SDDL_PERFMON_USERS = 'MU'; // Performance Monitor Users
  256. {$EXTERNALSYM SDDL_PERFMON_USERS}
  257. SDDL_PERFLOG_USERS = 'LU'; // Performance Log Users
  258. {$EXTERNALSYM SDDL_PERFLOG_USERS}
  259. //
  260. // SDDL Seperators - character version
  261. //
  262. SDDL_SEPERATORC = ';';
  263. {$EXTERNALSYM SDDL_SEPERATORC}
  264. SDDL_DELIMINATORC = ':';
  265. {$EXTERNALSYM SDDL_DELIMINATORC}
  266. SDDL_ACE_BEGINC = '(';
  267. {$EXTERNALSYM SDDL_ACE_BEGINC}
  268. SDDL_ACE_ENDC = ')';
  269. {$EXTERNALSYM SDDL_ACE_ENDC}
  270. //
  271. // SDDL Seperators - string version
  272. //
  273. SDDL_SEPERATOR = ';';
  274. {$EXTERNALSYM SDDL_SEPERATOR}
  275. SDDL_DELIMINATOR = ':';
  276. {$EXTERNALSYM SDDL_DELIMINATOR}
  277. SDDL_ACE_BEGIN = '(';
  278. {$EXTERNALSYM SDDL_ACE_BEGIN}
  279. SDDL_ACE_END = ')';
  280. {$EXTERNALSYM SDDL_ACE_END}
  281. function ConvertSidToStringSidA(Sid: PSID; var StringSid: LPSTR): BOOL; stdcall;
  282. {$EXTERNALSYM ConvertSidToStringSidA}
  283. function ConvertSidToStringSidW(Sid: PSID; var StringSid: LPWSTR): BOOL; stdcall;
  284. {$EXTERNALSYM ConvertSidToStringSidW}
  285. function ConvertSidToStringSid(Sid: PSID; var StringSid: LPTSTR): BOOL; stdcall;
  286. {$EXTERNALSYM ConvertSidToStringSid}
  287. function ConvertStringSidToSidA(StringSid: LPCSTR; var Sid: PSID): BOOL; stdcall;
  288. {$EXTERNALSYM ConvertStringSidToSidA}
  289. function ConvertStringSidToSidW(StringSid: LPCWSTR; var Sid: PSID): BOOL; stdcall;
  290. {$EXTERNALSYM ConvertStringSidToSidW}
  291. function ConvertStringSidToSid(StringSid: LPCTSTR; var Sid: PSID): BOOL; stdcall;
  292. {$EXTERNALSYM ConvertStringSidToSid}
  293. function ConvertStringSecurityDescriptorToSecurityDescriptorA(StringSecurityDescriptor: LPCSTR;
  294. StringSDRevision: DWORD; var SecurityDescriptor: PSECURITY_DESCRIPTOR;
  295. SecurityDescriptorSize: PULONG): BOOL; stdcall;
  296. {$EXTERNALSYM ConvertStringSecurityDescriptorToSecurityDescriptorA}
  297. function ConvertStringSecurityDescriptorToSecurityDescriptorW(StringSecurityDescriptor: LPCWSTR;
  298. StringSDRevision: DWORD; var SecurityDescriptor: PSECURITY_DESCRIPTOR;
  299. SecurityDescriptorSize: PULONG): BOOL; stdcall;
  300. {$EXTERNALSYM ConvertStringSecurityDescriptorToSecurityDescriptorW}
  301. function ConvertStringSecurityDescriptorToSecurityDescriptor(StringSecurityDescriptor: LPCTSTR;
  302. StringSDRevision: DWORD; var SecurityDescriptor: PSECURITY_DESCRIPTOR;
  303. SecurityDescriptorSize: PULONG): BOOL; stdcall;
  304. {$EXTERNALSYM ConvertStringSecurityDescriptorToSecurityDescriptor}
  305. function ConvertSecurityDescriptorToStringSecurityDescriptorA(
  306. SecurityDescriptor: PSECURITY_DESCRIPTOR; RequestedStringSDRevision: DWORD;
  307. SecurityInformation: SECURITY_INFORMATION; var StringSecurityDescriptor: LPSTR;
  308. StringSecurityDescriptorLen: PULONG): BOOL; stdcall;
  309. {$EXTERNALSYM ConvertSecurityDescriptorToStringSecurityDescriptorA}
  310. function ConvertSecurityDescriptorToStringSecurityDescriptorW(
  311. SecurityDescriptor: PSECURITY_DESCRIPTOR; RequestedStringSDRevision: DWORD;
  312. SecurityInformation: SECURITY_INFORMATION; var StringSecurityDescriptor: LPWSTR;
  313. StringSecurityDescriptorLen: PULONG): BOOL; stdcall;
  314. {$EXTERNALSYM ConvertSecurityDescriptorToStringSecurityDescriptorW}
  315. function ConvertSecurityDescriptorToStringSecurityDescriptor(
  316. SecurityDescriptor: PSECURITY_DESCRIPTOR; RequestedStringSDRevision: DWORD;
  317. SecurityInformation: SECURITY_INFORMATION; var StringSecurityDescriptor: LPTSTR;
  318. StringSecurityDescriptorLen: PULONG): BOOL; stdcall;
  319. {$EXTERNALSYM ConvertSecurityDescriptorToStringSecurityDescriptor}
  320. implementation
  321. uses
  322. JwaWinDLLNames;
  323. {$IFDEF DYNAMIC_LINK}
  324. var
  325. _ConvertSidToStringSidA: Pointer;
  326. function ConvertSidToStringSidA;
  327. begin
  328. GetProcedureAddress(_ConvertSidToStringSidA, advapi32, 'ConvertSidToStringSidA');
  329. asm
  330. MOV ESP, EBP
  331. POP EBP
  332. JMP [_ConvertSidToStringSidA]
  333. end;
  334. end;
  335. var
  336. _ConvertSidToStringSidW: Pointer;
  337. function ConvertSidToStringSidW;
  338. begin
  339. GetProcedureAddress(_ConvertSidToStringSidW, advapi32, 'ConvertSidToStringSidW');
  340. asm
  341. MOV ESP, EBP
  342. POP EBP
  343. JMP [_ConvertSidToStringSidW]
  344. end;
  345. end;
  346. var
  347. _ConvertSidToStringSid: Pointer;
  348. function ConvertSidToStringSid;
  349. begin
  350. GetProcedureAddress(_ConvertSidToStringSid, advapi32, 'ConvertSidToStringSid' + AWSuffix);
  351. asm
  352. MOV ESP, EBP
  353. POP EBP
  354. JMP [_ConvertSidToStringSid]
  355. end;
  356. end;
  357. var
  358. _ConvertStringSidToSidA: Pointer;
  359. function ConvertStringSidToSidA;
  360. begin
  361. GetProcedureAddress(_ConvertStringSidToSidA, advapi32, 'ConvertStringSidToSidA');
  362. asm
  363. MOV ESP, EBP
  364. POP EBP
  365. JMP [_ConvertStringSidToSidA]
  366. end;
  367. end;
  368. var
  369. _ConvertStringSidToSidW: Pointer;
  370. function ConvertStringSidToSidW;
  371. begin
  372. GetProcedureAddress(_ConvertStringSidToSidW, advapi32, 'ConvertStringSidToSidW');
  373. asm
  374. MOV ESP, EBP
  375. POP EBP
  376. JMP [_ConvertStringSidToSidW]
  377. end;
  378. end;
  379. var
  380. _ConvertStringSidToSid: Pointer;
  381. function ConvertStringSidToSid;
  382. begin
  383. GetProcedureAddress(_ConvertStringSidToSid, advapi32, 'ConvertStringSidToSid' + AWSuffix);
  384. asm
  385. MOV ESP, EBP
  386. POP EBP
  387. JMP [_ConvertStringSidToSid]
  388. end;
  389. end;
  390. var
  391. _ConvStrSecDescrToSecDescrA: Pointer;
  392. function ConvertStringSecurityDescriptorToSecurityDescriptorA;
  393. begin
  394. GetProcedureAddress(_ConvStrSecDescrToSecDescrA, advapi32, 'ConvertStringSecurityDescriptorToSecurityDescriptorA');
  395. asm
  396. MOV ESP, EBP
  397. POP EBP
  398. JMP [_ConvStrSecDescrToSecDescrA]
  399. end;
  400. end;
  401. var
  402. _ConvStrSecDescrToSecDescrW: Pointer;
  403. function ConvertStringSecurityDescriptorToSecurityDescriptorW;
  404. begin
  405. GetProcedureAddress(_ConvStrSecDescrToSecDescrW, advapi32, 'ConvertStringSecurityDescriptorToSecurityDescriptorW');
  406. asm
  407. MOV ESP, EBP
  408. POP EBP
  409. JMP [_ConvStrSecDescrToSecDescrW]
  410. end;
  411. end;
  412. var
  413. _ConvStrSecDescrToSecDescr: Pointer;
  414. function ConvertStringSecurityDescriptorToSecurityDescriptor;
  415. begin
  416. GetProcedureAddress(_ConvStrSecDescrToSecDescr, advapi32, 'ConvertStringSecurityDescriptorToSecurityDescriptor' + AWSuffix);
  417. asm
  418. MOV ESP, EBP
  419. POP EBP
  420. JMP [_ConvStrSecDescrToSecDescr]
  421. end;
  422. end;
  423. var
  424. _ConvSecDescrToStrSecDescrA: Pointer;
  425. function ConvertSecurityDescriptorToStringSecurityDescriptorA;
  426. begin
  427. GetProcedureAddress(_ConvSecDescrToStrSecDescrA, advapi32, 'ConvertSecurityDescriptorToStringSecurityDescriptorA');
  428. asm
  429. MOV ESP, EBP
  430. POP EBP
  431. JMP [_ConvSecDescrToStrSecDescrA]
  432. end;
  433. end;
  434. var
  435. _ConvSecDescrToStrSecDescrW: Pointer;
  436. function ConvertSecurityDescriptorToStringSecurityDescriptorW;
  437. begin
  438. GetProcedureAddress(_ConvSecDescrToStrSecDescrW, advapi32, 'ConvertSecurityDescriptorToStringSecurityDescriptorW');
  439. asm
  440. MOV ESP, EBP
  441. POP EBP
  442. JMP [_ConvSecDescrToStrSecDescrW]
  443. end;
  444. end;
  445. var
  446. _ConvSecDescrToStrSecDescr: Pointer;
  447. function ConvertSecurityDescriptorToStringSecurityDescriptor;
  448. begin
  449. GetProcedureAddress(_ConvSecDescrToStrSecDescr, advapi32, 'ConvertSecurityDescriptorToStringSecurityDescriptor' + AWSuffix);
  450. asm
  451. MOV ESP, EBP
  452. POP EBP
  453. JMP [_ConvSecDescrToStrSecDescr]
  454. end;
  455. end;
  456. {$ELSE}
  457. function ConvertSidToStringSidA; external advapi32 name 'ConvertSidToStringSidA';
  458. function ConvertSidToStringSidW; external advapi32 name 'ConvertSidToStringSidW';
  459. function ConvertSidToStringSid; external advapi32 name 'ConvertSidToStringSid' + AWSuffix;
  460. function ConvertStringSidToSidA; external advapi32 name 'ConvertStringSidToSidA';
  461. function ConvertStringSidToSidW; external advapi32 name 'ConvertStringSidToSidW';
  462. function ConvertStringSidToSid; external advapi32 name 'ConvertStringSidToSid' + AWSuffix;
  463. function ConvertStringSecurityDescriptorToSecurityDescriptorA; external advapi32 name 'ConvertStringSecurityDescriptorToSecurityDescriptorA';
  464. function ConvertStringSecurityDescriptorToSecurityDescriptorW; external advapi32 name 'ConvertStringSecurityDescriptorToSecurityDescriptorW';
  465. function ConvertStringSecurityDescriptorToSecurityDescriptor; external advapi32 name 'ConvertStringSecurityDescriptorToSecurityDescriptor' + AWSuffix;
  466. function ConvertSecurityDescriptorToStringSecurityDescriptorA; external advapi32 name 'ConvertSecurityDescriptorToStringSecurityDescriptorA';
  467. function ConvertSecurityDescriptorToStringSecurityDescriptorW; external advapi32 name 'ConvertSecurityDescriptorToStringSecurityDescriptorW';
  468. function ConvertSecurityDescriptorToStringSecurityDescriptor; external advapi32 name 'ConvertSecurityDescriptorToStringSecurityDescriptor' + AWSuffix;
  469. {$ENDIF DYNAMIC_LINK}
  470. end.