JwaLmRepl.pas
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:18k
源码类别:

Windows编程

开发平台:

Delphi

  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@chello.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 home    }
  18. { page, located at http://delphi-jedi.org or my personal homepage located at   }
  19. { http://members.chello.nl/m.vanbrakel2                                        }
  20. {                }
  21. { The contents of this file are used with permission, subject to the Mozilla   }
  22. { Public License Version 1.1 (the "License"); you may not use this file except }
  23. { in compliance with the License. You may obtain a copy of the License at      }
  24. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  25. {                                                                              }
  26. { Software distributed under the License is distributed on an "AS IS" basis,   }
  27. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  28. { the specific language governing rights and limitations under the License.    }
  29. {                                                                              }
  30. { Alternatively, the contents of this file may be used under the terms of the  }
  31. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  32. { provisions of the LGPL License are applicable instead of those above.        }
  33. { If you wish to allow use of your version of this file only under the terms   }
  34. { of the LGPL License and not to allow others to use your version of this file }
  35. { under the MPL, indicate your decision by deleting  the provisions above and  }
  36. { replace  them with the notice and other provisions required by the LGPL      }
  37. { License.  If you do not delete the provisions above, a recipient may use     }
  38. { your version of this file under either the MPL or the LGPL License.          }
  39. {                 }
  40. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  41. {                 }
  42. {******************************************************************************}
  43. unit JwaLmRepl;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "lmrepl.h"'}
  47. {$HPPEMIT ''}
  48. {$I WINDEFINES.INC}
  49. interface
  50. uses
  51.   JwaLmCons, JwaWinType;
  52. //
  53. // Replicator Configuration APIs
  54. //
  55. const
  56.   REPL_ROLE_EXPORT = 1;
  57.   {$EXTERNALSYM REPL_ROLE_EXPORT}
  58.   REPL_ROLE_IMPORT = 2;
  59.   {$EXTERNALSYM REPL_ROLE_IMPORT}
  60.   REPL_ROLE_BOTH   = 3;
  61.   {$EXTERNALSYM REPL_ROLE_BOTH}
  62.   REPL_INTERVAL_INFOLEVEL  = (PARMNUM_BASE_INFOLEVEL + 0);
  63.   {$EXTERNALSYM REPL_INTERVAL_INFOLEVEL}
  64.   REPL_PULSE_INFOLEVEL     = (PARMNUM_BASE_INFOLEVEL + 1);
  65.   {$EXTERNALSYM REPL_PULSE_INFOLEVEL}
  66.   REPL_GUARDTIME_INFOLEVEL = (PARMNUM_BASE_INFOLEVEL + 2);
  67.   {$EXTERNALSYM REPL_GUARDTIME_INFOLEVEL}
  68.   REPL_RANDOM_INFOLEVEL    = (PARMNUM_BASE_INFOLEVEL + 3);
  69.   {$EXTERNALSYM REPL_RANDOM_INFOLEVEL}
  70. type
  71.   _REPL_INFO_0 = record
  72.     rp0_role: DWORD;
  73.     rp0_exportpath: LPWSTR;
  74.     rp0_exportlist: LPWSTR;
  75.     rp0_importpath: LPWSTR;
  76.     rp0_importlist: LPWSTR;
  77.     rp0_logonusername: LPWSTR;
  78.     rp0_interval: DWORD;
  79.     rp0_pulse: DWORD;
  80.     rp0_guardtime: DWORD;
  81.     rp0_random: DWORD;
  82.   end;
  83.   {$EXTERNALSYM _REPL_INFO_0}
  84.   REPL_INFO_0 = _REPL_INFO_0;
  85.   {$EXTERNALSYM REPL_INFO_0}
  86.   LPREPL_INFO_0 = ^REPL_INFO_0;
  87.   {$EXTERNALSYM LPREPL_INFO_0}
  88.   PREPL_INFO_0 = ^REPL_INFO_0;
  89.   {$EXTERNALSYM PREPL_INFO_0}
  90.   TReplInfo0 = REPL_INFO_0;
  91.   PReplInfo0 = PREPL_INFO_0;
  92.   _REPL_INFO_1000 = record
  93.     rp1000_interval: DWORD;
  94.   end;
  95.   {$EXTERNALSYM _REPL_INFO_1000}
  96.   REPL_INFO_1000 = _REPL_INFO_1000;
  97.   {$EXTERNALSYM REPL_INFO_1000}
  98.   LPREPL_INFO_1000 = ^REPL_INFO_1000;
  99.   {$EXTERNALSYM LPREPL_INFO_1000}
  100.   PREPL_INFO_1000 = ^REPL_INFO_1000;
  101.   {$EXTERNALSYM PREPL_INFO_1000}
  102.   TReplInfo1000 = REPL_INFO_1000;
  103.   PReplInfo1000 = PREPL_INFO_1000;
  104.   _REPL_INFO_1001 = record
  105.     rp1001_pulse: DWORD;
  106.   end;
  107.   {$EXTERNALSYM _REPL_INFO_1001}
  108.   REPL_INFO_1001 = _REPL_INFO_1001;
  109.   {$EXTERNALSYM REPL_INFO_1001}
  110.   LPREPL_INFO_1001 = ^REPL_INFO_1001;
  111.   {$EXTERNALSYM LPREPL_INFO_1001}
  112.   PREPL_INFO_1001 = ^REPL_INFO_1001;
  113.   {$EXTERNALSYM PREPL_INFO_1001}
  114.   TReplInfo1001 = REPL_INFO_1001;
  115.   PReplInfo1001 = PREPL_INFO_1001;
  116.   _REPL_INFO_1002 = record
  117.     rp1002_guardtime: DWORD;
  118.   end;
  119.   {$EXTERNALSYM _REPL_INFO_1002}
  120.   REPL_INFO_1002 = _REPL_INFO_1002;
  121.   {$EXTERNALSYM REPL_INFO_1002}
  122.   LPREPL_INFO_1002 = ^REPL_INFO_1002;
  123.   {$EXTERNALSYM LPREPL_INFO_1002}
  124.   PREPL_INFO_1002 = ^REPL_INFO_1002;
  125.   {$EXTERNALSYM PREPL_INFO_1002}
  126.   TReplInfo1002 = REPL_INFO_1002;
  127.   PReplInfo1002 = PREPL_INFO_1002;
  128.   _REPL_INFO_1003 = record
  129.     rp1003_random: DWORD;
  130.   end;
  131.   {$EXTERNALSYM _REPL_INFO_1003}
  132.   REPL_INFO_1003 = _REPL_INFO_1003;
  133.   {$EXTERNALSYM REPL_INFO_1003}
  134.   LPREPL_INFO_1003 = ^REPL_INFO_1003;
  135.   {$EXTERNALSYM LPREPL_INFO_1003}
  136.   PREPL_INFO_1003 = ^REPL_INFO_1003;
  137.   {$EXTERNALSYM PREPL_INFO_1003}
  138.   TReplInfo1003 = REPL_INFO_1003;
  139.   PReplInfo1003 = PREPL_INFO_1003;
  140. function NetReplGetInfo(servername: LPCWSTR; level: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
  141. {$EXTERNALSYM NetReplGetInfo}
  142. function NetReplSetInfo(servername: LPCWSTR; level: DWORD; buf: LPBYTE ; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  143. {$EXTERNALSYM NetReplSetInfo}
  144. //
  145. // Replicator Export Directory APIs
  146. //
  147. const
  148.   REPL_INTEGRITY_FILE = 1;
  149.   {$EXTERNALSYM REPL_INTEGRITY_FILE}
  150.   REPL_INTEGRITY_TREE = 2;
  151.   {$EXTERNALSYM REPL_INTEGRITY_TREE}
  152.   REPL_EXTENT_FILE = 1;
  153.   {$EXTERNALSYM REPL_EXTENT_FILE}
  154.   REPL_EXTENT_TREE = 2;
  155.   {$EXTERNALSYM REPL_EXTENT_TREE}
  156.   REPL_EXPORT_INTEGRITY_INFOLEVEL = (PARMNUM_BASE_INFOLEVEL + 0);
  157.   {$EXTERNALSYM REPL_EXPORT_INTEGRITY_INFOLEVEL}
  158.   REPL_EXPORT_EXTENT_INFOLEVEL    = (PARMNUM_BASE_INFOLEVEL + 1);
  159.   {$EXTERNALSYM REPL_EXPORT_EXTENT_INFOLEVEL}
  160. type
  161.   _REPL_EDIR_INFO_0 = record
  162.     rped0_dirname: LPWSTR;
  163.   end;
  164.   {$EXTERNALSYM _REPL_EDIR_INFO_0}
  165.   REPL_EDIR_INFO_0 = _REPL_EDIR_INFO_0;
  166.   {$EXTERNALSYM REPL_EDIR_INFO_0}
  167.   LPREPL_EDIR_INFO_0 = ^REPL_EDIR_INFO_0;
  168.   {$EXTERNALSYM LPREPL_EDIR_INFO_0}
  169.   PREPL_EDIR_INFO_0 = ^REPL_EDIR_INFO_0;
  170.   {$EXTERNALSYM PREPL_EDIR_INFO_0}
  171.   TReplEdirInfo0 = REPL_EDIR_INFO_0;
  172.   PReplEdirInfo0 = PREPL_EDIR_INFO_0;
  173.   _REPL_EDIR_INFO_1 = record
  174.     rped1_dirname: LPWSTR;
  175.     rped1_integrity: DWORD;
  176.     rped1_extent: DWORD;
  177.   end;
  178.   {$EXTERNALSYM _REPL_EDIR_INFO_1}
  179.   REPL_EDIR_INFO_1 = _REPL_EDIR_INFO_1;
  180.   {$EXTERNALSYM REPL_EDIR_INFO_1}
  181.   LPREPL_EDIR_INFO_1 = ^REPL_EDIR_INFO_1;
  182.   {$EXTERNALSYM LPREPL_EDIR_INFO_1}
  183.   PREPL_EDIR_INFO_1 = ^REPL_EDIR_INFO_1;
  184.   {$EXTERNALSYM PREPL_EDIR_INFO_1}
  185.   TReplEdirInfo1 = REPL_EDIR_INFO_1;
  186.   PReplEdirInfo1 = PREPL_EDIR_INFO_1;
  187.   _REPL_EDIR_INFO_2 = record
  188.     rped2_dirname: LPWSTR;
  189.     rped2_integrity: DWORD;
  190.     rped2_extent: DWORD;
  191.     rped2_lockcount: DWORD;
  192.     rped2_locktime: DWORD;
  193.   end;
  194.   {$EXTERNALSYM _REPL_EDIR_INFO_2}
  195.   REPL_EDIR_INFO_2 = _REPL_EDIR_INFO_2;
  196.   {$EXTERNALSYM REPL_EDIR_INFO_2}
  197.   LPREPL_EDIR_INFO_2 = ^REPL_EDIR_INFO_2;
  198.   {$EXTERNALSYM LPREPL_EDIR_INFO_2}
  199.   PREPL_EDIR_INFO_2 = ^REPL_EDIR_INFO_2;
  200.   {$EXTERNALSYM PREPL_EDIR_INFO_2}
  201.   TReplEdirInfo2 = REPL_EDIR_INFO_2;
  202.   PReplEdirInfo2 = PREPL_EDIR_INFO_2;
  203.   _REPL_EDIR_INFO_1000 = record
  204.     rped1000_integrity: DWORD;
  205.   end;
  206.   {$EXTERNALSYM _REPL_EDIR_INFO_1000}
  207.   REPL_EDIR_INFO_1000 = _REPL_EDIR_INFO_1000;
  208.   {$EXTERNALSYM REPL_EDIR_INFO_1000}
  209.   LPREPL_EDIR_INFO_1000 = ^REPL_EDIR_INFO_1000;
  210.   {$EXTERNALSYM LPREPL_EDIR_INFO_1000}
  211.   PREPL_EDIR_INFO_1000 = ^REPL_EDIR_INFO_1000;
  212.   {$EXTERNALSYM PREPL_EDIR_INFO_1000}
  213.   TReplEdirInfo1000 = REPL_EDIR_INFO_1000;
  214.   PReplEdirInfo1000 = PREPL_EDIR_INFO_1000;
  215.   _REPL_EDIR_INFO_1001 = record
  216.     rped1001_extent: DWORD;
  217.   end;
  218.   {$EXTERNALSYM _REPL_EDIR_INFO_1001}
  219.   REPL_EDIR_INFO_1001 = _REPL_EDIR_INFO_1001;
  220.   {$EXTERNALSYM REPL_EDIR_INFO_1001}
  221.   LPREPL_EDIR_INFO_1001 = ^REPL_EDIR_INFO_1001;
  222.   {$EXTERNALSYM LPREPL_EDIR_INFO_1001}
  223.   PREPL_EDIR_INFO_1001 = ^REPL_EDIR_INFO_1001;
  224.   {$EXTERNALSYM PREPL_EDIR_INFO_1001}
  225.   TReplEdirInfo1001 = REPL_EDIR_INFO_1001;
  226.   PReplEdirInfo1001 = PREPL_EDIR_INFO_1001;
  227. function NetReplExportDirAdd(servername: LPCWSTR; level: DWORD; buf: LPBYTE ; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  228. {$EXTERNALSYM NetReplExportDirAdd}
  229. function NetReplExportDirDel(servername: LPCWSTR; dirname: LPCWSTR): NET_API_STATUS; stdcall;
  230. {$EXTERNALSYM NetReplExportDirDel}
  231. function NetReplExportDirEnum(servername: LPCWSTR; level: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries, resumehandle: LPDWORD): NET_API_STATUS; stdcall;
  232. {$EXTERNALSYM NetReplExportDirEnum}
  233. function NetReplExportDirGetInfo(servername, dirname: LPCWSTR; level: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
  234. {$EXTERNALSYM NetReplExportDirGetInfo}
  235. function NetReplExportDirSetInfo(servername, dirname: LPCWSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  236. {$EXTERNALSYM NetReplExportDirSetInfo}
  237. function NetReplExportDirLock(servername: LPCWSTR; dirname: LPCWSTR): NET_API_STATUS; stdcall;
  238. {$EXTERNALSYM NetReplExportDirLock}
  239. function NetReplExportDirUnlock(servername: LPCWSTR; dirname: LPCWSTR; unlockforce: DWORD): NET_API_STATUS; stdcall;
  240. {$EXTERNALSYM NetReplExportDirUnlock}
  241. const
  242.   REPL_UNLOCK_NOFORCE = 0;
  243.   {$EXTERNALSYM REPL_UNLOCK_NOFORCE}
  244.   REPL_UNLOCK_FORCE   = 1;
  245.   {$EXTERNALSYM REPL_UNLOCK_FORCE}
  246. //
  247. // Replicator Import Directory APIs
  248. //
  249. type
  250.   _REPL_IDIR_INFO_0 = record
  251.     rpid0_dirname: LPWSTR;
  252.   end;
  253.   {$EXTERNALSYM _REPL_IDIR_INFO_0}
  254.   REPL_IDIR_INFO_0 = _REPL_IDIR_INFO_0;
  255.   {$EXTERNALSYM REPL_IDIR_INFO_0}
  256.   LPREPL_IDIR_INFO_0 = ^REPL_IDIR_INFO_0;
  257.   {$EXTERNALSYM LPREPL_IDIR_INFO_0}
  258.   PREPL_IDIR_INFO_0 = ^REPL_IDIR_INFO_0;
  259.   {$EXTERNALSYM PREPL_IDIR_INFO_0}
  260.   TReplIdirInfo0 = REPL_IDIR_INFO_0;
  261.   PReplIdirInfo0 = PREPL_IDIR_INFO_0;
  262.   _REPL_IDIR_INFO_1 = record
  263.     rpid1_dirname: LPWSTR;
  264.     rpid1_state: DWORD;
  265.     rpid1_mastername: LPWSTR;
  266.     rpid1_last_update_time: DWORD;
  267.     rpid1_lockcount: DWORD;
  268.     rpid1_locktime: DWORD;
  269.   end;
  270.   {$EXTERNALSYM _REPL_IDIR_INFO_1}
  271.   REPL_IDIR_INFO_1 = _REPL_IDIR_INFO_1;
  272.   {$EXTERNALSYM REPL_IDIR_INFO_1}
  273.   LPREPL_IDIR_INFO_1 = ^REPL_IDIR_INFO_1;
  274.   {$EXTERNALSYM LPREPL_IDIR_INFO_1}
  275.   PREPL_IDIR_INFO_1 = ^REPL_IDIR_INFO_1;
  276.   {$EXTERNALSYM PREPL_IDIR_INFO_1}
  277.   TReplIdirInfo1 = REPL_IDIR_INFO_1;
  278.   PReplIdirInfo1 = PREPL_IDIR_INFO_1;
  279. function NetReplImportDirAdd(servername: LPCWSTR; level: DWORD; buf: LPBYTE; parm_err: LPDWORD): NET_API_STATUS; stdcall;
  280. {$EXTERNALSYM NetReplImportDirAdd}
  281. function NetReplImportDirDel(servername: LPCWSTR; dirname: LPCWSTR): NET_API_STATUS; stdcall;
  282. {$EXTERNALSYM NetReplImportDirDel}
  283. function NetReplImportDirEnum(servername: LPCWSTR; level: DWORD; var bufptr: LPBYTE; prefmaxlen: DWORD; entriesread, totalentries, resumehandle: LPDWORD): NET_API_STATUS; stdcall;
  284. {$EXTERNALSYM NetReplImportDirEnum}
  285. function NetReplImportDirGetInfo(servername, dirname: LPCWSTR; level: DWORD; var bufptr: LPBYTE): NET_API_STATUS; stdcall;
  286. {$EXTERNALSYM NetReplImportDirGetInfo}
  287. function NetReplImportDirLock(servername: LPCWSTR; dirname: LPCWSTR): NET_API_STATUS; stdcall;
  288. {$EXTERNALSYM NetReplImportDirLock}
  289. function NetReplImportDirUnlock(servername: LPCWSTR; dirname: LPCWSTR; unlockforce: DWORD): NET_API_STATUS; stdcall;
  290. {$EXTERNALSYM NetReplImportDirUnlock}
  291. const
  292.   REPL_STATE_OK               = 0;
  293.   {$EXTERNALSYM REPL_STATE_OK}
  294.   REPL_STATE_NO_MASTER        = 1;
  295.   {$EXTERNALSYM REPL_STATE_NO_MASTER}
  296.   REPL_STATE_NO_SYNC          = 2;
  297.   {$EXTERNALSYM REPL_STATE_NO_SYNC}
  298.   REPL_STATE_NEVER_REPLICATED = 3;
  299.   {$EXTERNALSYM REPL_STATE_NEVER_REPLICATED}
  300. implementation
  301. {$IFDEF DYNAMIC_LINK}
  302. var
  303.   _NetReplGetInfo: Pointer;
  304. function NetReplGetInfo;
  305. begin
  306.   GetProcedureAddress(_NetReplGetInfo, netapi32, 'NetReplGetInfo');
  307.   asm
  308.     mov esp, ebp
  309.     pop ebp
  310.     jmp [_NetReplGetInfo]
  311.   end;
  312. end;
  313. {$ELSE}
  314. function NetReplGetInfo; external netapi32 name 'NetReplGetInfo';
  315. {$ENDIF DYNAMIC_LINK}
  316. {$IFDEF DYNAMIC_LINK}
  317. var
  318.   _NetReplSetInfo: Pointer;
  319. function NetReplSetInfo;
  320. begin
  321.   GetProcedureAddress(_NetReplSetInfo, netapi32, 'NetReplSetInfo');
  322.   asm
  323.     mov esp, ebp
  324.     pop ebp
  325.     jmp [_NetReplSetInfo]
  326.   end;
  327. end;
  328. {$ELSE}
  329. function NetReplSetInfo; external netapi32 name 'NetReplSetInfo';
  330. {$ENDIF DYNAMIC_LINK}
  331. {$IFDEF DYNAMIC_LINK}
  332. var
  333.   _NetReplExportDirAdd: Pointer;
  334. function NetReplExportDirAdd;
  335. begin
  336.   GetProcedureAddress(_NetReplExportDirAdd, netapi32, 'NetReplExportDirAdd');
  337.   asm
  338.     mov esp, ebp
  339.     pop ebp
  340.     jmp [_NetReplExportDirAdd]
  341.   end;
  342. end;
  343. {$ELSE}
  344. function NetReplExportDirAdd; external netapi32 name 'NetReplExportDirAdd';
  345. {$ENDIF DYNAMIC_LINK}
  346. {$IFDEF DYNAMIC_LINK}
  347. var
  348.   _NetReplExportDirDel: Pointer;
  349. function NetReplExportDirDel;
  350. begin
  351.   GetProcedureAddress(_NetReplExportDirDel, netapi32, 'NetReplExportDirDel');
  352.   asm
  353.     mov esp, ebp
  354.     pop ebp
  355.     jmp [_NetReplExportDirDel]
  356.   end;
  357. end;
  358. {$ELSE}
  359. function NetReplExportDirDel; external netapi32 name 'NetReplExportDirDel';
  360. {$ENDIF DYNAMIC_LINK}
  361. {$IFDEF DYNAMIC_LINK}
  362. var
  363.   _NetReplExportDirEnum: Pointer;
  364. function NetReplExportDirEnum;
  365. begin
  366.   GetProcedureAddress(_NetReplExportDirEnum, netapi32, 'NetReplExportDirEnum');
  367.   asm
  368.     mov esp, ebp
  369.     pop ebp
  370.     jmp [_NetReplExportDirEnum]
  371.   end;
  372. end;
  373. {$ELSE}
  374. function NetReplExportDirEnum; external netapi32 name 'NetReplExportDirEnum';
  375. {$ENDIF DYNAMIC_LINK}
  376. {$IFDEF DYNAMIC_LINK}
  377. var
  378.   _NetReplExportDirGetInfo: Pointer;
  379. function NetReplExportDirGetInfo;
  380. begin
  381.   GetProcedureAddress(_NetReplExportDirGetInfo, netapi32, 'NetReplExportDirGetInfo');
  382.   asm
  383.     mov esp, ebp
  384.     pop ebp
  385.     jmp [_NetReplExportDirGetInfo]
  386.   end;
  387. end;
  388. {$ELSE}
  389. function NetReplExportDirGetInfo; external netapi32 name 'NetReplExportDirGetInfo';
  390. {$ENDIF DYNAMIC_LINK}
  391. {$IFDEF DYNAMIC_LINK}
  392. var
  393.   _NetReplExportDirSetInfo: Pointer;
  394. function NetReplExportDirSetInfo;
  395. begin
  396.   GetProcedureAddress(_NetReplExportDirSetInfo, netapi32, 'NetReplExportDirSetInfo');
  397.   asm
  398.     mov esp, ebp
  399.     pop ebp
  400.     jmp [_NetReplExportDirSetInfo]
  401.   end;
  402. end;
  403. {$ELSE}
  404. function NetReplExportDirSetInfo; external netapi32 name 'NetReplExportDirSetInfo';
  405. {$ENDIF DYNAMIC_LINK}
  406. {$IFDEF DYNAMIC_LINK}
  407. var
  408.   _NetReplExportDirLock: Pointer;
  409. function NetReplExportDirLock;
  410. begin
  411.   GetProcedureAddress(_NetReplExportDirLock, netapi32, 'NetReplExportDirLock');
  412.   asm
  413.     mov esp, ebp
  414.     pop ebp
  415.     jmp [_NetReplExportDirLock]
  416.   end;
  417. end;
  418. {$ELSE}
  419. function NetReplExportDirLock; external netapi32 name 'NetReplExportDirLock';
  420. {$ENDIF DYNAMIC_LINK}
  421. {$IFDEF DYNAMIC_LINK}
  422. var
  423.   _NetReplExportDirUnlock: Pointer;
  424. function NetReplExportDirUnlock;
  425. begin
  426.   GetProcedureAddress(_NetReplExportDirUnlock, netapi32, 'NetReplExportDirUnlock');
  427.   asm
  428.     mov esp, ebp
  429.     pop ebp
  430.     jmp [_NetReplExportDirUnlock]
  431.   end;
  432. end;
  433. {$ELSE}
  434. function NetReplExportDirUnlock; external netapi32 name 'NetReplExportDirUnlock';
  435. {$ENDIF DYNAMIC_LINK}
  436. {$IFDEF DYNAMIC_LINK}
  437. var
  438.   _NetReplImportDirAdd: Pointer;
  439. function NetReplImportDirAdd;
  440. begin
  441.   GetProcedureAddress(_NetReplImportDirAdd, netapi32, 'NetReplImportDirAdd');
  442.   asm
  443.     mov esp, ebp
  444.     pop ebp
  445.     jmp [_NetReplImportDirAdd]
  446.   end;
  447. end;
  448. {$ELSE}
  449. function NetReplImportDirAdd; external netapi32 name 'NetReplImportDirAdd';
  450. {$ENDIF DYNAMIC_LINK}
  451. {$IFDEF DYNAMIC_LINK}
  452. var
  453.   _NetReplImportDirDel: Pointer;
  454. function NetReplImportDirDel;
  455. begin
  456.   GetProcedureAddress(_NetReplImportDirDel, netapi32, 'NetReplImportDirDel');
  457.   asm
  458.     mov esp, ebp
  459.     pop ebp
  460.     jmp [_NetReplImportDirDel]
  461.   end;
  462. end;
  463. {$ELSE}
  464. function NetReplImportDirDel; external netapi32 name 'NetReplImportDirDel';
  465. {$ENDIF DYNAMIC_LINK}
  466. {$IFDEF DYNAMIC_LINK}
  467. var
  468.   _NetReplImportDirEnum: Pointer;
  469. function NetReplImportDirEnum;
  470. begin
  471.   GetProcedureAddress(_NetReplImportDirEnum, netapi32, 'NetReplImportDirEnum');
  472.   asm
  473.     mov esp, ebp
  474.     pop ebp
  475.     jmp [_NetReplImportDirEnum]
  476.   end;
  477. end;
  478. {$ELSE}
  479. function NetReplImportDirEnum; external netapi32 name 'NetReplImportDirEnum';
  480. {$ENDIF DYNAMIC_LINK}
  481. {$IFDEF DYNAMIC_LINK}
  482. var
  483.   _NetReplImportDirGetInfo: Pointer;
  484. function NetReplImportDirGetInfo;
  485. begin
  486.   GetProcedureAddress(_NetReplImportDirGetInfo, netapi32, 'NetReplImportDirGetInfo');
  487.   asm
  488.     mov esp, ebp
  489.     pop ebp
  490.     jmp [_NetReplImportDirGetInfo]
  491.   end;
  492. end;
  493. {$ELSE}
  494. function NetReplImportDirGetInfo; external netapi32 name 'NetReplImportDirGetInfo';
  495. {$ENDIF DYNAMIC_LINK}
  496. {$IFDEF DYNAMIC_LINK}
  497. var
  498.   _NetReplImportDirLock: Pointer;
  499. function NetReplImportDirLock;
  500. begin
  501.   GetProcedureAddress(_NetReplImportDirLock, netapi32, 'NetReplImportDirLock');
  502.   asm
  503.     mov esp, ebp
  504.     pop ebp
  505.     jmp [_NetReplImportDirLock]
  506.   end;
  507. end;
  508. {$ELSE}
  509. function NetReplImportDirLock; external netapi32 name 'NetReplImportDirLock';
  510. {$ENDIF DYNAMIC_LINK}
  511. {$IFDEF DYNAMIC_LINK}
  512. var
  513.   _NetReplImportDirUnlock: Pointer;
  514. function NetReplImportDirUnlock;
  515. begin
  516.   GetProcedureAddress(_NetReplImportDirUnlock, netapi32, 'NetReplImportDirUnlock');
  517.   asm
  518.     mov esp, ebp
  519.     pop ebp
  520.     jmp [_NetReplImportDirUnlock]
  521.   end;
  522. end;
  523. {$ELSE}
  524. function NetReplImportDirUnlock; external netapi32 name 'NetReplImportDirUnlock';
  525. {$ENDIF DYNAMIC_LINK}
  526. end.