jwalmrepl.pas 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. {******************************************************************************}
  2. { }
  3. { Lan Manager Replicator 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: lmrepl.h, released November 2001. The original Pascal }
  9. { code is: LmRepl.pas, released Februari 2002. 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 JwaLmRepl;
  43. {$WEAKPACKAGEUNIT}
  44. {$HPPEMIT ''}
  45. {$HPPEMIT '#include "lmrepl.h"'}
  46. {$HPPEMIT ''}
  47. {$I jediapilib.inc}
  48. interface
  49. uses
  50. JwaLmCons, JwaWinType;
  51. //
  52. // Replicator Configuration APIs
  53. //
  54. const
  55. REPL_ROLE_EXPORT = 1;
  56. {$EXTERNALSYM REPL_ROLE_EXPORT}
  57. REPL_ROLE_IMPORT = 2;
  58. {$EXTERNALSYM REPL_ROLE_IMPORT}
  59. REPL_ROLE_BOTH = 3;
  60. {$EXTERNALSYM REPL_ROLE_BOTH}
  61. REPL_INTERVAL_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + 0;
  62. {$EXTERNALSYM REPL_INTERVAL_INFOLEVEL}
  63. REPL_PULSE_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + 1;
  64. {$EXTERNALSYM REPL_PULSE_INFOLEVEL}
  65. REPL_GUARDTIME_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + 2;
  66. {$EXTERNALSYM REPL_GUARDTIME_INFOLEVEL}
  67. REPL_RANDOM_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + 3;
  68. {$EXTERNALSYM REPL_RANDOM_INFOLEVEL}
  69. type
  70. _REPL_INFO_0 = record
  71. rp0_role: DWORD;
  72. rp0_exportpath: LPWSTR;
  73. rp0_exportlist: LPWSTR;
  74. rp0_importpath: LPWSTR;
  75. rp0_importlist: LPWSTR;
  76. rp0_logonusername: LPWSTR;
  77. rp0_interval: DWORD;
  78. rp0_pulse: DWORD;
  79. rp0_guardtime: DWORD;
  80. rp0_random: DWORD;
  81. end;
  82. {$EXTERNALSYM _REPL_INFO_0}
  83. REPL_INFO_0 = _REPL_INFO_0;
  84. {$EXTERNALSYM REPL_INFO_0}
  85. LPREPL_INFO_0 = ^REPL_INFO_0;
  86. {$EXTERNALSYM LPREPL_INFO_0}
  87. PREPL_INFO_0 = ^REPL_INFO_0;
  88. {$EXTERNALSYM PREPL_INFO_0}
  89. TReplInfo0 = REPL_INFO_0;
  90. PReplInfo0 = PREPL_INFO_0;
  91. _REPL_INFO_1000 = record
  92. rp1000_interval: DWORD;
  93. end;
  94. {$EXTERNALSYM _REPL_INFO_1000}
  95. REPL_INFO_1000 = _REPL_INFO_1000;
  96. {$EXTERNALSYM REPL_INFO_1000}
  97. LPREPL_INFO_1000 = ^REPL_INFO_1000;
  98. {$EXTERNALSYM LPREPL_INFO_1000}
  99. PREPL_INFO_1000 = ^REPL_INFO_1000;
  100. {$EXTERNALSYM PREPL_INFO_1000}
  101. TReplInfo1000 = REPL_INFO_1000;
  102. PReplInfo1000 = PREPL_INFO_1000;
  103. _REPL_INFO_1001 = record
  104. rp1001_pulse: DWORD;
  105. end;
  106. {$EXTERNALSYM _REPL_INFO_1001}
  107. REPL_INFO_1001 = _REPL_INFO_1001;
  108. {$EXTERNALSYM REPL_INFO_1001}
  109. LPREPL_INFO_1001 = ^REPL_INFO_1001;
  110. {$EXTERNALSYM LPREPL_INFO_1001}
  111. PREPL_INFO_1001 = ^REPL_INFO_1001;
  112. {$EXTERNALSYM PREPL_INFO_1001}
  113. TReplInfo1001 = REPL_INFO_1001;
  114. PReplInfo1001 = PREPL_INFO_1001;
  115. _REPL_INFO_1002 = record
  116. rp1002_guardtime: DWORD;
  117. end;
  118. {$EXTERNALSYM _REPL_INFO_1002}
  119. REPL_INFO_1002 = _REPL_INFO_1002;
  120. {$EXTERNALSYM REPL_INFO_1002}
  121. LPREPL_INFO_1002 = ^REPL_INFO_1002;
  122. {$EXTERNALSYM LPREPL_INFO_1002}
  123. PREPL_INFO_1002 = ^REPL_INFO_1002;
  124. {$EXTERNALSYM PREPL_INFO_1002}
  125. TReplInfo1002 = REPL_INFO_1002;
  126. PReplInfo1002 = PREPL_INFO_1002;
  127. _REPL_INFO_1003 = record
  128. rp1003_random: DWORD;
  129. end;
  130. {$EXTERNALSYM _REPL_INFO_1003}
  131. REPL_INFO_1003 = _REPL_INFO_1003;
  132. {$EXTERNALSYM REPL_INFO_1003}
  133. LPREPL_INFO_1003 = ^REPL_INFO_1003;
  134. {$EXTERNALSYM LPREPL_INFO_1003}
  135. PREPL_INFO_1003 = ^REPL_INFO_1003;
  136. {$EXTERNALSYM PREPL_INFO_1003}
  137. TReplInfo1003 = REPL_INFO_1003;
  138. PReplInfo1003 = PREPL_INFO_1003;
  139. function NetReplGetInfo(servername: LPCWSTR; level: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
  140. {$EXTERNALSYM NetReplGetInfo}
  141. function NetReplSetInfo(servername: LPCWSTR; level: DWORD; buf: LPBYTE ; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  142. {$EXTERNALSYM NetReplSetInfo}
  143. //
  144. // Replicator Export Directory APIs
  145. //
  146. const
  147. REPL_INTEGRITY_FILE = 1;
  148. {$EXTERNALSYM REPL_INTEGRITY_FILE}
  149. REPL_INTEGRITY_TREE = 2;
  150. {$EXTERNALSYM REPL_INTEGRITY_TREE}
  151. REPL_EXTENT_FILE = 1;
  152. {$EXTERNALSYM REPL_EXTENT_FILE}
  153. REPL_EXTENT_TREE = 2;
  154. {$EXTERNALSYM REPL_EXTENT_TREE}
  155. REPL_EXPORT_INTEGRITY_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + 0;
  156. {$EXTERNALSYM REPL_EXPORT_INTEGRITY_INFOLEVEL}
  157. REPL_EXPORT_EXTENT_INFOLEVEL = PARMNUM_BASE_INFOLEVEL + 1;
  158. {$EXTERNALSYM REPL_EXPORT_EXTENT_INFOLEVEL}
  159. type
  160. _REPL_EDIR_INFO_0 = record
  161. rped0_dirname: LPWSTR;
  162. end;
  163. {$EXTERNALSYM _REPL_EDIR_INFO_0}
  164. REPL_EDIR_INFO_0 = _REPL_EDIR_INFO_0;
  165. {$EXTERNALSYM REPL_EDIR_INFO_0}
  166. LPREPL_EDIR_INFO_0 = ^REPL_EDIR_INFO_0;
  167. {$EXTERNALSYM LPREPL_EDIR_INFO_0}
  168. PREPL_EDIR_INFO_0 = ^REPL_EDIR_INFO_0;
  169. {$EXTERNALSYM PREPL_EDIR_INFO_0}
  170. TReplEdirInfo0 = REPL_EDIR_INFO_0;
  171. PReplEdirInfo0 = PREPL_EDIR_INFO_0;
  172. _REPL_EDIR_INFO_1 = record
  173. rped1_dirname: LPWSTR;
  174. rped1_integrity: DWORD;
  175. rped1_extent: DWORD;
  176. end;
  177. {$EXTERNALSYM _REPL_EDIR_INFO_1}
  178. REPL_EDIR_INFO_1 = _REPL_EDIR_INFO_1;
  179. {$EXTERNALSYM REPL_EDIR_INFO_1}
  180. LPREPL_EDIR_INFO_1 = ^REPL_EDIR_INFO_1;
  181. {$EXTERNALSYM LPREPL_EDIR_INFO_1}
  182. PREPL_EDIR_INFO_1 = ^REPL_EDIR_INFO_1;
  183. {$EXTERNALSYM PREPL_EDIR_INFO_1}
  184. TReplEdirInfo1 = REPL_EDIR_INFO_1;
  185. PReplEdirInfo1 = PREPL_EDIR_INFO_1;
  186. _REPL_EDIR_INFO_2 = record
  187. rped2_dirname: LPWSTR;
  188. rped2_integrity: DWORD;
  189. rped2_extent: DWORD;
  190. rped2_lockcount: DWORD;
  191. rped2_locktime: DWORD;
  192. end;
  193. {$EXTERNALSYM _REPL_EDIR_INFO_2}
  194. REPL_EDIR_INFO_2 = _REPL_EDIR_INFO_2;
  195. {$EXTERNALSYM REPL_EDIR_INFO_2}
  196. LPREPL_EDIR_INFO_2 = ^REPL_EDIR_INFO_2;
  197. {$EXTERNALSYM LPREPL_EDIR_INFO_2}
  198. PREPL_EDIR_INFO_2 = ^REPL_EDIR_INFO_2;
  199. {$EXTERNALSYM PREPL_EDIR_INFO_2}
  200. TReplEdirInfo2 = REPL_EDIR_INFO_2;
  201. PReplEdirInfo2 = PREPL_EDIR_INFO_2;
  202. _REPL_EDIR_INFO_1000 = record
  203. rped1000_integrity: DWORD;
  204. end;
  205. {$EXTERNALSYM _REPL_EDIR_INFO_1000}
  206. REPL_EDIR_INFO_1000 = _REPL_EDIR_INFO_1000;
  207. {$EXTERNALSYM REPL_EDIR_INFO_1000}
  208. LPREPL_EDIR_INFO_1000 = ^REPL_EDIR_INFO_1000;
  209. {$EXTERNALSYM LPREPL_EDIR_INFO_1000}
  210. PREPL_EDIR_INFO_1000 = ^REPL_EDIR_INFO_1000;
  211. {$EXTERNALSYM PREPL_EDIR_INFO_1000}
  212. TReplEdirInfo1000 = REPL_EDIR_INFO_1000;
  213. PReplEdirInfo1000 = PREPL_EDIR_INFO_1000;
  214. _REPL_EDIR_INFO_1001 = record
  215. rped1001_extent: DWORD;
  216. end;
  217. {$EXTERNALSYM _REPL_EDIR_INFO_1001}
  218. REPL_EDIR_INFO_1001 = _REPL_EDIR_INFO_1001;
  219. {$EXTERNALSYM REPL_EDIR_INFO_1001}
  220. LPREPL_EDIR_INFO_1001 = ^REPL_EDIR_INFO_1001;
  221. {$EXTERNALSYM LPREPL_EDIR_INFO_1001}
  222. PREPL_EDIR_INFO_1001 = ^REPL_EDIR_INFO_1001;
  223. {$EXTERNALSYM PREPL_EDIR_INFO_1001}
  224. TReplEdirInfo1001 = REPL_EDIR_INFO_1001;
  225. PReplEdirInfo1001 = PREPL_EDIR_INFO_1001;
  226. function NetReplExportDirAdd(servername: LPCWSTR; level: DWORD; buf: LPBYTE ; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  227. {$EXTERNALSYM NetReplExportDirAdd}
  228. function NetReplExportDirDel(servername: LPCWSTR; dirname: LPCWSTR): NET_API_STATUS; stdcall;
  229. {$EXTERNALSYM NetReplExportDirDel}
  230. function NetReplExportDirEnum(servername: LPCWSTR; level: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries, resumehandle: LPDWORD): NET_API_STATUS; stdcall;
  231. {$EXTERNALSYM NetReplExportDirEnum}
  232. function NetReplExportDirGetInfo(servername, dirname: LPCWSTR; level: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
  233. {$EXTERNALSYM NetReplExportDirGetInfo}
  234. function NetReplExportDirSetInfo(servername, dirname: LPCWSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  235. {$EXTERNALSYM NetReplExportDirSetInfo}
  236. function NetReplExportDirLock(servername: LPCWSTR; dirname: LPCWSTR): NET_API_STATUS; stdcall;
  237. {$EXTERNALSYM NetReplExportDirLock}
  238. function NetReplExportDirUnlock(servername: LPCWSTR; dirname: LPCWSTR; unlockforce: DWORD): NET_API_STATUS; stdcall;
  239. {$EXTERNALSYM NetReplExportDirUnlock}
  240. const
  241. REPL_UNLOCK_NOFORCE = 0;
  242. {$EXTERNALSYM REPL_UNLOCK_NOFORCE}
  243. REPL_UNLOCK_FORCE = 1;
  244. {$EXTERNALSYM REPL_UNLOCK_FORCE}
  245. //
  246. // Replicator Import Directory APIs
  247. //
  248. type
  249. _REPL_IDIR_INFO_0 = record
  250. rpid0_dirname: LPWSTR;
  251. end;
  252. {$EXTERNALSYM _REPL_IDIR_INFO_0}
  253. REPL_IDIR_INFO_0 = _REPL_IDIR_INFO_0;
  254. {$EXTERNALSYM REPL_IDIR_INFO_0}
  255. LPREPL_IDIR_INFO_0 = ^REPL_IDIR_INFO_0;
  256. {$EXTERNALSYM LPREPL_IDIR_INFO_0}
  257. PREPL_IDIR_INFO_0 = ^REPL_IDIR_INFO_0;
  258. {$EXTERNALSYM PREPL_IDIR_INFO_0}
  259. TReplIdirInfo0 = REPL_IDIR_INFO_0;
  260. PReplIdirInfo0 = PREPL_IDIR_INFO_0;
  261. _REPL_IDIR_INFO_1 = record
  262. rpid1_dirname: LPWSTR;
  263. rpid1_state: DWORD;
  264. rpid1_mastername: LPWSTR;
  265. rpid1_last_update_time: DWORD;
  266. rpid1_lockcount: DWORD;
  267. rpid1_locktime: DWORD;
  268. end;
  269. {$EXTERNALSYM _REPL_IDIR_INFO_1}
  270. REPL_IDIR_INFO_1 = _REPL_IDIR_INFO_1;
  271. {$EXTERNALSYM REPL_IDIR_INFO_1}
  272. LPREPL_IDIR_INFO_1 = ^REPL_IDIR_INFO_1;
  273. {$EXTERNALSYM LPREPL_IDIR_INFO_1}
  274. PREPL_IDIR_INFO_1 = ^REPL_IDIR_INFO_1;
  275. {$EXTERNALSYM PREPL_IDIR_INFO_1}
  276. TReplIdirInfo1 = REPL_IDIR_INFO_1;
  277. PReplIdirInfo1 = PREPL_IDIR_INFO_1;
  278. function NetReplImportDirAdd(servername: LPCWSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  279. {$EXTERNALSYM NetReplImportDirAdd}
  280. function NetReplImportDirDel(servername: LPCWSTR; dirname: LPCWSTR): NET_API_STATUS; stdcall;
  281. {$EXTERNALSYM NetReplImportDirDel}
  282. function NetReplImportDirEnum(servername: LPCWSTR; level: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries, resumehandle: LPDWORD): NET_API_STATUS; stdcall;
  283. {$EXTERNALSYM NetReplImportDirEnum}
  284. function NetReplImportDirGetInfo(servername, dirname: LPCWSTR; level: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
  285. {$EXTERNALSYM NetReplImportDirGetInfo}
  286. function NetReplImportDirLock(servername: LPCWSTR; dirname: LPCWSTR): NET_API_STATUS; stdcall;
  287. {$EXTERNALSYM NetReplImportDirLock}
  288. function NetReplImportDirUnlock(servername: LPCWSTR; dirname: LPCWSTR; unlockforce: DWORD): NET_API_STATUS; stdcall;
  289. {$EXTERNALSYM NetReplImportDirUnlock}
  290. const
  291. REPL_STATE_OK = 0;
  292. {$EXTERNALSYM REPL_STATE_OK}
  293. REPL_STATE_NO_MASTER = 1;
  294. {$EXTERNALSYM REPL_STATE_NO_MASTER}
  295. REPL_STATE_NO_SYNC = 2;
  296. {$EXTERNALSYM REPL_STATE_NO_SYNC}
  297. REPL_STATE_NEVER_REPLICATED = 3;
  298. {$EXTERNALSYM REPL_STATE_NEVER_REPLICATED}
  299. implementation
  300. {$IFDEF DYNAMIC_LINK}
  301. var
  302. _NetReplGetInfo: Pointer;
  303. function NetReplGetInfo;
  304. begin
  305. GetProcedureAddress(_NetReplGetInfo, netapi32, 'NetReplGetInfo');
  306. asm
  307. MOV ESP, EBP
  308. POP EBP
  309. JMP [_NetReplGetInfo]
  310. end;
  311. end;
  312. var
  313. _NetReplSetInfo: Pointer;
  314. function NetReplSetInfo;
  315. begin
  316. GetProcedureAddress(_NetReplSetInfo, netapi32, 'NetReplSetInfo');
  317. asm
  318. MOV ESP, EBP
  319. POP EBP
  320. JMP [_NetReplSetInfo]
  321. end;
  322. end;
  323. var
  324. _NetReplExportDirAdd: Pointer;
  325. function NetReplExportDirAdd;
  326. begin
  327. GetProcedureAddress(_NetReplExportDirAdd, netapi32, 'NetReplExportDirAdd');
  328. asm
  329. MOV ESP, EBP
  330. POP EBP
  331. JMP [_NetReplExportDirAdd]
  332. end;
  333. end;
  334. var
  335. _NetReplExportDirDel: Pointer;
  336. function NetReplExportDirDel;
  337. begin
  338. GetProcedureAddress(_NetReplExportDirDel, netapi32, 'NetReplExportDirDel');
  339. asm
  340. MOV ESP, EBP
  341. POP EBP
  342. JMP [_NetReplExportDirDel]
  343. end;
  344. end;
  345. var
  346. _NetReplExportDirEnum: Pointer;
  347. function NetReplExportDirEnum;
  348. begin
  349. GetProcedureAddress(_NetReplExportDirEnum, netapi32, 'NetReplExportDirEnum');
  350. asm
  351. MOV ESP, EBP
  352. POP EBP
  353. JMP [_NetReplExportDirEnum]
  354. end;
  355. end;
  356. var
  357. _NetReplExportDirGetInfo: Pointer;
  358. function NetReplExportDirGetInfo;
  359. begin
  360. GetProcedureAddress(_NetReplExportDirGetInfo, netapi32, 'NetReplExportDirGetInfo');
  361. asm
  362. MOV ESP, EBP
  363. POP EBP
  364. JMP [_NetReplExportDirGetInfo]
  365. end;
  366. end;
  367. var
  368. _NetReplExportDirSetInfo: Pointer;
  369. function NetReplExportDirSetInfo;
  370. begin
  371. GetProcedureAddress(_NetReplExportDirSetInfo, netapi32, 'NetReplExportDirSetInfo');
  372. asm
  373. MOV ESP, EBP
  374. POP EBP
  375. JMP [_NetReplExportDirSetInfo]
  376. end;
  377. end;
  378. var
  379. _NetReplExportDirLock: Pointer;
  380. function NetReplExportDirLock;
  381. begin
  382. GetProcedureAddress(_NetReplExportDirLock, netapi32, 'NetReplExportDirLock');
  383. asm
  384. MOV ESP, EBP
  385. POP EBP
  386. JMP [_NetReplExportDirLock]
  387. end;
  388. end;
  389. var
  390. _NetReplExportDirUnlock: Pointer;
  391. function NetReplExportDirUnlock;
  392. begin
  393. GetProcedureAddress(_NetReplExportDirUnlock, netapi32, 'NetReplExportDirUnlock');
  394. asm
  395. MOV ESP, EBP
  396. POP EBP
  397. JMP [_NetReplExportDirUnlock]
  398. end;
  399. end;
  400. var
  401. _NetReplImportDirAdd: Pointer;
  402. function NetReplImportDirAdd;
  403. begin
  404. GetProcedureAddress(_NetReplImportDirAdd, netapi32, 'NetReplImportDirAdd');
  405. asm
  406. MOV ESP, EBP
  407. POP EBP
  408. JMP [_NetReplImportDirAdd]
  409. end;
  410. end;
  411. var
  412. _NetReplImportDirDel: Pointer;
  413. function NetReplImportDirDel;
  414. begin
  415. GetProcedureAddress(_NetReplImportDirDel, netapi32, 'NetReplImportDirDel');
  416. asm
  417. MOV ESP, EBP
  418. POP EBP
  419. JMP [_NetReplImportDirDel]
  420. end;
  421. end;
  422. var
  423. _NetReplImportDirEnum: Pointer;
  424. function NetReplImportDirEnum;
  425. begin
  426. GetProcedureAddress(_NetReplImportDirEnum, netapi32, 'NetReplImportDirEnum');
  427. asm
  428. MOV ESP, EBP
  429. POP EBP
  430. JMP [_NetReplImportDirEnum]
  431. end;
  432. end;
  433. var
  434. _NetReplImportDirGetInfo: Pointer;
  435. function NetReplImportDirGetInfo;
  436. begin
  437. GetProcedureAddress(_NetReplImportDirGetInfo, netapi32, 'NetReplImportDirGetInfo');
  438. asm
  439. MOV ESP, EBP
  440. POP EBP
  441. JMP [_NetReplImportDirGetInfo]
  442. end;
  443. end;
  444. var
  445. _NetReplImportDirLock: Pointer;
  446. function NetReplImportDirLock;
  447. begin
  448. GetProcedureAddress(_NetReplImportDirLock, netapi32, 'NetReplImportDirLock');
  449. asm
  450. MOV ESP, EBP
  451. POP EBP
  452. JMP [_NetReplImportDirLock]
  453. end;
  454. end;
  455. var
  456. _NetReplImportDirUnlock: Pointer;
  457. function NetReplImportDirUnlock;
  458. begin
  459. GetProcedureAddress(_NetReplImportDirUnlock, netapi32, 'NetReplImportDirUnlock');
  460. asm
  461. MOV ESP, EBP
  462. POP EBP
  463. JMP [_NetReplImportDirUnlock]
  464. end;
  465. end;
  466. {$ELSE}
  467. function NetReplGetInfo; external netapi32 name 'NetReplGetInfo';
  468. function NetReplSetInfo; external netapi32 name 'NetReplSetInfo';
  469. function NetReplExportDirAdd; external netapi32 name 'NetReplExportDirAdd';
  470. function NetReplExportDirDel; external netapi32 name 'NetReplExportDirDel';
  471. function NetReplExportDirEnum; external netapi32 name 'NetReplExportDirEnum';
  472. function NetReplExportDirGetInfo; external netapi32 name 'NetReplExportDirGetInfo';
  473. function NetReplExportDirSetInfo; external netapi32 name 'NetReplExportDirSetInfo';
  474. function NetReplExportDirLock; external netapi32 name 'NetReplExportDirLock';
  475. function NetReplExportDirUnlock; external netapi32 name 'NetReplExportDirUnlock';
  476. function NetReplImportDirAdd; external netapi32 name 'NetReplImportDirAdd';
  477. function NetReplImportDirDel; external netapi32 name 'NetReplImportDirDel';
  478. function NetReplImportDirEnum; external netapi32 name 'NetReplImportDirEnum';
  479. function NetReplImportDirGetInfo; external netapi32 name 'NetReplImportDirGetInfo';
  480. function NetReplImportDirLock; external netapi32 name 'NetReplImportDirLock';
  481. function NetReplImportDirUnlock; external netapi32 name 'NetReplImportDirUnlock';
  482. {$ENDIF DYNAMIC_LINK}
  483. end.