2
0

jwaactiveds.pas 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206
  1. {******************************************************************************}
  2. { }
  3. { Active Directory Services 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: activeds.h, released June 2000. The original Pascal }
  9. { code is: ActiveDS.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 JwaActiveDS;
  43. {$WEAKPACKAGEUNIT}
  44. {$HPPEMIT ''}
  45. {$HPPEMIT '#include "activeds.h"'}
  46. {$HPPEMIT ''}
  47. {$HPPEMIT 'typedef GUID REFIID'}
  48. {$HPPEMIT ''}
  49. {$I jediapilib.inc}
  50. interface
  51. uses
  52. ActiveX {TODO}, JwaAdsTLB, JwaWinNT, JwaWinType, JwaWinUser;
  53. type
  54. REFIID = GUID;
  55. {$NODEFINE REFIID}
  56. type
  57. // imports of a type library sometimes are missing a few decls, these are just
  58. // a few of them to make this file compile at all. I really should do all of
  59. // them one day.
  60. PADSVALUE = ^_adsvalue;
  61. {$EXTERNALSYM PADSVALUE}
  62. PADS_ATTR_INFO = ^_ads_attr_info;
  63. {$EXTERNALSYM PADS_ATTR_INFO}
  64. // Contents: Master include file for Ole Ds
  65. //
  66. // Notes: All Ole Ds client applications must include this file. This
  67. // provides access to the primary Ole Ds interfaces, the error
  68. // codes, and function prototypes for the Ole Ds helper apis.
  69. //
  70. // Interface definitions and well known GUIDS for Ole Ds
  71. //
  72. //#include "iads.h" >> AdsTLB from activeds.dll
  73. //
  74. // Helper function prototypes for Ole Ds
  75. //
  76. //#include "adshlp.h"
  77. function ADsGetObject(lpszPathName: LPCWSTR; const riid: REFIID; out ppObject: Pointer): HRESULT; stdcall;
  78. {$EXTERNALSYM ADsGetObject}
  79. function ADsBuildEnumerator(pADsContainer: IADsContainer; out ppEnumVariant: IEnumVARIANT): HRESULT; stdcall;
  80. {$EXTERNALSYM ADsBuildEnumerator}
  81. function ADsFreeEnumerator(var pEnumVariant: IEnumVARIANT): HRESULT;
  82. {$EXTERNALSYM ADsFreeEnumerator}
  83. function ADsEnumerateNext(pEnumVariant: IEnumVARIANT; cElements: ULONG;
  84. var pvar: OleVariant; var pcElementsFetched: ULONG): HRESULT; stdcall;
  85. {$EXTERNALSYM ADsEnumerateNext}
  86. function ADsBuildVarArrayStr(lppPathNames: LPWSTR; dwPathNames: DWORD;
  87. var pVar: OleVariant): HRESULT; stdcall;
  88. {$EXTERNALSYM ADsBuildVarArrayStr}
  89. function ADsBuildVarArrayInt(lpdwObjectTypes: LPDWORD; dwObjectTypes: DWORD;
  90. var pVar: OleVariant): HRESULT; stdcall;
  91. {$EXTERNALSYM ADsBuildVarArrayInt}
  92. function ADsOpenObject(lpszPathName, lpszUserName, lpszPassword: LPCWSTR;
  93. dwReserved: DWORD; const riid: REFIID; out ppObject: Pointer): HRESULT; stdcall;
  94. {$EXTERNALSYM ADsOpenObject}
  95. //
  96. // Helper functions for extended error support
  97. //
  98. function ADsGetLastError(var lpError: DWORD; lpErrorBuf: LPWSTR;
  99. dwErrorBufLen: DWORD; lpNameBuf: LPWSTR; dwNameBufLen: DWORD): HRESULT; stdcall;
  100. {$EXTERNALSYM ADsGetLastError}
  101. procedure ADsSetLastError(dwErr: DWORD; pszError, pszProvider: LPCWSTR); stdcall;
  102. {$EXTERNALSYM ADsSetLastError}
  103. //procedure ADsFreeAllErrorRecords; stdcall;
  104. //{$EXTERNALSYM ADsFreeAllErrorRecords}
  105. function AllocADsMem(cb: DWORD): LPVOID; stdcall;
  106. {$EXTERNALSYM AllocADsMem}
  107. function FreeADsMem(pMem: LPVOID): BOOL; stdcall;
  108. {$EXTERNALSYM FreeADsMem}
  109. function ReallocADsMem(pOldMem: LPVOID; cbOld, cbNew: DWORD): LPVOID; stdcall;
  110. {$EXTERNALSYM ReallocADsMem}
  111. function AllocADsStr(pStr: LPCWSTR): LPWSTR; stdcall;
  112. {$EXTERNALSYM AllocADsStr}
  113. function FreeADsStr(pStr: LPWSTR): BOOL; stdcall;
  114. {$EXTERNALSYM FreeADsStr}
  115. function ReallocADsStr(var ppStr: LPWSTR; pStr: LPWSTR): BOOL; stdcall;
  116. {$EXTERNALSYM ReallocADsStr}
  117. function ADsEncodeBinaryData(pbSrcData: PBYTE; dwSrcLen: DWORD;
  118. var ppszDestData: LPWSTR): HRESULT; stdcall;
  119. {$EXTERNALSYM ADsEncodeBinaryData}
  120. function ADsDecodeBinaryData(szSrcData: LPCWSTR; var ppbDestData: PBYTE;
  121. var pdwDestLen: ULONG): HRESULT; stdcall;
  122. {$EXTERNALSYM ADsDecodeBinaryData}
  123. function PropVariantToAdsType(var pVariant: OleVariant; dwNumVariant: DWORD;
  124. var ppAdsValues: PADSVALUE; pdwNumValues: PDWORD): HRESULT; stdcall;
  125. {$EXTERNALSYM PropVariantToAdsType}
  126. function AdsTypeToPropVariant(pAdsValues: PADSVALUE; dwNumValues: DWORD;
  127. var pVariant: OleVariant): HRESULT; stdcall;
  128. {$EXTERNALSYM AdsTypeToPropVariant}
  129. procedure AdsFreeAdsValues(pAdsValues: PADSVALUE; dwNumValues: DWORD); stdcall;
  130. {$EXTERNALSYM AdsFreeAdsValues}
  131. //
  132. // Error codes for Ole Ds - generated from ..\..\errmsg
  133. //
  134. //#include "adserr.h"
  135. // ---------------------- HRESULT value definitions -----------------
  136. //
  137. // HRESULT definitions
  138. //
  139. //
  140. // Values are 32 bit values layed out as follows:
  141. //
  142. // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  143. // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  144. // +---+-+-+-----------------------+-------------------------------+
  145. // |Sev|C|R| Facility | Code |
  146. // +---+-+-+-----------------------+-------------------------------+
  147. //
  148. // where
  149. //
  150. // Sev - is the severity code
  151. //
  152. // 00 - Success
  153. // 01 - Informational
  154. // 10 - Warning
  155. // 11 - Error
  156. //
  157. // C - is the Customer code flag
  158. //
  159. // R - is a reserved bit
  160. //
  161. // Facility - is the facility code
  162. //
  163. // Code - is the facility's status code
  164. //
  165. //
  166. // Define the facility codes
  167. //
  168. const
  169. FACILITY_WINDOWS = 8;
  170. {$EXTERNALSYM FACILITY_WINDOWS}
  171. FACILITY_STORAGE = 3;
  172. {$EXTERNALSYM FACILITY_STORAGE}
  173. FACILITY_RPC = 1;
  174. {$EXTERNALSYM FACILITY_RPC}
  175. FACILITY_SSPI = 9;
  176. {$EXTERNALSYM FACILITY_SSPI}
  177. FACILITY_WIN32 = 7;
  178. {$EXTERNALSYM FACILITY_WIN32}
  179. FACILITY_CONTROL = 10;
  180. {$EXTERNALSYM FACILITY_CONTROL}
  181. FACILITY_NULL = 0;
  182. {$EXTERNALSYM FACILITY_NULL}
  183. FACILITY_ITF = 4;
  184. {$EXTERNALSYM FACILITY_ITF}
  185. FACILITY_DISPATCH = 2;
  186. {$EXTERNALSYM FACILITY_DISPATCH}
  187. //
  188. // Define the severity codes
  189. //
  190. //
  191. // MessageId: E_ADS_BAD_PATHNAME
  192. //
  193. // MessageText:
  194. //
  195. // An invalid Active Directory pathname was passed
  196. //
  197. E_ADS_BAD_PATHNAME = HRESULT($80005000);
  198. {$EXTERNALSYM E_ADS_BAD_PATHNAME}
  199. //
  200. // MessageId: E_ADS_INVALID_DOMAIN_OBJECT
  201. //
  202. // MessageText:
  203. //
  204. // An unknown Active Directory domain object was requested
  205. //
  206. E_ADS_INVALID_DOMAIN_OBJECT = HRESULT($80005001);
  207. {$EXTERNALSYM E_ADS_INVALID_DOMAIN_OBJECT}
  208. //
  209. // MessageId: E_ADS_INVALID_USER_OBJECT
  210. //
  211. // MessageText:
  212. //
  213. // An unknown Active Directory user object was requested
  214. //
  215. E_ADS_INVALID_USER_OBJECT = HRESULT($80005002);
  216. {$EXTERNALSYM E_ADS_INVALID_USER_OBJECT}
  217. //
  218. // MessageId: E_ADS_INVALID_COMPUTER_OBJECT
  219. //
  220. // MessageText:
  221. //
  222. // An unknown Active Directory computer object was requested
  223. //
  224. E_ADS_INVALID_COMPUTER_OBJECT = HRESULT($80005003);
  225. {$EXTERNALSYM E_ADS_INVALID_COMPUTER_OBJECT}
  226. //
  227. // MessageId: E_ADS_UNKNOWN_OBJECT
  228. //
  229. // MessageText:
  230. //
  231. // An unknown Active Directory object was requested
  232. //
  233. E_ADS_UNKNOWN_OBJECT = HRESULT($80005004);
  234. {$EXTERNALSYM E_ADS_UNKNOWN_OBJECT}
  235. //
  236. // MessageId: E_ADS_PROPERTY_NOT_SET
  237. //
  238. // MessageText:
  239. //
  240. // The specified Active Directory property was not set
  241. //
  242. E_ADS_PROPERTY_NOT_SET = HRESULT($80005005);
  243. {$EXTERNALSYM E_ADS_PROPERTY_NOT_SET}
  244. //
  245. // MessageId: E_ADS_PROPERTY_NOT_SUPPORTED
  246. //
  247. // MessageText:
  248. //
  249. // The specified Active Directory property is not supported
  250. //
  251. E_ADS_PROPERTY_NOT_SUPPORTED = HRESULT($80005006);
  252. {$EXTERNALSYM E_ADS_PROPERTY_NOT_SUPPORTED}
  253. //
  254. // MessageId: E_ADS_PROPERTY_INVALID
  255. //
  256. // MessageText:
  257. //
  258. // The specified Active Directory property is invalid
  259. //
  260. E_ADS_PROPERTY_INVALID = HRESULT($80005007);
  261. {$EXTERNALSYM E_ADS_PROPERTY_INVALID}
  262. //
  263. // MessageId: E_ADS_BAD_PARAMETER
  264. //
  265. // MessageText:
  266. //
  267. // One or more input parameters are invalid
  268. //
  269. E_ADS_BAD_PARAMETER = HRESULT($80005008);
  270. {$EXTERNALSYM E_ADS_BAD_PARAMETER}
  271. //
  272. // MessageId: E_ADS_OBJECT_UNBOUND
  273. //
  274. // MessageText:
  275. //
  276. // The specified Active Directory object is not bound to a remote resource
  277. //
  278. E_ADS_OBJECT_UNBOUND = HRESULT($80005009);
  279. {$EXTERNALSYM E_ADS_OBJECT_UNBOUND}
  280. //
  281. // MessageId: E_ADS_PROPERTY_NOT_MODIFIED
  282. //
  283. // MessageText:
  284. //
  285. // The specified Active Directory object has not been modified
  286. //
  287. E_ADS_PROPERTY_NOT_MODIFIED = HRESULT($8000500A);
  288. {$EXTERNALSYM E_ADS_PROPERTY_NOT_MODIFIED}
  289. //
  290. // MessageId: E_ADS_PROPERTY_MODIFIED
  291. //
  292. // MessageText:
  293. //
  294. // The specified Active Directory object has not been modified
  295. //
  296. E_ADS_PROPERTY_MODIFIED = HRESULT($8000500B);
  297. {$EXTERNALSYM E_ADS_PROPERTY_MODIFIED}
  298. //
  299. // MessageId: E_ADS_CANT_CONVERT_DATATYPE
  300. //
  301. // MessageText:
  302. //
  303. // The Active Directory datatype cannot be converted to/from a native DS datatype
  304. //
  305. E_ADS_CANT_CONVERT_DATATYPE = HRESULT($8000500C);
  306. {$EXTERNALSYM E_ADS_CANT_CONVERT_DATATYPE}
  307. //
  308. // MessageId: E_ADS_PROPERTY_NOT_FOUND
  309. //
  310. // MessageText:
  311. //
  312. // The Active Directory property cannot be found in the cache.
  313. //
  314. E_ADS_PROPERTY_NOT_FOUND = HRESULT($8000500D);
  315. {$EXTERNALSYM E_ADS_PROPERTY_NOT_FOUND}
  316. //
  317. // MessageId: E_ADS_OBJECT_EXISTS
  318. //
  319. // MessageText:
  320. //
  321. // The Active Directory object exists.
  322. //
  323. E_ADS_OBJECT_EXISTS = HRESULT($8000500E);
  324. {$EXTERNALSYM E_ADS_OBJECT_EXISTS}
  325. //
  326. // MessageId: E_ADS_SCHEMA_VIOLATION
  327. //
  328. // MessageText:
  329. //
  330. // The attempted action violates the DS schema rules.
  331. //
  332. E_ADS_SCHEMA_VIOLATION = HRESULT($8000500F);
  333. {$EXTERNALSYM E_ADS_SCHEMA_VIOLATION}
  334. //
  335. // MessageId: E_ADS_COLUMN_NOT_SET
  336. //
  337. // MessageText:
  338. //
  339. // The specified column in the Active Directory was not set.
  340. //
  341. E_ADS_COLUMN_NOT_SET = HRESULT($80005010);
  342. {$EXTERNALSYM E_ADS_COLUMN_NOT_SET}
  343. //
  344. // MessageId: S_ADS_ERRORSOCCURRED
  345. //
  346. // MessageText:
  347. //
  348. // One or more errors occurred
  349. //
  350. S_ADS_ERRORSOCCURRED = HRESULT($00005011);
  351. {$EXTERNALSYM S_ADS_ERRORSOCCURRED}
  352. //
  353. // MessageId: S_ADS_NOMORE_ROWS
  354. //
  355. // MessageText:
  356. //
  357. // No more rows to be obatained by the search result.
  358. //
  359. S_ADS_NOMORE_ROWS = HRESULT($00005012);
  360. {$EXTERNALSYM S_ADS_NOMORE_ROWS}
  361. //
  362. // MessageId: S_ADS_NOMORE_COLUMNS
  363. //
  364. // MessageText:
  365. //
  366. // No more columns to be obatained for the current row.
  367. //
  368. S_ADS_NOMORE_COLUMNS = HRESULT($00005013);
  369. {$EXTERNALSYM S_ADS_NOMORE_COLUMNS}
  370. //
  371. // MessageId: E_ADS_INVALID_FILTER
  372. //
  373. // MessageText:
  374. //
  375. // The search filter specified is invalid
  376. //
  377. E_ADS_INVALID_FILTER = HRESULT($80005014);
  378. {$EXTERNALSYM E_ADS_INVALID_FILTER}
  379. //
  380. // Globally accessible GUIDS
  381. //
  382. //#include "adsiid.h" -> adstlb from activeds.dll
  383. //
  384. // Status codes for ads objects
  385. //
  386. //#include "adssts.h"
  387. const
  388. ADS_PRINTER_PAUSED = $00000001;
  389. {$EXTERNALSYM ADS_PRINTER_PAUSED}
  390. ADS_PRINTER_PENDING_DELETION = $00000002;
  391. {$EXTERNALSYM ADS_PRINTER_PENDING_DELETION}
  392. ADS_PRINTER_ERROR = $00000003;
  393. {$EXTERNALSYM ADS_PRINTER_ERROR}
  394. ADS_PRINTER_PAPER_JAM = $00000004;
  395. {$EXTERNALSYM ADS_PRINTER_PAPER_JAM}
  396. ADS_PRINTER_PAPER_OUT = $00000005;
  397. {$EXTERNALSYM ADS_PRINTER_PAPER_OUT}
  398. ADS_PRINTER_MANUAL_FEED = $00000006;
  399. {$EXTERNALSYM ADS_PRINTER_MANUAL_FEED}
  400. ADS_PRINTER_PAPER_PROBLEM = $00000007;
  401. {$EXTERNALSYM ADS_PRINTER_PAPER_PROBLEM}
  402. ADS_PRINTER_OFFLINE = $00000008;
  403. {$EXTERNALSYM ADS_PRINTER_OFFLINE}
  404. ADS_PRINTER_IO_ACTIVE = $00000100;
  405. {$EXTERNALSYM ADS_PRINTER_IO_ACTIVE}
  406. ADS_PRINTER_BUSY = $00000200;
  407. {$EXTERNALSYM ADS_PRINTER_BUSY}
  408. ADS_PRINTER_PRINTING = $00000400;
  409. {$EXTERNALSYM ADS_PRINTER_PRINTING}
  410. ADS_PRINTER_OUTPUT_BIN_FULL = $00000800;
  411. {$EXTERNALSYM ADS_PRINTER_OUTPUT_BIN_FULL}
  412. ADS_PRINTER_NOT_AVAILABLE = $00001000;
  413. {$EXTERNALSYM ADS_PRINTER_NOT_AVAILABLE}
  414. ADS_PRINTER_WAITING = $00002000;
  415. {$EXTERNALSYM ADS_PRINTER_WAITING}
  416. ADS_PRINTER_PROCESSING = $00004000;
  417. {$EXTERNALSYM ADS_PRINTER_PROCESSING}
  418. ADS_PRINTER_INITIALIZING = $00008000;
  419. {$EXTERNALSYM ADS_PRINTER_INITIALIZING}
  420. ADS_PRINTER_WARMING_UP = $00010000;
  421. {$EXTERNALSYM ADS_PRINTER_WARMING_UP}
  422. ADS_PRINTER_TONER_LOW = $00020000;
  423. {$EXTERNALSYM ADS_PRINTER_TONER_LOW}
  424. ADS_PRINTER_NO_TONER = $00040000;
  425. {$EXTERNALSYM ADS_PRINTER_NO_TONER}
  426. ADS_PRINTER_PAGE_PUNT = $00080000;
  427. {$EXTERNALSYM ADS_PRINTER_PAGE_PUNT}
  428. ADS_PRINTER_USER_INTERVENTION = $00100000;
  429. {$EXTERNALSYM ADS_PRINTER_USER_INTERVENTION}
  430. ADS_PRINTER_OUT_OF_MEMORY = $00200000;
  431. {$EXTERNALSYM ADS_PRINTER_OUT_OF_MEMORY}
  432. ADS_PRINTER_DOOR_OPEN = $00400000;
  433. {$EXTERNALSYM ADS_PRINTER_DOOR_OPEN}
  434. ADS_PRINTER_SERVER_UNKNOWN = $00800000;
  435. {$EXTERNALSYM ADS_PRINTER_SERVER_UNKNOWN}
  436. ADS_PRINTER_POWER_SAVE = $01000000;
  437. {$EXTERNALSYM ADS_PRINTER_POWER_SAVE}
  438. //
  439. // job status values
  440. //
  441. ADS_JOB_PAUSED = $00000001;
  442. {$EXTERNALSYM ADS_JOB_PAUSED}
  443. ADS_JOB_ERROR = $00000002;
  444. {$EXTERNALSYM ADS_JOB_ERROR}
  445. ADS_JOB_DELETING = $00000004;
  446. {$EXTERNALSYM ADS_JOB_DELETING}
  447. ADS_JOB_SPOOLING = $00000008;
  448. {$EXTERNALSYM ADS_JOB_SPOOLING}
  449. ADS_JOB_PRINTING = $00000010;
  450. {$EXTERNALSYM ADS_JOB_PRINTING}
  451. ADS_JOB_OFFLINE = $00000020;
  452. {$EXTERNALSYM ADS_JOB_OFFLINE}
  453. ADS_JOB_PAPEROUT = $00000040;
  454. {$EXTERNALSYM ADS_JOB_PAPEROUT}
  455. ADS_JOB_PRINTED = $00000080;
  456. {$EXTERNALSYM ADS_JOB_PRINTED}
  457. ADS_JOB_DELETED = $00000100;
  458. {$EXTERNALSYM ADS_JOB_DELETED}
  459. //
  460. // service status values
  461. //
  462. ADS_SERVICE_STOPPED = $00000001;
  463. {$EXTERNALSYM ADS_SERVICE_STOPPED}
  464. ADS_SERVICE_START_PENDING = $00000002;
  465. {$EXTERNALSYM ADS_SERVICE_START_PENDING}
  466. ADS_SERVICE_STOP_PENDING = $00000003;
  467. {$EXTERNALSYM ADS_SERVICE_STOP_PENDING}
  468. ADS_SERVICE_RUNNING = $00000004;
  469. {$EXTERNALSYM ADS_SERVICE_RUNNING}
  470. ADS_SERVICE_CONTINUE_PENDING = $00000005;
  471. {$EXTERNALSYM ADS_SERVICE_CONTINUE_PENDING}
  472. ADS_SERVICE_PAUSE_PENDING = $00000006;
  473. {$EXTERNALSYM ADS_SERVICE_PAUSE_PENDING}
  474. ADS_SERVICE_PAUSED = $00000007;
  475. {$EXTERNALSYM ADS_SERVICE_PAUSED}
  476. ADS_SERVICE_ERROR = $00000008;
  477. {$EXTERNALSYM ADS_SERVICE_ERROR}
  478. //---------------------------------------------------------------------
  479. //
  480. // Service Type Valid Values
  481. //
  482. ADS_SERVICE_OWN_PROCESS = $00000010;
  483. {$EXTERNALSYM ADS_SERVICE_OWN_PROCESS}
  484. ADS_SERVICE_SHARE_PROCESS = $00000020;
  485. {$EXTERNALSYM ADS_SERVICE_SHARE_PROCESS}
  486. ADS_SERVICE_KERNEL_DRIVER = $00000001;
  487. {$EXTERNALSYM ADS_SERVICE_KERNEL_DRIVER}
  488. ADS_SERVICE_FILE_SYSTEM_DRIVER = $00000002;
  489. {$EXTERNALSYM ADS_SERVICE_FILE_SYSTEM_DRIVER}
  490. //
  491. // Start Type Valid Values
  492. //
  493. ADS_SERVICE_BOOT_START = SERVICE_BOOT_START;
  494. {$EXTERNALSYM ADS_SERVICE_BOOT_START}
  495. ADS_SERVICE_SYSTEM_START = SERVICE_SYSTEM_START;
  496. {$EXTERNALSYM ADS_SERVICE_SYSTEM_START}
  497. ADS_SERVICE_AUTO_START = SERVICE_AUTO_START;
  498. {$EXTERNALSYM ADS_SERVICE_AUTO_START}
  499. ADS_SERVICE_DEMAND_START = SERVICE_DEMAND_START;
  500. {$EXTERNALSYM ADS_SERVICE_DEMAND_START}
  501. ADS_SERVICE_DISABLED = SERVICE_DISABLED;
  502. {$EXTERNALSYM ADS_SERVICE_DISABLED}
  503. //
  504. // Error Control Values
  505. //
  506. ADS_SERVICE_ERROR_IGNORE = 0;
  507. {$EXTERNALSYM ADS_SERVICE_ERROR_IGNORE}
  508. ADS_SERVICE_ERROR_NORMAL = 1;
  509. {$EXTERNALSYM ADS_SERVICE_ERROR_NORMAL}
  510. ADS_SERVICE_ERROR_SEVERE = 2;
  511. {$EXTERNALSYM ADS_SERVICE_ERROR_SEVERE}
  512. ADS_SERVICE_ERROR_CRITICAL = 3;
  513. {$EXTERNALSYM ADS_SERVICE_ERROR_CRITICAL}
  514. //
  515. // Schema class names and other schema related definitions
  516. //
  517. //#include "adsnms.h"
  518. const
  519. NAMESPACE_CLASS_NAME = 'Namespace';
  520. {$EXTERNALSYM NAMESPACE_CLASS_NAME}
  521. COUNTRY_CLASS_NAME = 'Country';
  522. {$EXTERNALSYM COUNTRY_CLASS_NAME}
  523. LOCALITY_CLASS_NAME = 'Locality';
  524. {$EXTERNALSYM LOCALITY_CLASS_NAME}
  525. ORGANIZATION_CLASS_NAME = 'Organization';
  526. {$EXTERNALSYM ORGANIZATION_CLASS_NAME}
  527. ORGANIZATIONUNIT_CLASS_NAME = 'Organizational Unit';
  528. {$EXTERNALSYM ORGANIZATIONUNIT_CLASS_NAME}
  529. DOMAIN_CLASS_NAME = 'Domain';
  530. {$EXTERNALSYM DOMAIN_CLASS_NAME}
  531. COMPUTER_CLASS_NAME = 'Computer';
  532. {$EXTERNALSYM COMPUTER_CLASS_NAME}
  533. USER_CLASS_NAME = 'User';
  534. {$EXTERNALSYM USER_CLASS_NAME}
  535. GROUP_CLASS_NAME = 'Group';
  536. {$EXTERNALSYM GROUP_CLASS_NAME}
  537. GLOBALGROUP_CLASS_NAME = 'GlobalGroup';
  538. {$EXTERNALSYM GLOBALGROUP_CLASS_NAME}
  539. LOCALGROUP_CLASS_NAME = 'LocalGroup';
  540. {$EXTERNALSYM LOCALGROUP_CLASS_NAME}
  541. SERVICE_CLASS_NAME = 'Service';
  542. {$EXTERNALSYM SERVICE_CLASS_NAME}
  543. FILESERVICE_CLASS_NAME = 'FileService';
  544. {$EXTERNALSYM FILESERVICE_CLASS_NAME}
  545. SESSION_CLASS_NAME = 'Session';
  546. {$EXTERNALSYM SESSION_CLASS_NAME}
  547. RESOURCE_CLASS_NAME = 'Resource';
  548. {$EXTERNALSYM RESOURCE_CLASS_NAME}
  549. FILESHARE_CLASS_NAME = 'FileShare';
  550. {$EXTERNALSYM FILESHARE_CLASS_NAME}
  551. PRINTER_CLASS_NAME = 'PrintQueue';
  552. {$EXTERNALSYM PRINTER_CLASS_NAME}
  553. PRINTJOB_CLASS_NAME = 'PrintJob';
  554. {$EXTERNALSYM PRINTJOB_CLASS_NAME}
  555. SCHEMA_CLASS_NAME = 'Schema';
  556. {$EXTERNALSYM SCHEMA_CLASS_NAME}
  557. CLASS_CLASS_NAME = 'Class';
  558. {$EXTERNALSYM CLASS_CLASS_NAME}
  559. PROPERTY_CLASS_NAME = 'Property';
  560. {$EXTERNALSYM PROPERTY_CLASS_NAME}
  561. SYNTAX_CLASS_NAME = 'Syntax';
  562. {$EXTERNALSYM SYNTAX_CLASS_NAME}
  563. ROOTDSE_CLASS_NAME = 'RootDSE';
  564. {$EXTERNALSYM ROOTDSE_CLASS_NAME}
  565. NO_SCHEMA = '';
  566. {$EXTERNALSYM NO_SCHEMA}
  567. DOMAIN_SCHEMA_NAME = 'Domain';
  568. {$EXTERNALSYM DOMAIN_SCHEMA_NAME}
  569. COMPUTER_SCHEMA_NAME = 'Computer';
  570. {$EXTERNALSYM COMPUTER_SCHEMA_NAME}
  571. USER_SCHEMA_NAME = 'User';
  572. {$EXTERNALSYM USER_SCHEMA_NAME}
  573. GROUP_SCHEMA_NAME = 'Group';
  574. {$EXTERNALSYM GROUP_SCHEMA_NAME}
  575. GLOBALGROUP_SCHEMA_NAME = 'GlobalGroup';
  576. {$EXTERNALSYM GLOBALGROUP_SCHEMA_NAME}
  577. LOCALGROUP_SCHEMA_NAME = 'LocalGroup';
  578. {$EXTERNALSYM LOCALGROUP_SCHEMA_NAME}
  579. SERVICE_SCHEMA_NAME = 'Service';
  580. {$EXTERNALSYM SERVICE_SCHEMA_NAME}
  581. PRINTER_SCHEMA_NAME = 'PrintQueue';
  582. {$EXTERNALSYM PRINTER_SCHEMA_NAME}
  583. PRINTJOB_SCHEMA_NAME = 'PrintJob';
  584. {$EXTERNALSYM PRINTJOB_SCHEMA_NAME}
  585. FILESERVICE_SCHEMA_NAME = 'FileService';
  586. {$EXTERNALSYM FILESERVICE_SCHEMA_NAME}
  587. SESSION_SCHEMA_NAME = 'Session';
  588. {$EXTERNALSYM SESSION_SCHEMA_NAME}
  589. RESOURCE_SCHEMA_NAME = 'Resource';
  590. {$EXTERNALSYM RESOURCE_SCHEMA_NAME}
  591. FILESHARE_SCHEMA_NAME = 'FileShare';
  592. {$EXTERNALSYM FILESHARE_SCHEMA_NAME}
  593. FPNW_FILESERVICE_SCHEMA_NAME = 'FPNWFileService';
  594. {$EXTERNALSYM FPNW_FILESERVICE_SCHEMA_NAME}
  595. FPNW_SESSION_SCHEMA_NAME = 'FPNWSession';
  596. {$EXTERNALSYM FPNW_SESSION_SCHEMA_NAME}
  597. FPNW_RESOURCE_SCHEMA_NAME = 'FPNWResource';
  598. {$EXTERNALSYM FPNW_RESOURCE_SCHEMA_NAME}
  599. FPNW_FILESHARE_SCHEMA_NAME = 'FPNWFileShare';
  600. {$EXTERNALSYM FPNW_FILESHARE_SCHEMA_NAME}
  601. //
  602. // Definitions in the OLE DB provider for ADSI
  603. //
  604. //#include "adsdb.h"
  605. //
  606. // printer status values
  607. //
  608. // Most of the constants have been moved into an enum in adstype.h and
  609. // are available publicly in iads.h. This file has been left here so that
  610. // old references to adsdb.h do not break compiles.
  611. const
  612. DBPROPFLAGS_ADSISEARCH = $0000C000;
  613. {$EXTERNALSYM DBPROPFLAGS_ADSISEARCH}
  614. //#include "adsprop.h"
  615. // Windows NT Active Directory Service Property Pages
  616. //
  617. // Contents: Functions and definitions used in the creation of AD property
  618. // sheets.
  619. const
  620. WM_ADSPROP_NOTIFY_PAGEINIT = WM_USER + 1101; // where LPARAM is the PADSPROPINITPARAMS pointer.
  621. {$EXTERNALSYM WM_ADSPROP_NOTIFY_PAGEINIT}
  622. WM_ADSPROP_NOTIFY_PAGEHWND = WM_USER + 1102; // where WPARAM => page's HWND
  623. {$EXTERNALSYM WM_ADSPROP_NOTIFY_PAGEHWND}
  624. WM_ADSPROP_NOTIFY_CHANGE = WM_USER + 1103; // used to send a change notification to a parent sheet
  625. {$EXTERNALSYM WM_ADSPROP_NOTIFY_CHANGE}
  626. WM_ADSPROP_NOTIFY_APPLY = WM_USER + 1104; // pages send this to the notification object.
  627. {$EXTERNALSYM WM_ADSPROP_NOTIFY_APPLY}
  628. WM_ADSPROP_NOTIFY_SETFOCUS = WM_USER + 1105; // used internally by the notification object.
  629. {$EXTERNALSYM WM_ADSPROP_NOTIFY_SETFOCUS}
  630. WM_ADSPROP_NOTIFY_FOREGROUND = WM_USER + 1106; // used internally by the notification object.
  631. {$EXTERNALSYM WM_ADSPROP_NOTIFY_FOREGROUND}
  632. WM_ADSPROP_NOTIFY_EXIT = WM_USER + 1107; // sent on page release
  633. {$EXTERNALSYM WM_ADSPROP_NOTIFY_EXIT}
  634. //+----------------------------------------------------------------------------
  635. //
  636. // Structure: ADSPROPINITPARAMS
  637. //
  638. // Usage: Used to pass page initialization information to new pages from
  639. // the notify object.
  640. //
  641. //-----------------------------------------------------------------------------
  642. type
  643. PADSPROPINITPARAMS = ^ADSPROPINITPARAMS;
  644. {$EXTERNALSYM PADSPROPINITPARAMS}
  645. _ADSPROPINITPARAMS = record
  646. dwSize: DWORD; // Set this to the size of the struct.
  647. dwFlags: DWORD; // Reserved for future use.
  648. hr: HRESULT; // If this is non-zero, then the others
  649. pDsObj: IDirectoryObject; // should be ignored.
  650. pwzCN: LPWSTR;
  651. pWritableAttrs: PADS_ATTR_INFO;
  652. end;
  653. {$EXTERNALSYM _ADSPROPINITPARAMS}
  654. ADSPROPINITPARAMS = _ADSPROPINITPARAMS;
  655. {$EXTERNALSYM ADSPROPINITPARAMS}
  656. TAdsPropInitParams = ADSPROPINITPARAMS;
  657. //+----------------------------------------------------------------------------
  658. //
  659. // Function: ADsPropCreateNotifyObj
  660. //
  661. // Synopsis: Checks to see if the notification window/object exists for this
  662. // sheet instance and if not creates it.
  663. //
  664. // Arguments: [pAppThdDataObj] - the unmarshalled data object pointer.
  665. // [pwzADsObjName] - object path name.
  666. // [phNotifyObj] - to return the notificion window handle.
  667. //
  668. // Returns: HRESULTs.
  669. //
  670. //-----------------------------------------------------------------------------
  671. function ADsPropCreateNotifyObj(pAppThdDataObj: Pointer; {LPDATAOBJECT}
  672. pwzADsObjName: PWSTR; var phNotifyObj: HWND): HRESULT; stdcall;
  673. {$EXTERNALSYM ADsPropCreateNotifyObj}
  674. //+----------------------------------------------------------------------------
  675. //
  676. // Function: ADsPropGetInitInfo
  677. //
  678. // Synopsis: Pages call this at their init time to retreive DS object info.
  679. //
  680. // Arguments: [hNotifyObj] - the notificion window handle.
  681. // [pInitParams] - struct filled in with DS object info. This
  682. // struct must be allocated by the caller before
  683. // the call.
  684. //
  685. // Returns: FALSE if the notify window has gone away for some reason or
  686. // if the parameters are invalid.
  687. //
  688. // Notes: This call results in the sending of the
  689. // WM_ADSPROP_NOTIFY_PAGEINIT message to the notify window.
  690. // pInitParams->pWritableAttrs can be NULL if there are no
  691. // writable attributes.
  692. //
  693. //-----------------------------------------------------------------------------
  694. function ADsPropGetInitInfo(hNotifyObj: HWND; pInitParams: PADSPROPINITPARAMS): BOOL; stdcall;
  695. {$EXTERNALSYM ADsPropGetInitInfo}
  696. //+----------------------------------------------------------------------------
  697. //
  698. // Function: ADsPropSetHwnd
  699. //
  700. // Synopsis: Pages call this at their dialog init time to send their hwnd.
  701. //
  702. // Arguments: [hNotifyObj] - the notificion window handle.
  703. // [hPage] - the page's window handle.
  704. //
  705. // Returns: FALSE if the notify window has gone away for some reason.
  706. //
  707. // Notes: Sends the WM_ADSPROP_NOTIFY_PAGEHWND message to the notify
  708. // window.
  709. //
  710. //-----------------------------------------------------------------------------
  711. function ADsPropSetHwnd(hNotifyObj: HWND; hPage: HWND): BOOL; stdcall;
  712. {$EXTERNALSYM ADsPropSetHwnd}
  713. //+----------------------------------------------------------------------------
  714. //
  715. // function: ADsPropCheckIfWritable
  716. //
  717. // Synopsis: See if the attribute is writable by checking if it is in
  718. // the allowedAttributesEffective array.
  719. //
  720. // Arguments: [pwzAttr] - the attribute name.
  721. // [pWritableAttrs] - the array of writable attributes.
  722. //
  723. // Returns: FALSE if the attribute name is not found in the writable-attrs
  724. // array or if the array pointer is NULL.
  725. //
  726. //-----------------------------------------------------------------------------
  727. function ADsPropCheckIfWritable(pwzAttr: PWSTR; pWritableAttrs: PADS_ATTR_INFO): BOOL; stdcall;
  728. {$EXTERNALSYM ADsPropCheckIfWritable}
  729. implementation
  730. const
  731. adslib = 'activeds.dll';
  732. dsprop = 'dsprop.dll';
  733. // adshlp.h
  734. function _ADsFreeEnumerator(pEnumVariant: IEnumVARIANT): HRESULT; stdcall; external adslib name 'ADsFreeEnumerator';
  735. function ADsFreeEnumerator(var pEnumVariant: IEnumVARIANT): HRESULT;
  736. begin
  737. Result := _ADsFreeEnumerator(pEnumVariant);
  738. // ADsFreeEnumerator doesn't set pEnumVariant to nil causing Delphi to call
  739. // Release() again when pEnumVariant leaves scope. Result would be an access
  740. // violation, explicitly setting the interface to nil prevents this.
  741. if Result = 0 {S_OK} then
  742. Pointer(pEnumVariant) := nil;
  743. end;
  744. //procedure ADsFreeAllErrorRecords
  745. // adsprop.h
  746. {$IFDEF DYNAMIC_LINK}
  747. var
  748. _ADsGetObject: Pointer;
  749. function ADsGetObject;
  750. begin
  751. GetProcedureAddress(_ADsGetObject, adslib, 'ADsGetObject');
  752. asm
  753. MOV ESP, EBP
  754. POP EBP
  755. JMP [_ADsGetObject]
  756. end;
  757. end;
  758. var
  759. _ADsBuildEnumerator: Pointer;
  760. function ADsBuildEnumerator;
  761. begin
  762. GetProcedureAddress(_ADsBuildEnumerator, adslib, 'ADsBuildEnumerator');
  763. asm
  764. MOV ESP, EBP
  765. POP EBP
  766. JMP [_ADsBuildEnumerator]
  767. end;
  768. end;
  769. var
  770. _ADsEnumerateNext: Pointer;
  771. function ADsEnumerateNext;
  772. begin
  773. GetProcedureAddress(_ADsEnumerateNext, adslib, 'ADsEnumerateNext');
  774. asm
  775. MOV ESP, EBP
  776. POP EBP
  777. JMP [_ADsEnumerateNext]
  778. end;
  779. end;
  780. var
  781. _ADsBuildVarArrayStr: Pointer;
  782. function ADsBuildVarArrayStr;
  783. begin
  784. GetProcedureAddress(_ADsBuildVarArrayStr, adslib, 'ADsBuildVarArrayStr');
  785. asm
  786. MOV ESP, EBP
  787. POP EBP
  788. JMP [_ADsBuildVarArrayStr]
  789. end;
  790. end;
  791. var
  792. _ADsBuildVarArrayInt: Pointer;
  793. function ADsBuildVarArrayInt;
  794. begin
  795. GetProcedureAddress(_ADsBuildVarArrayInt, adslib, 'ADsBuildVarArrayInt');
  796. asm
  797. MOV ESP, EBP
  798. POP EBP
  799. JMP [_ADsBuildVarArrayInt]
  800. end;
  801. end;
  802. var
  803. _ADsOpenObject: Pointer;
  804. function ADsOpenObject;
  805. begin
  806. GetProcedureAddress(_ADsOpenObject, adslib, 'ADsOpenObject');
  807. asm
  808. MOV ESP, EBP
  809. POP EBP
  810. JMP [_ADsOpenObject]
  811. end;
  812. end;
  813. var
  814. _ADsGetLastError: Pointer;
  815. function ADsGetLastError;
  816. begin
  817. GetProcedureAddress(_ADsGetLastError, adslib, 'ADsGetLastError');
  818. asm
  819. MOV ESP, EBP
  820. POP EBP
  821. JMP [_ADsGetLastError]
  822. end;
  823. end;
  824. var
  825. _ADsSetLastError: Pointer;
  826. procedure ADsSetLastError;
  827. begin
  828. GetProcedureAddress(_ADsSetLastError, adslib, 'ADsSetLastError');
  829. asm
  830. MOV ESP, EBP
  831. POP EBP
  832. JMP [_ADsSetLastError]
  833. end;
  834. end;
  835. var
  836. _AllocADsMem: Pointer;
  837. function AllocADsMem;
  838. begin
  839. GetProcedureAddress(_AllocADsMem, adslib, 'AllocADsMem');
  840. asm
  841. MOV ESP, EBP
  842. POP EBP
  843. JMP [_AllocADsMem]
  844. end;
  845. end;
  846. var
  847. _FreeADsMem: Pointer;
  848. function FreeADsMem;
  849. begin
  850. GetProcedureAddress(_FreeADsMem, adslib, 'FreeADsMem');
  851. asm
  852. MOV ESP, EBP
  853. POP EBP
  854. JMP [_FreeADsMem]
  855. end;
  856. end;
  857. var
  858. _ReallocADsMem: Pointer;
  859. function ReallocADsMem;
  860. begin
  861. GetProcedureAddress(_ReallocADsMem, adslib, 'ReallocADsMem');
  862. asm
  863. MOV ESP, EBP
  864. POP EBP
  865. JMP [_ReallocADsMem]
  866. end;
  867. end;
  868. var
  869. _AllocADsStr: Pointer;
  870. function AllocADsStr;
  871. begin
  872. GetProcedureAddress(_AllocADsStr, adslib, 'AllocADsStr');
  873. asm
  874. MOV ESP, EBP
  875. POP EBP
  876. JMP [_AllocADsStr]
  877. end;
  878. end;
  879. var
  880. _FreeADsStr: Pointer;
  881. function FreeADsStr;
  882. begin
  883. GetProcedureAddress(_FreeADsStr, adslib, 'FreeADsStr');
  884. asm
  885. MOV ESP, EBP
  886. POP EBP
  887. JMP [_FreeADsStr]
  888. end;
  889. end;
  890. var
  891. _ReallocADsStr: Pointer;
  892. function ReallocADsStr;
  893. begin
  894. GetProcedureAddress(_ReallocADsStr, adslib, 'ReallocADsStr');
  895. asm
  896. MOV ESP, EBP
  897. POP EBP
  898. JMP [_ReallocADsStr]
  899. end;
  900. end;
  901. var
  902. _ADsEncodeBinaryData: Pointer;
  903. function ADsEncodeBinaryData;
  904. begin
  905. GetProcedureAddress(_ADsEncodeBinaryData, adslib, 'ADsEncodeBinaryData');
  906. asm
  907. MOV ESP, EBP
  908. POP EBP
  909. JMP [_ADsEncodeBinaryData]
  910. end;
  911. end;
  912. var
  913. _ADsDecodeBinaryData: Pointer;
  914. function ADsDecodeBinaryData;
  915. begin
  916. GetProcedureAddress(_ADsDecodeBinaryData, adslib, 'ADsDecodeBinaryData');
  917. asm
  918. MOV ESP, EBP
  919. POP EBP
  920. JMP [_ADsDecodeBinaryData]
  921. end;
  922. end;
  923. var
  924. _PropVariantToAdsType: Pointer;
  925. function PropVariantToAdsType;
  926. begin
  927. GetProcedureAddress(_PropVariantToAdsType, adslib, 'PropVariantToAdsType');
  928. asm
  929. MOV ESP, EBP
  930. POP EBP
  931. JMP [_PropVariantToAdsType]
  932. end;
  933. end;
  934. var
  935. _AdsTypeToPropVariant: Pointer;
  936. function AdsTypeToPropVariant;
  937. begin
  938. GetProcedureAddress(_AdsTypeToPropVariant, adslib, 'AdsTypeToPropVariant');
  939. asm
  940. MOV ESP, EBP
  941. POP EBP
  942. JMP [_AdsTypeToPropVariant]
  943. end;
  944. end;
  945. var
  946. _AdsFreeAdsValues: Pointer;
  947. procedure AdsFreeAdsValues;
  948. begin
  949. GetProcedureAddress(_AdsFreeAdsValues, adslib, 'AdsFreeAdsValues');
  950. asm
  951. MOV ESP, EBP
  952. POP EBP
  953. JMP [_AdsFreeAdsValues]
  954. end;
  955. end;
  956. var
  957. _ADsPropCreateNotifyObj: Pointer;
  958. function ADsPropCreateNotifyObj;
  959. begin
  960. GetProcedureAddress(_ADsPropCreateNotifyObj, dsprop, 'ADsPropCreateNotifyObj');
  961. asm
  962. MOV ESP, EBP
  963. POP EBP
  964. JMP [_ADsPropCreateNotifyObj]
  965. end;
  966. end;
  967. var
  968. _ADsPropGetInitInfo: Pointer;
  969. function ADsPropGetInitInfo;
  970. begin
  971. GetProcedureAddress(_ADsPropGetInitInfo, dsprop, 'ADsPropGetInitInfo');
  972. asm
  973. MOV ESP, EBP
  974. POP EBP
  975. JMP [_ADsPropGetInitInfo]
  976. end;
  977. end;
  978. var
  979. _ADsPropSetHwnd: Pointer;
  980. function ADsPropSetHwnd;
  981. begin
  982. GetProcedureAddress(_ADsPropSetHwnd, dsprop, 'ADsPropSetHwnd');
  983. asm
  984. MOV ESP, EBP
  985. POP EBP
  986. JMP [_ADsPropSetHwnd]
  987. end;
  988. end;
  989. var
  990. _ADsPropCheckIfWritable: Pointer;
  991. function ADsPropCheckIfWritable;
  992. begin
  993. GetProcedureAddress(_ADsPropCheckIfWritable, dsprop, 'ADsPropCheckIfWritable');
  994. asm
  995. MOV ESP, EBP
  996. POP EBP
  997. JMP [_ADsPropCheckIfWritable]
  998. end;
  999. end;
  1000. {$ELSE}
  1001. function ADsGetObject; external adslib name 'ADsGetObject';
  1002. function ADsBuildEnumerator; external adslib name 'ADsBuildEnumerator';
  1003. function ADsEnumerateNext; external adslib name 'ADsEnumerateNext';
  1004. function ADsBuildVarArrayStr; external adslib name 'ADsBuildVarArrayStr';
  1005. function ADsBuildVarArrayInt; external adslib name 'ADsBuildVarArrayInt';
  1006. function ADsOpenObject; external adslib name 'ADsOpenObject';
  1007. function ADsGetLastError; external adslib name 'ADsGetLastError';
  1008. procedure ADsSetLastError; external adslib name 'ADsSetLastError';
  1009. function AllocADsMem; external adslib name 'AllocADsMem';
  1010. function FreeADsMem; external adslib name 'FreeADsMem';
  1011. function ReallocADsMem; external adslib name 'ReallocADsMem';
  1012. function AllocADsStr; external adslib name 'AllocADsStr';
  1013. function FreeADsStr; external adslib name 'FreeADsStr';
  1014. function ReallocADsStr; external adslib name 'ReallocADsStr';
  1015. function ADsEncodeBinaryData; external adslib name 'ADsEncodeBinaryData';
  1016. function ADsDecodeBinaryData; external adslib name 'ADsDecodeBinaryData';
  1017. function PropVariantToAdsType; external adslib name 'PropVariantToAdsType';
  1018. function AdsTypeToPropVariant; external adslib name 'AdsTypeToPropVariant';
  1019. procedure AdsFreeAdsValues; external adslib name 'AdsFreeAdsValues';
  1020. function ADsPropCreateNotifyObj; external dsprop name 'ADsPropCreateNotifyObj';
  1021. function ADsPropGetInitInfo; external dsprop name 'ADsPropGetInitInfo';
  1022. function ADsPropSetHwnd; external dsprop name 'ADsPropSetHwnd';
  1023. function ADsPropCheckIfWritable; external dsprop name 'ADsPropCheckIfWritable';
  1024. {$ENDIF DYNAMIC_LINK}
  1025. end.