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. // $Id: JwaActiveDS.pas,v 1.10 2005/09/06 16:36:50 marquardt Exp $
  43. unit JwaActiveDS;
  44. {$WEAKPACKAGEUNIT}
  45. {$I jediapilib.inc}
  46. interface
  47. uses
  48. JwaActiveX, JwaAdsTLB, JwaWindows;
  49. {$HPPEMIT ''}
  50. {$HPPEMIT '#include "activeds.h"'}
  51. {$HPPEMIT ''}
  52. {$HPPEMIT 'typedef GUID REFIID'}
  53. {$HPPEMIT ''}
  54. type
  55. REFIID = GUID;
  56. {$NODEFINE REFIID}
  57. type
  58. // imports of a type library sometimes are missing a few decls, these are just
  59. // a few of them to make this file compile at all. I really should do all of
  60. // them one day.
  61. PADSVALUE = ^_adsvalue;
  62. {$EXTERNALSYM PADSVALUE}
  63. PADS_ATTR_INFO = ^_ads_attr_info;
  64. {$EXTERNALSYM PADS_ATTR_INFO}
  65. // Contents: Master include file for Ole Ds
  66. //
  67. // Notes: All Ole Ds client applications must include this file. This
  68. // provides access to the primary Ole Ds interfaces, the error
  69. // codes, and function prototypes for the Ole Ds helper apis.
  70. //
  71. // Interface definitions and well known GUIDS for Ole Ds
  72. //
  73. //#include "iads.h" >> AdsTLB from activeds.dll
  74. //
  75. // Helper function prototypes for Ole Ds
  76. //
  77. //#include "adshlp.h"
  78. function ADsGetObject(lpszPathName: LPCWSTR; const riid: REFIID; out ppObject: Pointer): HRESULT; stdcall;
  79. {$EXTERNALSYM ADsGetObject}
  80. function ADsBuildEnumerator(pADsContainer: IADsContainer; out ppEnumVariant: IEnumVARIANT): HRESULT; stdcall;
  81. {$EXTERNALSYM ADsBuildEnumerator}
  82. function ADsFreeEnumerator(var pEnumVariant: IEnumVARIANT): HRESULT;
  83. {$EXTERNALSYM ADsFreeEnumerator}
  84. function ADsEnumerateNext(pEnumVariant: IEnumVARIANT; cElements: ULONG;
  85. var pvar: OleVariant; var pcElementsFetched: ULONG): HRESULT; stdcall;
  86. {$EXTERNALSYM ADsEnumerateNext}
  87. function ADsBuildVarArrayStr(lppPathNames: LPWSTR; dwPathNames: DWORD;
  88. var pVar: OleVariant): HRESULT; stdcall;
  89. {$EXTERNALSYM ADsBuildVarArrayStr}
  90. function ADsBuildVarArrayInt(lpdwObjectTypes: LPDWORD; dwObjectTypes: DWORD;
  91. var pVar: OleVariant): HRESULT; stdcall;
  92. {$EXTERNALSYM ADsBuildVarArrayInt}
  93. function ADsOpenObject(lpszPathName, lpszUserName, lpszPassword: LPCWSTR;
  94. dwReserved: DWORD; const riid: REFIID; out ppObject: Pointer): HRESULT; stdcall;
  95. {$EXTERNALSYM ADsOpenObject}
  96. //
  97. // Helper functions for extended error support
  98. //
  99. function ADsGetLastError(var lpError: DWORD; lpErrorBuf: LPWSTR;
  100. dwErrorBufLen: DWORD; lpNameBuf: LPWSTR; dwNameBufLen: DWORD): HRESULT; stdcall;
  101. {$EXTERNALSYM ADsGetLastError}
  102. procedure ADsSetLastError(dwErr: DWORD; pszError, pszProvider: LPCWSTR); stdcall;
  103. {$EXTERNALSYM ADsSetLastError}
  104. //procedure ADsFreeAllErrorRecords; stdcall;
  105. //{$EXTERNALSYM ADsFreeAllErrorRecords}
  106. function AllocADsMem(cb: DWORD): LPVOID; stdcall;
  107. {$EXTERNALSYM AllocADsMem}
  108. function FreeADsMem(pMem: LPVOID): BOOL; stdcall;
  109. {$EXTERNALSYM FreeADsMem}
  110. function ReallocADsMem(pOldMem: LPVOID; cbOld, cbNew: DWORD): LPVOID; stdcall;
  111. {$EXTERNALSYM ReallocADsMem}
  112. function AllocADsStr(pStr: LPCWSTR): LPWSTR; stdcall;
  113. {$EXTERNALSYM AllocADsStr}
  114. function FreeADsStr(pStr: LPWSTR): BOOL; stdcall;
  115. {$EXTERNALSYM FreeADsStr}
  116. function ReallocADsStr(var ppStr: LPWSTR; pStr: LPWSTR): BOOL; stdcall;
  117. {$EXTERNALSYM ReallocADsStr}
  118. function ADsEncodeBinaryData(pbSrcData: PBYTE; dwSrcLen: DWORD;
  119. var ppszDestData: LPWSTR): HRESULT; stdcall;
  120. {$EXTERNALSYM ADsEncodeBinaryData}
  121. function ADsDecodeBinaryData(szSrcData: LPCWSTR; var ppbDestData: PBYTE;
  122. var pdwDestLen: ULONG): HRESULT; stdcall;
  123. {$EXTERNALSYM ADsDecodeBinaryData}
  124. function PropVariantToAdsType(var pVariant: OleVariant; dwNumVariant: DWORD;
  125. var ppAdsValues: PADSVALUE; pdwNumValues: PDWORD): HRESULT; stdcall;
  126. {$EXTERNALSYM PropVariantToAdsType}
  127. function AdsTypeToPropVariant(pAdsValues: PADSVALUE; dwNumValues: DWORD;
  128. var pVariant: OleVariant): HRESULT; stdcall;
  129. {$EXTERNALSYM AdsTypeToPropVariant}
  130. procedure AdsFreeAdsValues(pAdsValues: PADSVALUE; dwNumValues: DWORD); stdcall;
  131. {$EXTERNALSYM AdsFreeAdsValues}
  132. //
  133. // Error codes for Ole Ds - generated from ..\..\errmsg
  134. //
  135. //#include "adserr.h"
  136. // ---------------------- HRESULT value definitions -----------------
  137. //
  138. // HRESULT definitions
  139. //
  140. //
  141. // Values are 32 bit values layed out as follows:
  142. //
  143. // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  144. // 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
  145. // +---+-+-+-----------------------+-------------------------------+
  146. // |Sev|C|R| Facility | Code |
  147. // +---+-+-+-----------------------+-------------------------------+
  148. //
  149. // where
  150. //
  151. // Sev - is the severity code
  152. //
  153. // 00 - Success
  154. // 01 - Informational
  155. // 10 - Warning
  156. // 11 - Error
  157. //
  158. // C - is the Customer code flag
  159. //
  160. // R - is a reserved bit
  161. //
  162. // Facility - is the facility code
  163. //
  164. // Code - is the facility's status code
  165. //
  166. //
  167. // Define the facility codes
  168. //
  169. const
  170. FACILITY_WINDOWS = 8;
  171. {$EXTERNALSYM FACILITY_WINDOWS}
  172. FACILITY_STORAGE = 3;
  173. {$EXTERNALSYM FACILITY_STORAGE}
  174. FACILITY_RPC = 1;
  175. {$EXTERNALSYM FACILITY_RPC}
  176. FACILITY_SSPI = 9;
  177. {$EXTERNALSYM FACILITY_SSPI}
  178. FACILITY_WIN32 = 7;
  179. {$EXTERNALSYM FACILITY_WIN32}
  180. FACILITY_CONTROL = 10;
  181. {$EXTERNALSYM FACILITY_CONTROL}
  182. FACILITY_NULL = 0;
  183. {$EXTERNALSYM FACILITY_NULL}
  184. FACILITY_ITF = 4;
  185. {$EXTERNALSYM FACILITY_ITF}
  186. FACILITY_DISPATCH = 2;
  187. {$EXTERNALSYM FACILITY_DISPATCH}
  188. //
  189. // Define the severity codes
  190. //
  191. //
  192. // MessageId: E_ADS_BAD_PATHNAME
  193. //
  194. // MessageText:
  195. //
  196. // An invalid Active Directory pathname was passed
  197. //
  198. E_ADS_BAD_PATHNAME = HRESULT($80005000);
  199. {$EXTERNALSYM E_ADS_BAD_PATHNAME}
  200. //
  201. // MessageId: E_ADS_INVALID_DOMAIN_OBJECT
  202. //
  203. // MessageText:
  204. //
  205. // An unknown Active Directory domain object was requested
  206. //
  207. E_ADS_INVALID_DOMAIN_OBJECT = HRESULT($80005001);
  208. {$EXTERNALSYM E_ADS_INVALID_DOMAIN_OBJECT}
  209. //
  210. // MessageId: E_ADS_INVALID_USER_OBJECT
  211. //
  212. // MessageText:
  213. //
  214. // An unknown Active Directory user object was requested
  215. //
  216. E_ADS_INVALID_USER_OBJECT = HRESULT($80005002);
  217. {$EXTERNALSYM E_ADS_INVALID_USER_OBJECT}
  218. //
  219. // MessageId: E_ADS_INVALID_COMPUTER_OBJECT
  220. //
  221. // MessageText:
  222. //
  223. // An unknown Active Directory computer object was requested
  224. //
  225. E_ADS_INVALID_COMPUTER_OBJECT = HRESULT($80005003);
  226. {$EXTERNALSYM E_ADS_INVALID_COMPUTER_OBJECT}
  227. //
  228. // MessageId: E_ADS_UNKNOWN_OBJECT
  229. //
  230. // MessageText:
  231. //
  232. // An unknown Active Directory object was requested
  233. //
  234. E_ADS_UNKNOWN_OBJECT = HRESULT($80005004);
  235. {$EXTERNALSYM E_ADS_UNKNOWN_OBJECT}
  236. //
  237. // MessageId: E_ADS_PROPERTY_NOT_SET
  238. //
  239. // MessageText:
  240. //
  241. // The specified Active Directory property was not set
  242. //
  243. E_ADS_PROPERTY_NOT_SET = HRESULT($80005005);
  244. {$EXTERNALSYM E_ADS_PROPERTY_NOT_SET}
  245. //
  246. // MessageId: E_ADS_PROPERTY_NOT_SUPPORTED
  247. //
  248. // MessageText:
  249. //
  250. // The specified Active Directory property is not supported
  251. //
  252. E_ADS_PROPERTY_NOT_SUPPORTED = HRESULT($80005006);
  253. {$EXTERNALSYM E_ADS_PROPERTY_NOT_SUPPORTED}
  254. //
  255. // MessageId: E_ADS_PROPERTY_INVALID
  256. //
  257. // MessageText:
  258. //
  259. // The specified Active Directory property is invalid
  260. //
  261. E_ADS_PROPERTY_INVALID = HRESULT($80005007);
  262. {$EXTERNALSYM E_ADS_PROPERTY_INVALID}
  263. //
  264. // MessageId: E_ADS_BAD_PARAMETER
  265. //
  266. // MessageText:
  267. //
  268. // One or more input parameters are invalid
  269. //
  270. E_ADS_BAD_PARAMETER = HRESULT($80005008);
  271. {$EXTERNALSYM E_ADS_BAD_PARAMETER}
  272. //
  273. // MessageId: E_ADS_OBJECT_UNBOUND
  274. //
  275. // MessageText:
  276. //
  277. // The specified Active Directory object is not bound to a remote resource
  278. //
  279. E_ADS_OBJECT_UNBOUND = HRESULT($80005009);
  280. {$EXTERNALSYM E_ADS_OBJECT_UNBOUND}
  281. //
  282. // MessageId: E_ADS_PROPERTY_NOT_MODIFIED
  283. //
  284. // MessageText:
  285. //
  286. // The specified Active Directory object has not been modified
  287. //
  288. E_ADS_PROPERTY_NOT_MODIFIED = HRESULT($8000500A);
  289. {$EXTERNALSYM E_ADS_PROPERTY_NOT_MODIFIED}
  290. //
  291. // MessageId: E_ADS_PROPERTY_MODIFIED
  292. //
  293. // MessageText:
  294. //
  295. // The specified Active Directory object has not been modified
  296. //
  297. E_ADS_PROPERTY_MODIFIED = HRESULT($8000500B);
  298. {$EXTERNALSYM E_ADS_PROPERTY_MODIFIED}
  299. //
  300. // MessageId: E_ADS_CANT_CONVERT_DATATYPE
  301. //
  302. // MessageText:
  303. //
  304. // The Active Directory datatype cannot be converted to/from a native DS datatype
  305. //
  306. E_ADS_CANT_CONVERT_DATATYPE = HRESULT($8000500C);
  307. {$EXTERNALSYM E_ADS_CANT_CONVERT_DATATYPE}
  308. //
  309. // MessageId: E_ADS_PROPERTY_NOT_FOUND
  310. //
  311. // MessageText:
  312. //
  313. // The Active Directory property cannot be found in the cache.
  314. //
  315. E_ADS_PROPERTY_NOT_FOUND = HRESULT($8000500D);
  316. {$EXTERNALSYM E_ADS_PROPERTY_NOT_FOUND}
  317. //
  318. // MessageId: E_ADS_OBJECT_EXISTS
  319. //
  320. // MessageText:
  321. //
  322. // The Active Directory object exists.
  323. //
  324. E_ADS_OBJECT_EXISTS = HRESULT($8000500E);
  325. {$EXTERNALSYM E_ADS_OBJECT_EXISTS}
  326. //
  327. // MessageId: E_ADS_SCHEMA_VIOLATION
  328. //
  329. // MessageText:
  330. //
  331. // The attempted action violates the DS schema rules.
  332. //
  333. E_ADS_SCHEMA_VIOLATION = HRESULT($8000500F);
  334. {$EXTERNALSYM E_ADS_SCHEMA_VIOLATION}
  335. //
  336. // MessageId: E_ADS_COLUMN_NOT_SET
  337. //
  338. // MessageText:
  339. //
  340. // The specified column in the Active Directory was not set.
  341. //
  342. E_ADS_COLUMN_NOT_SET = HRESULT($80005010);
  343. {$EXTERNALSYM E_ADS_COLUMN_NOT_SET}
  344. //
  345. // MessageId: S_ADS_ERRORSOCCURRED
  346. //
  347. // MessageText:
  348. //
  349. // One or more errors occurred
  350. //
  351. S_ADS_ERRORSOCCURRED = HRESULT($00005011);
  352. {$EXTERNALSYM S_ADS_ERRORSOCCURRED}
  353. //
  354. // MessageId: S_ADS_NOMORE_ROWS
  355. //
  356. // MessageText:
  357. //
  358. // No more rows to be obatained by the search result.
  359. //
  360. S_ADS_NOMORE_ROWS = HRESULT($00005012);
  361. {$EXTERNALSYM S_ADS_NOMORE_ROWS}
  362. //
  363. // MessageId: S_ADS_NOMORE_COLUMNS
  364. //
  365. // MessageText:
  366. //
  367. // No more columns to be obatained for the current row.
  368. //
  369. S_ADS_NOMORE_COLUMNS = HRESULT($00005013);
  370. {$EXTERNALSYM S_ADS_NOMORE_COLUMNS}
  371. //
  372. // MessageId: E_ADS_INVALID_FILTER
  373. //
  374. // MessageText:
  375. //
  376. // The search filter specified is invalid
  377. //
  378. E_ADS_INVALID_FILTER = HRESULT($80005014);
  379. {$EXTERNALSYM E_ADS_INVALID_FILTER}
  380. //
  381. // Globally accessible GUIDS
  382. //
  383. //#include "adsiid.h" -> adstlb from activeds.dll
  384. //
  385. // Status codes for ads objects
  386. //
  387. //#include "adssts.h"
  388. const
  389. ADS_PRINTER_PAUSED = $00000001;
  390. {$EXTERNALSYM ADS_PRINTER_PAUSED}
  391. ADS_PRINTER_PENDING_DELETION = $00000002;
  392. {$EXTERNALSYM ADS_PRINTER_PENDING_DELETION}
  393. ADS_PRINTER_ERROR = $00000003;
  394. {$EXTERNALSYM ADS_PRINTER_ERROR}
  395. ADS_PRINTER_PAPER_JAM = $00000004;
  396. {$EXTERNALSYM ADS_PRINTER_PAPER_JAM}
  397. ADS_PRINTER_PAPER_OUT = $00000005;
  398. {$EXTERNALSYM ADS_PRINTER_PAPER_OUT}
  399. ADS_PRINTER_MANUAL_FEED = $00000006;
  400. {$EXTERNALSYM ADS_PRINTER_MANUAL_FEED}
  401. ADS_PRINTER_PAPER_PROBLEM = $00000007;
  402. {$EXTERNALSYM ADS_PRINTER_PAPER_PROBLEM}
  403. ADS_PRINTER_OFFLINE = $00000008;
  404. {$EXTERNALSYM ADS_PRINTER_OFFLINE}
  405. ADS_PRINTER_IO_ACTIVE = $00000100;
  406. {$EXTERNALSYM ADS_PRINTER_IO_ACTIVE}
  407. ADS_PRINTER_BUSY = $00000200;
  408. {$EXTERNALSYM ADS_PRINTER_BUSY}
  409. ADS_PRINTER_PRINTING = $00000400;
  410. {$EXTERNALSYM ADS_PRINTER_PRINTING}
  411. ADS_PRINTER_OUTPUT_BIN_FULL = $00000800;
  412. {$EXTERNALSYM ADS_PRINTER_OUTPUT_BIN_FULL}
  413. ADS_PRINTER_NOT_AVAILABLE = $00001000;
  414. {$EXTERNALSYM ADS_PRINTER_NOT_AVAILABLE}
  415. ADS_PRINTER_WAITING = $00002000;
  416. {$EXTERNALSYM ADS_PRINTER_WAITING}
  417. ADS_PRINTER_PROCESSING = $00004000;
  418. {$EXTERNALSYM ADS_PRINTER_PROCESSING}
  419. ADS_PRINTER_INITIALIZING = $00008000;
  420. {$EXTERNALSYM ADS_PRINTER_INITIALIZING}
  421. ADS_PRINTER_WARMING_UP = $00010000;
  422. {$EXTERNALSYM ADS_PRINTER_WARMING_UP}
  423. ADS_PRINTER_TONER_LOW = $00020000;
  424. {$EXTERNALSYM ADS_PRINTER_TONER_LOW}
  425. ADS_PRINTER_NO_TONER = $00040000;
  426. {$EXTERNALSYM ADS_PRINTER_NO_TONER}
  427. ADS_PRINTER_PAGE_PUNT = $00080000;
  428. {$EXTERNALSYM ADS_PRINTER_PAGE_PUNT}
  429. ADS_PRINTER_USER_INTERVENTION = $00100000;
  430. {$EXTERNALSYM ADS_PRINTER_USER_INTERVENTION}
  431. ADS_PRINTER_OUT_OF_MEMORY = $00200000;
  432. {$EXTERNALSYM ADS_PRINTER_OUT_OF_MEMORY}
  433. ADS_PRINTER_DOOR_OPEN = $00400000;
  434. {$EXTERNALSYM ADS_PRINTER_DOOR_OPEN}
  435. ADS_PRINTER_SERVER_UNKNOWN = $00800000;
  436. {$EXTERNALSYM ADS_PRINTER_SERVER_UNKNOWN}
  437. ADS_PRINTER_POWER_SAVE = $01000000;
  438. {$EXTERNALSYM ADS_PRINTER_POWER_SAVE}
  439. //
  440. // job status values
  441. //
  442. ADS_JOB_PAUSED = $00000001;
  443. {$EXTERNALSYM ADS_JOB_PAUSED}
  444. ADS_JOB_ERROR = $00000002;
  445. {$EXTERNALSYM ADS_JOB_ERROR}
  446. ADS_JOB_DELETING = $00000004;
  447. {$EXTERNALSYM ADS_JOB_DELETING}
  448. ADS_JOB_SPOOLING = $00000008;
  449. {$EXTERNALSYM ADS_JOB_SPOOLING}
  450. ADS_JOB_PRINTING = $00000010;
  451. {$EXTERNALSYM ADS_JOB_PRINTING}
  452. ADS_JOB_OFFLINE = $00000020;
  453. {$EXTERNALSYM ADS_JOB_OFFLINE}
  454. ADS_JOB_PAPEROUT = $00000040;
  455. {$EXTERNALSYM ADS_JOB_PAPEROUT}
  456. ADS_JOB_PRINTED = $00000080;
  457. {$EXTERNALSYM ADS_JOB_PRINTED}
  458. ADS_JOB_DELETED = $00000100;
  459. {$EXTERNALSYM ADS_JOB_DELETED}
  460. //
  461. // service status values
  462. //
  463. ADS_SERVICE_STOPPED = $00000001;
  464. {$EXTERNALSYM ADS_SERVICE_STOPPED}
  465. ADS_SERVICE_START_PENDING = $00000002;
  466. {$EXTERNALSYM ADS_SERVICE_START_PENDING}
  467. ADS_SERVICE_STOP_PENDING = $00000003;
  468. {$EXTERNALSYM ADS_SERVICE_STOP_PENDING}
  469. ADS_SERVICE_RUNNING = $00000004;
  470. {$EXTERNALSYM ADS_SERVICE_RUNNING}
  471. ADS_SERVICE_CONTINUE_PENDING = $00000005;
  472. {$EXTERNALSYM ADS_SERVICE_CONTINUE_PENDING}
  473. ADS_SERVICE_PAUSE_PENDING = $00000006;
  474. {$EXTERNALSYM ADS_SERVICE_PAUSE_PENDING}
  475. ADS_SERVICE_PAUSED = $00000007;
  476. {$EXTERNALSYM ADS_SERVICE_PAUSED}
  477. ADS_SERVICE_ERROR = $00000008;
  478. {$EXTERNALSYM ADS_SERVICE_ERROR}
  479. //---------------------------------------------------------------------
  480. //
  481. // Service Type Valid Values
  482. //
  483. ADS_SERVICE_OWN_PROCESS = $00000010;
  484. {$EXTERNALSYM ADS_SERVICE_OWN_PROCESS}
  485. ADS_SERVICE_SHARE_PROCESS = $00000020;
  486. {$EXTERNALSYM ADS_SERVICE_SHARE_PROCESS}
  487. ADS_SERVICE_KERNEL_DRIVER = $00000001;
  488. {$EXTERNALSYM ADS_SERVICE_KERNEL_DRIVER}
  489. ADS_SERVICE_FILE_SYSTEM_DRIVER = $00000002;
  490. {$EXTERNALSYM ADS_SERVICE_FILE_SYSTEM_DRIVER}
  491. //
  492. // Start Type Valid Values
  493. //
  494. ADS_SERVICE_BOOT_START = SERVICE_BOOT_START;
  495. {$EXTERNALSYM ADS_SERVICE_BOOT_START}
  496. ADS_SERVICE_SYSTEM_START = SERVICE_SYSTEM_START;
  497. {$EXTERNALSYM ADS_SERVICE_SYSTEM_START}
  498. ADS_SERVICE_AUTO_START = SERVICE_AUTO_START;
  499. {$EXTERNALSYM ADS_SERVICE_AUTO_START}
  500. ADS_SERVICE_DEMAND_START = SERVICE_DEMAND_START;
  501. {$EXTERNALSYM ADS_SERVICE_DEMAND_START}
  502. ADS_SERVICE_DISABLED = SERVICE_DISABLED;
  503. {$EXTERNALSYM ADS_SERVICE_DISABLED}
  504. //
  505. // Error Control Values
  506. //
  507. ADS_SERVICE_ERROR_IGNORE = 0;
  508. {$EXTERNALSYM ADS_SERVICE_ERROR_IGNORE}
  509. ADS_SERVICE_ERROR_NORMAL = 1;
  510. {$EXTERNALSYM ADS_SERVICE_ERROR_NORMAL}
  511. ADS_SERVICE_ERROR_SEVERE = 2;
  512. {$EXTERNALSYM ADS_SERVICE_ERROR_SEVERE}
  513. ADS_SERVICE_ERROR_CRITICAL = 3;
  514. {$EXTERNALSYM ADS_SERVICE_ERROR_CRITICAL}
  515. //
  516. // Schema class names and other schema related definitions
  517. //
  518. //#include "adsnms.h"
  519. const
  520. NAMESPACE_CLASS_NAME = 'Namespace';
  521. {$EXTERNALSYM NAMESPACE_CLASS_NAME}
  522. COUNTRY_CLASS_NAME = 'Country';
  523. {$EXTERNALSYM COUNTRY_CLASS_NAME}
  524. LOCALITY_CLASS_NAME = 'Locality';
  525. {$EXTERNALSYM LOCALITY_CLASS_NAME}
  526. ORGANIZATION_CLASS_NAME = 'Organization';
  527. {$EXTERNALSYM ORGANIZATION_CLASS_NAME}
  528. ORGANIZATIONUNIT_CLASS_NAME = 'Organizational Unit';
  529. {$EXTERNALSYM ORGANIZATIONUNIT_CLASS_NAME}
  530. DOMAIN_CLASS_NAME = 'Domain';
  531. {$EXTERNALSYM DOMAIN_CLASS_NAME}
  532. COMPUTER_CLASS_NAME = 'Computer';
  533. {$EXTERNALSYM COMPUTER_CLASS_NAME}
  534. USER_CLASS_NAME = 'User';
  535. {$EXTERNALSYM USER_CLASS_NAME}
  536. GROUP_CLASS_NAME = 'Group';
  537. {$EXTERNALSYM GROUP_CLASS_NAME}
  538. GLOBALGROUP_CLASS_NAME = 'GlobalGroup';
  539. {$EXTERNALSYM GLOBALGROUP_CLASS_NAME}
  540. LOCALGROUP_CLASS_NAME = 'LocalGroup';
  541. {$EXTERNALSYM LOCALGROUP_CLASS_NAME}
  542. SERVICE_CLASS_NAME = 'Service';
  543. {$EXTERNALSYM SERVICE_CLASS_NAME}
  544. FILESERVICE_CLASS_NAME = 'FileService';
  545. {$EXTERNALSYM FILESERVICE_CLASS_NAME}
  546. SESSION_CLASS_NAME = 'Session';
  547. {$EXTERNALSYM SESSION_CLASS_NAME}
  548. RESOURCE_CLASS_NAME = 'Resource';
  549. {$EXTERNALSYM RESOURCE_CLASS_NAME}
  550. FILESHARE_CLASS_NAME = 'FileShare';
  551. {$EXTERNALSYM FILESHARE_CLASS_NAME}
  552. PRINTER_CLASS_NAME = 'PrintQueue';
  553. {$EXTERNALSYM PRINTER_CLASS_NAME}
  554. PRINTJOB_CLASS_NAME = 'PrintJob';
  555. {$EXTERNALSYM PRINTJOB_CLASS_NAME}
  556. SCHEMA_CLASS_NAME = 'Schema';
  557. {$EXTERNALSYM SCHEMA_CLASS_NAME}
  558. CLASS_CLASS_NAME = 'Class';
  559. {$EXTERNALSYM CLASS_CLASS_NAME}
  560. PROPERTY_CLASS_NAME = 'Property';
  561. {$EXTERNALSYM PROPERTY_CLASS_NAME}
  562. SYNTAX_CLASS_NAME = 'Syntax';
  563. {$EXTERNALSYM SYNTAX_CLASS_NAME}
  564. ROOTDSE_CLASS_NAME = 'RootDSE';
  565. {$EXTERNALSYM ROOTDSE_CLASS_NAME}
  566. NO_SCHEMA = '';
  567. {$EXTERNALSYM NO_SCHEMA}
  568. DOMAIN_SCHEMA_NAME = 'Domain';
  569. {$EXTERNALSYM DOMAIN_SCHEMA_NAME}
  570. COMPUTER_SCHEMA_NAME = 'Computer';
  571. {$EXTERNALSYM COMPUTER_SCHEMA_NAME}
  572. USER_SCHEMA_NAME = 'User';
  573. {$EXTERNALSYM USER_SCHEMA_NAME}
  574. GROUP_SCHEMA_NAME = 'Group';
  575. {$EXTERNALSYM GROUP_SCHEMA_NAME}
  576. GLOBALGROUP_SCHEMA_NAME = 'GlobalGroup';
  577. {$EXTERNALSYM GLOBALGROUP_SCHEMA_NAME}
  578. LOCALGROUP_SCHEMA_NAME = 'LocalGroup';
  579. {$EXTERNALSYM LOCALGROUP_SCHEMA_NAME}
  580. SERVICE_SCHEMA_NAME = 'Service';
  581. {$EXTERNALSYM SERVICE_SCHEMA_NAME}
  582. PRINTER_SCHEMA_NAME = 'PrintQueue';
  583. {$EXTERNALSYM PRINTER_SCHEMA_NAME}
  584. PRINTJOB_SCHEMA_NAME = 'PrintJob';
  585. {$EXTERNALSYM PRINTJOB_SCHEMA_NAME}
  586. FILESERVICE_SCHEMA_NAME = 'FileService';
  587. {$EXTERNALSYM FILESERVICE_SCHEMA_NAME}
  588. SESSION_SCHEMA_NAME = 'Session';
  589. {$EXTERNALSYM SESSION_SCHEMA_NAME}
  590. RESOURCE_SCHEMA_NAME = 'Resource';
  591. {$EXTERNALSYM RESOURCE_SCHEMA_NAME}
  592. FILESHARE_SCHEMA_NAME = 'FileShare';
  593. {$EXTERNALSYM FILESHARE_SCHEMA_NAME}
  594. FPNW_FILESERVICE_SCHEMA_NAME = 'FPNWFileService';
  595. {$EXTERNALSYM FPNW_FILESERVICE_SCHEMA_NAME}
  596. FPNW_SESSION_SCHEMA_NAME = 'FPNWSession';
  597. {$EXTERNALSYM FPNW_SESSION_SCHEMA_NAME}
  598. FPNW_RESOURCE_SCHEMA_NAME = 'FPNWResource';
  599. {$EXTERNALSYM FPNW_RESOURCE_SCHEMA_NAME}
  600. FPNW_FILESHARE_SCHEMA_NAME = 'FPNWFileShare';
  601. {$EXTERNALSYM FPNW_FILESHARE_SCHEMA_NAME}
  602. //
  603. // Definitions in the OLE DB provider for ADSI
  604. //
  605. //#include "adsdb.h"
  606. //
  607. // printer status values
  608. //
  609. // Most of the constants have been moved into an enum in adstype.h and
  610. // are available publicly in iads.h. This file has been left here so that
  611. // old references to adsdb.h do not break compiles.
  612. const
  613. DBPROPFLAGS_ADSISEARCH = $0000C000;
  614. {$EXTERNALSYM DBPROPFLAGS_ADSISEARCH}
  615. //#include "adsprop.h"
  616. // Windows NT Active Directory Service Property Pages
  617. //
  618. // Contents: Functions and definitions used in the creation of AD property
  619. // sheets.
  620. const
  621. WM_ADSPROP_NOTIFY_PAGEINIT = WM_USER + 1101; // where LPARAM is the PADSPROPINITPARAMS pointer.
  622. {$EXTERNALSYM WM_ADSPROP_NOTIFY_PAGEINIT}
  623. WM_ADSPROP_NOTIFY_PAGEHWND = WM_USER + 1102; // where WPARAM => page's HWND
  624. {$EXTERNALSYM WM_ADSPROP_NOTIFY_PAGEHWND}
  625. WM_ADSPROP_NOTIFY_CHANGE = WM_USER + 1103; // used to send a change notification to a parent sheet
  626. {$EXTERNALSYM WM_ADSPROP_NOTIFY_CHANGE}
  627. WM_ADSPROP_NOTIFY_APPLY = WM_USER + 1104; // pages send this to the notification object.
  628. {$EXTERNALSYM WM_ADSPROP_NOTIFY_APPLY}
  629. WM_ADSPROP_NOTIFY_SETFOCUS = WM_USER + 1105; // used internally by the notification object.
  630. {$EXTERNALSYM WM_ADSPROP_NOTIFY_SETFOCUS}
  631. WM_ADSPROP_NOTIFY_FOREGROUND = WM_USER + 1106; // used internally by the notification object.
  632. {$EXTERNALSYM WM_ADSPROP_NOTIFY_FOREGROUND}
  633. WM_ADSPROP_NOTIFY_EXIT = WM_USER + 1107; // sent on page release
  634. {$EXTERNALSYM WM_ADSPROP_NOTIFY_EXIT}
  635. //+----------------------------------------------------------------------------
  636. //
  637. // Structure: ADSPROPINITPARAMS
  638. //
  639. // Usage: Used to pass page initialization information to new pages from
  640. // the notify object.
  641. //
  642. //-----------------------------------------------------------------------------
  643. type
  644. PADSPROPINITPARAMS = ^ADSPROPINITPARAMS;
  645. {$EXTERNALSYM PADSPROPINITPARAMS}
  646. _ADSPROPINITPARAMS = record
  647. dwSize: DWORD; // Set this to the size of the struct.
  648. dwFlags: DWORD; // Reserved for future use.
  649. hr: HRESULT; // If this is non-zero, then the others
  650. pDsObj: IDirectoryObject; // should be ignored.
  651. pwzCN: LPWSTR;
  652. pWritableAttrs: PADS_ATTR_INFO;
  653. end;
  654. {$EXTERNALSYM _ADSPROPINITPARAMS}
  655. ADSPROPINITPARAMS = _ADSPROPINITPARAMS;
  656. {$EXTERNALSYM ADSPROPINITPARAMS}
  657. TAdsPropInitParams = ADSPROPINITPARAMS;
  658. //+----------------------------------------------------------------------------
  659. //
  660. // Function: ADsPropCreateNotifyObj
  661. //
  662. // Synopsis: Checks to see if the notification window/object exists for this
  663. // sheet instance and if not creates it.
  664. //
  665. // Arguments: [pAppThdDataObj] - the unmarshalled data object pointer.
  666. // [pwzADsObjName] - object path name.
  667. // [phNotifyObj] - to return the notificion window handle.
  668. //
  669. // Returns: HRESULTs.
  670. //
  671. //-----------------------------------------------------------------------------
  672. function ADsPropCreateNotifyObj(pAppThdDataObj: Pointer; {LPDATAOBJECT}
  673. pwzADsObjName: PWSTR; var phNotifyObj: HWND): HRESULT; stdcall;
  674. {$EXTERNALSYM ADsPropCreateNotifyObj}
  675. //+----------------------------------------------------------------------------
  676. //
  677. // Function: ADsPropGetInitInfo
  678. //
  679. // Synopsis: Pages call this at their init time to retreive DS object info.
  680. //
  681. // Arguments: [hNotifyObj] - the notificion window handle.
  682. // [pInitParams] - struct filled in with DS object info. This
  683. // struct must be allocated by the caller before
  684. // the call.
  685. //
  686. // Returns: FALSE if the notify window has gone away for some reason or
  687. // if the parameters are invalid.
  688. //
  689. // Notes: This call results in the sending of the
  690. // WM_ADSPROP_NOTIFY_PAGEINIT message to the notify window.
  691. // pInitParams->pWritableAttrs can be NULL if there are no
  692. // writable attributes.
  693. //
  694. //-----------------------------------------------------------------------------
  695. function ADsPropGetInitInfo(hNotifyObj: HWND; pInitParams: PADSPROPINITPARAMS): BOOL; stdcall;
  696. {$EXTERNALSYM ADsPropGetInitInfo}
  697. //+----------------------------------------------------------------------------
  698. //
  699. // Function: ADsPropSetHwnd
  700. //
  701. // Synopsis: Pages call this at their dialog init time to send their hwnd.
  702. //
  703. // Arguments: [hNotifyObj] - the notificion window handle.
  704. // [hPage] - the page's window handle.
  705. //
  706. // Returns: FALSE if the notify window has gone away for some reason.
  707. //
  708. // Notes: Sends the WM_ADSPROP_NOTIFY_PAGEHWND message to the notify
  709. // window.
  710. //
  711. //-----------------------------------------------------------------------------
  712. function ADsPropSetHwnd(hNotifyObj: HWND; hPage: HWND): BOOL; stdcall;
  713. {$EXTERNALSYM ADsPropSetHwnd}
  714. //+----------------------------------------------------------------------------
  715. //
  716. // function: ADsPropCheckIfWritable
  717. //
  718. // Synopsis: See if the attribute is writable by checking if it is in
  719. // the allowedAttributesEffective array.
  720. //
  721. // Arguments: [pwzAttr] - the attribute name.
  722. // [pWritableAttrs] - the array of writable attributes.
  723. //
  724. // Returns: FALSE if the attribute name is not found in the writable-attrs
  725. // array or if the array pointer is NULL.
  726. //
  727. //-----------------------------------------------------------------------------
  728. function ADsPropCheckIfWritable(pwzAttr: PWSTR; pWritableAttrs: PADS_ATTR_INFO): BOOL; stdcall;
  729. {$EXTERNALSYM ADsPropCheckIfWritable}
  730. implementation
  731. uses
  732. JwaWinDLLNames;
  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.