jwalmdfs.pas 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  1. {******************************************************************************}
  2. { }
  3. { Lan Manager DFS 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: lmdfs.h, released November 2001. The original Pascal }
  9. { code is: LmDfs.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. // $Id: JwaLmDFS.pas,v 1.8 2005/09/06 16:36:50 marquardt Exp $
  43. unit JwaLmDFS;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include "lmdfs.h"'}
  47. {$HPPEMIT ''}
  48. {$I jediapilib.inc}
  49. interface
  50. uses
  51. JwaWindows, JwaLmCons;
  52. //
  53. // DFS Volume state
  54. //
  55. const
  56. DFS_VOLUME_STATES = $F;
  57. {$EXTERNALSYM DFS_VOLUME_STATES}
  58. DFS_VOLUME_STATE_OK = 1;
  59. {$EXTERNALSYM DFS_VOLUME_STATE_OK}
  60. DFS_VOLUME_STATE_INCONSISTENT = 2;
  61. {$EXTERNALSYM DFS_VOLUME_STATE_INCONSISTENT}
  62. DFS_VOLUME_STATE_OFFLINE = 3;
  63. {$EXTERNALSYM DFS_VOLUME_STATE_OFFLINE}
  64. DFS_VOLUME_STATE_ONLINE = 4;
  65. {$EXTERNALSYM DFS_VOLUME_STATE_ONLINE}
  66. //
  67. // These are valid for setting the volume state on the root
  68. // These are available to force a resynchronize on the root
  69. // volume or to put it in a standby mode.
  70. //
  71. DFS_VOLUME_STATE_RESYNCHRONIZE = $10;
  72. {$EXTERNALSYM DFS_VOLUME_STATE_RESYNCHRONIZE}
  73. DFS_VOLUME_STATE_STANDBY = $20;
  74. {$EXTERNALSYM DFS_VOLUME_STATE_STANDBY}
  75. //
  76. // These are valid on getting the volume state on the root
  77. // These are available to determine the flavor of DFS
  78. // A few bits are reserved to determine the flavor of the DFS root.
  79. // To get the flavor, and the state with DFS_VOLUME_FLAVORS.
  80. //
  81. // (_state & DFS_VOLUME_FLAVORS) will tell you the flavor of the dfs root.
  82. //
  83. //
  84. DFS_VOLUME_FLAVORS = $0300;
  85. {$EXTERNALSYM DFS_VOLUME_FLAVORS}
  86. DFS_VOLUME_FLAVOR_UNUSED1 = $0000;
  87. {$EXTERNALSYM DFS_VOLUME_FLAVOR_UNUSED1}
  88. DFS_VOLUME_FLAVOR_STANDALONE = $0100;
  89. {$EXTERNALSYM DFS_VOLUME_FLAVOR_STANDALONE}
  90. DFS_VOLUME_FLAVOR_AD_BLOB = $0200;
  91. {$EXTERNALSYM DFS_VOLUME_FLAVOR_AD_BLOB}
  92. DFS_STORAGE_FLAVOR_UNUSED2 = $0300;
  93. {$EXTERNALSYM DFS_STORAGE_FLAVOR_UNUSED2}
  94. //
  95. // DFS Storage State
  96. //
  97. DFS_STORAGE_STATES = $F;
  98. {$EXTERNALSYM DFS_STORAGE_STATES}
  99. DFS_STORAGE_STATE_OFFLINE = 1;
  100. {$EXTERNALSYM DFS_STORAGE_STATE_OFFLINE}
  101. DFS_STORAGE_STATE_ONLINE = 2;
  102. {$EXTERNALSYM DFS_STORAGE_STATE_ONLINE}
  103. DFS_STORAGE_STATE_ACTIVE = 4;
  104. {$EXTERNALSYM DFS_STORAGE_STATE_ACTIVE}
  105. //
  106. // Level 1:
  107. //
  108. type
  109. LPDFS_INFO_1 = ^DFS_INFO_1;
  110. {$EXTERNALSYM LPDFS_INFO_1}
  111. PDFS_INFO_1 = ^DFS_INFO_1;
  112. {$EXTERNALSYM PDFS_INFO_1}
  113. _DFS_INFO_1 = record
  114. EntryPath: LPWSTR; // Dfs name for the top of this piece of storage
  115. end;
  116. {$EXTERNALSYM _DFS_INFO_1}
  117. DFS_INFO_1 = _DFS_INFO_1;
  118. {$EXTERNALSYM DFS_INFO_1}
  119. TDfsInfo1 = DFS_INFO_1;
  120. PDfsInfo1 = PDFS_INFO_1;
  121. //
  122. // Level 2:
  123. //
  124. LPDFS_INFO_2 = ^DFS_INFO_2;
  125. {$EXTERNALSYM LPDFS_INFO_2}
  126. PDFS_INFO_2 = ^DFS_INFO_2;
  127. {$EXTERNALSYM PDFS_INFO_2}
  128. _DFS_INFO_2 = record
  129. EntryPath: LPWSTR; // Dfs name for the top of this volume
  130. Comment: LPWSTR; // Comment for this volume
  131. State: DWORD; // State of this volume, one of DFS_VOLUME_STATE_*
  132. NumberOfStorages: DWORD; // Number of storages for this volume
  133. end;
  134. {$EXTERNALSYM _DFS_INFO_2}
  135. DFS_INFO_2 = _DFS_INFO_2;
  136. {$EXTERNALSYM DFS_INFO_2}
  137. TDfsInfo2 = DFS_INFO_2;
  138. PDfsInfo2 = PDFS_INFO_2;
  139. LPDFS_STORAGE_INFO = ^DFS_STORAGE_INFO;
  140. {$EXTERNALSYM LPDFS_STORAGE_INFO}
  141. PDFS_STORAGE_INFO = ^DFS_STORAGE_INFO;
  142. {$EXTERNALSYM PDFS_STORAGE_INFO}
  143. _DFS_STORAGE_INFO = record
  144. State: ULONG; // State of this storage, one of DFS_STORAGE_STATE_*
  145. // possibly OR'd with DFS_STORAGE_STATE_ACTIVE
  146. ServerName: LPWSTR; // Name of server hosting this storage
  147. ShareName: LPWSTR; // Name of share hosting this storage
  148. end;
  149. {$EXTERNALSYM _DFS_STORAGE_INFO}
  150. DFS_STORAGE_INFO = _DFS_STORAGE_INFO;
  151. {$EXTERNALSYM DFS_STORAGE_INFO}
  152. TDfsStorageInfo = DFS_STORAGE_INFO;
  153. PDfsStorageInfo = PDFS_STORAGE_INFO;
  154. //
  155. // Level 3:
  156. //
  157. LPDFS_INFO_3 = ^DFS_INFO_3;
  158. {$EXTERNALSYM LPDFS_INFO_3}
  159. PDFS_INFO_3 = ^DFS_INFO_3;
  160. {$EXTERNALSYM PDFS_INFO_3}
  161. _DFS_INFO_3 = record
  162. EntryPath: LPWSTR; // Dfs name for the top of this volume
  163. Comment: LPWSTR; // Comment for this volume
  164. State: DWORD; // State of this volume, one of DFS_VOLUME_STATE_*
  165. NumberOfStorages: DWORD; // Number of storage servers for this volume
  166. Storage: LPDFS_STORAGE_INFO; // An array (of NumberOfStorages elements) of storage-specific information.
  167. end;
  168. {$EXTERNALSYM _DFS_INFO_3}
  169. DFS_INFO_3 = _DFS_INFO_3;
  170. {$EXTERNALSYM DFS_INFO_3}
  171. TDfsInfo3 = DFS_INFO_3;
  172. PDfsInfo3 = PDFS_INFO_3;
  173. //
  174. // Level 4:
  175. //
  176. LPDFS_INFO_4 = ^DFS_INFO_4;
  177. {$EXTERNALSYM LPDFS_INFO_4}
  178. PDFS_INFO_4 = ^DFS_INFO_4;
  179. {$EXTERNALSYM PDFS_INFO_4}
  180. _DFS_INFO_4 = record
  181. EntryPath: LPWSTR; // Dfs name for the top of this volume
  182. Comment: LPWSTR; // Comment for this volume
  183. State: DWORD; // State of this volume, one of DFS_VOLUME_STATE_*
  184. Timeout: ULONG; // Timeout, in seconds, of this junction point
  185. Guid: GUID; // Guid of this junction point
  186. NumberOfStorages: DWORD; // Number of storage servers for this volume
  187. Storage: LPDFS_STORAGE_INFO; // An array (of NumberOfStorages elements) of storage-specific information.
  188. end;
  189. {$EXTERNALSYM _DFS_INFO_4}
  190. DFS_INFO_4 = _DFS_INFO_4;
  191. {$EXTERNALSYM DFS_INFO_4}
  192. TDfsInfo4 = DFS_INFO_4;
  193. PDfsInfo4 = PDFS_INFO_4;
  194. //
  195. // Level 100:
  196. //
  197. LPDFS_INFO_100 = ^DFS_INFO_100;
  198. {$EXTERNALSYM LPDFS_INFO_100}
  199. PDFS_INFO_100 = ^DFS_INFO_100;
  200. {$EXTERNALSYM PDFS_INFO_100}
  201. _DFS_INFO_100 = record
  202. Comment: LPWSTR; // Comment for this volume or storage
  203. end;
  204. {$EXTERNALSYM _DFS_INFO_100}
  205. DFS_INFO_100 = _DFS_INFO_100;
  206. {$EXTERNALSYM DFS_INFO_100}
  207. TDfsInfo100 = DFS_INFO_100;
  208. PDfsInfo100 = PDFS_INFO_100;
  209. //
  210. // Level 101:
  211. //
  212. LPDFS_INFO_101 = ^DFS_INFO_101;
  213. {$EXTERNALSYM LPDFS_INFO_101}
  214. PDFS_INFO_101 = ^DFS_INFO_101;
  215. {$EXTERNALSYM PDFS_INFO_101}
  216. _DFS_INFO_101 = record
  217. State: DWORD; // State of this storage, one of DFS_STORAGE_STATE_*
  218. // possibly OR'd with DFS_STORAGE_STATE_ACTIVE
  219. end;
  220. {$EXTERNALSYM _DFS_INFO_101}
  221. DFS_INFO_101 = _DFS_INFO_101;
  222. {$EXTERNALSYM DFS_INFO_101}
  223. TDfsInfo101 = DFS_INFO_101;
  224. PDfsInfo101 = PDFS_INFO_101;
  225. //
  226. // Level 102:
  227. //
  228. LPDFS_INFO_102 = ^DFS_INFO_102;
  229. {$EXTERNALSYM LPDFS_INFO_102}
  230. PDFS_INFO_102 = ^DFS_INFO_102;
  231. {$EXTERNALSYM PDFS_INFO_102}
  232. _DFS_INFO_102 = record
  233. Timeout: ULONG; // Timeout, in seconds, of the junction
  234. end;
  235. {$EXTERNALSYM _DFS_INFO_102}
  236. DFS_INFO_102 = _DFS_INFO_102;
  237. {$EXTERNALSYM DFS_INFO_102}
  238. TDfsInfo102 = DFS_INFO_102;
  239. PDfsInfo102 = PDFS_INFO_102;
  240. //
  241. // Level 200:
  242. //
  243. LPDFS_INFO_200 = ^DFS_INFO_200;
  244. {$EXTERNALSYM LPDFS_INFO_200}
  245. PDFS_INFO_200 = ^DFS_INFO_200;
  246. {$EXTERNALSYM PDFS_INFO_200}
  247. _DFS_INFO_200 = record
  248. FtDfsName: LPWSTR; // FtDfs name
  249. end;
  250. {$EXTERNALSYM _DFS_INFO_200}
  251. DFS_INFO_200 = _DFS_INFO_200;
  252. {$EXTERNALSYM DFS_INFO_200}
  253. TDfsInfo200 = DFS_INFO_200;
  254. PDfsInfo200 = PDFS_INFO_200;
  255. //
  256. // Level 300:
  257. //
  258. LPDFS_INFO_300 = ^DFS_INFO_300;
  259. {$EXTERNALSYM LPDFS_INFO_300}
  260. PDFS_INFO_300 = ^DFS_INFO_300;
  261. {$EXTERNALSYM PDFS_INFO_300}
  262. _DFS_INFO_300 = record
  263. Flags: DWORD;
  264. DfsName: LPWSTR; // Dfs name
  265. end;
  266. {$EXTERNALSYM _DFS_INFO_300}
  267. DFS_INFO_300 = _DFS_INFO_300;
  268. {$EXTERNALSYM DFS_INFO_300}
  269. TDfsInfo300 = DFS_INFO_300;
  270. PDfsInfo300 = PDFS_INFO_300;
  271. //
  272. // Add a new volume or additional storage for an existing volume at
  273. // DfsEntryPath.
  274. //
  275. function NetDfsAdd(DfsEntryPath, ServerName, ShareName, Comment: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
  276. {$EXTERNALSYM NetDfsAdd}
  277. //
  278. // Flags:
  279. //
  280. const
  281. DFS_ADD_VOLUME = 1; // Add a new volume to the DFS if not already there
  282. {$EXTERNALSYM DFS_ADD_VOLUME}
  283. DFS_RESTORE_VOLUME = 2; // Volume/Replica is being restored - do not verify share etc.
  284. {$EXTERNALSYM DFS_RESTORE_VOLUME}
  285. //
  286. // Setup/teardown API's for standard and FtDfs roots.
  287. //
  288. function NetDfsAddStdRoot(ServerName, RootShare, Comment: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
  289. {$EXTERNALSYM NetDfsAddStdRoot}
  290. function NetDfsRemoveStdRoot(ServerName, RootShare: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
  291. {$EXTERNALSYM NetDfsRemoveStdRoot}
  292. function NetDfsAddFtRoot(ServerName, RootShare, FtDfsName, Comment: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
  293. {$EXTERNALSYM NetDfsAddFtRoot}
  294. function NetDfsRemoveFtRoot(ServerName, RootShare, FtDfsName: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
  295. {$EXTERNALSYM NetDfsRemoveFtRoot}
  296. function NetDfsRemoveFtRootForced(DomainName, ServerName, RootShare, FtDfsName: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
  297. {$EXTERNALSYM NetDfsRemoveFtRootForced}
  298. //
  299. // Call to reinitialize the dfsmanager on a machine
  300. //
  301. function NetDfsManagerInitialize(ServerName: LPWSTR; Flags: DWORD): NET_API_STATUS; stdcall;
  302. {$EXTERNALSYM NetDfsManagerInitialize}
  303. function NetDfsAddStdRootForced(ServerName, RootShare, Comment, Store: LPWSTR): NET_API_STATUS; stdcall;
  304. {$EXTERNALSYM NetDfsAddStdRootForced}
  305. function NetDfsGetDcAddress(ServerName: LPWSTR; var DcIpAddress: LPWSTR; var IsRoot: BOOLEAN; Timeout: PULONG): NET_API_STATUS; stdcall;
  306. {$EXTERNALSYM NetDfsGetDcAddress}
  307. //
  308. // Flags for NetDfsSetDcAddress()
  309. //
  310. const
  311. NET_DFS_SETDC_FLAGS = $00000000;
  312. {$EXTERNALSYM NET_DFS_SETDC_FLAGS}
  313. NET_DFS_SETDC_TIMEOUT = $00000001;
  314. {$EXTERNALSYM NET_DFS_SETDC_TIMEOUT}
  315. NET_DFS_SETDC_INITPKT = $00000002;
  316. {$EXTERNALSYM NET_DFS_SETDC_INITPKT}
  317. //
  318. // Structures used for site reporting
  319. //
  320. type
  321. LPDFS_SITENAME_INFO = ^DFS_SITENAME_INFO;
  322. {$EXTERNALSYM LPDFS_SITENAME_INFO}
  323. PDFS_SITENAME_INFO = ^DFS_SITENAME_INFO;
  324. {$EXTERNALSYM PDFS_SITENAME_INFO}
  325. DFS_SITENAME_INFO = record
  326. SiteFlags: ULONG; // Below
  327. SiteName: LPWSTR;
  328. end;
  329. {$EXTERNALSYM DFS_SITENAME_INFO}
  330. TDfsSiteNameInfo = DFS_SITENAME_INFO;
  331. PDfsSiteNameInfo = PDFS_SITENAME_INFO;
  332. // SiteFlags
  333. const
  334. DFS_SITE_PRIMARY = $1; // This site returned by DsGetSiteName()
  335. {$EXTERNALSYM DFS_SITE_PRIMARY}
  336. type
  337. LPDFS_SITELIST_INFO = ^DFS_SITELIST_INFO;
  338. {$EXTERNALSYM LPDFS_SITELIST_INFO}
  339. PDFS_SITELIST_INFO = ^DFS_SITELIST_INFO;
  340. {$EXTERNALSYM PDFS_SITELIST_INFO}
  341. DFS_SITELIST_INFO = record
  342. cSites: ULONG;
  343. Site: array [0..0] of DFS_SITENAME_INFO;
  344. end;
  345. {$EXTERNALSYM DFS_SITELIST_INFO}
  346. TDfsSiteListInfo = DFS_SITELIST_INFO;
  347. PDfsSiteListInfo = PDFS_SITELIST_INFO;
  348. //
  349. // Remove a volume or additional storage for volume from the Dfs at
  350. // DfsEntryPath. When applied to the last storage in a volume, removes
  351. // the volume from the DFS.
  352. //
  353. function NetDfsRemove(DfsEntryPath, ServerName, ShareName: LPWSTR): NET_API_STATUS; stdcall;
  354. {$EXTERNALSYM NetDfsRemove}
  355. //
  356. // Get information about all of the volumes in the Dfs. DfsName is
  357. // the "server" part of the UNC name used to refer to this particular Dfs.
  358. //
  359. // Valid levels are 1-4, 200
  360. //
  361. function NetDfsEnum(DfsName: LPWSTR; Level, PrefMaxLen: DWORD; var Buffer: LPBYTE; EntriesRead, ResumeHandle: LPDWORD): NET_API_STATUS; stdcall;
  362. {$EXTERNALSYM NetDfsEnum}
  363. //
  364. // Get information about the volume or storage.
  365. // If ServerName and ShareName are specified, the information returned
  366. // is specific to that server and share, else the information is specific
  367. // to the volume as a whole.
  368. //
  369. // Valid levels are 1-4, 100
  370. //
  371. function NetDfsGetInfo(DfsEntryPath, ServerName, ShareName: LPWSTR; Level: DWORD; var Buffer: LPBYTE): NET_API_STATUS; stdcall;
  372. {$EXTERNALSYM NetDfsGetInfo}
  373. //
  374. // Set info about the volume or storage.
  375. // If ServerName and ShareName are specified, the information set is
  376. // specific to that server and share, else the information is specific
  377. // to the volume as a whole.
  378. //
  379. // Valid levels are 100, 101 and 102
  380. //
  381. function NetDfsSetInfo(DfsEntryPath, ServerName, ShareName: LPWSTR; Level: DWORD; Buffer: LPBYTE): NET_API_STATUS; stdcall;
  382. {$EXTERNALSYM NetDfsSetInfo}
  383. //
  384. // Get client's cached information about the volume or storage.
  385. // If ServerName and ShareName are specified, the information returned
  386. // is specific to that server and share, else the information is specific
  387. // to the volume as a whole.
  388. //
  389. // Valid levels are 1-4
  390. //
  391. function NetDfsGetClientInfo(DfsEntryPath, ServerName, ShareName: LPWSTR; Level: DWORD; var Buffer: LPBYTE): NET_API_STATUS; stdcall;
  392. {$EXTERNALSYM NetDfsGetClientInfo}
  393. //
  394. // Set client's cached info about the volume or storage.
  395. // If ServerName and ShareName are specified, the information set is
  396. // specific to that server and share, else the information is specific
  397. // to the volume as a whole.
  398. //
  399. // Valid levels are 101 and 102.
  400. //
  401. function NetDfsSetClientInfo(DfsEntryPath, ServerName, ShareName: LPWSTR; Level: DWORD; Buffer: LPBYTE): NET_API_STATUS; stdcall;
  402. {$EXTERNALSYM NetDfsSetClientInfo}
  403. //
  404. // Move a DFS volume and all subordinate volumes from one place in the
  405. // DFS to another place in the DFS.
  406. //
  407. function NetDfsMove(DfsEntryPath: LPWSTR; DfsNewEntryPath: LPWSTR): NET_API_STATUS; stdcall;
  408. {$EXTERNALSYM NetDfsMove}
  409. function NetDfsRename(Path: LPWSTR; NewPath: LPWSTR): NET_API_STATUS; stdcall;
  410. {$EXTERNALSYM NetDfsRename}
  411. implementation
  412. uses
  413. JwaWinDLLNames;
  414. {$IFDEF DYNAMIC_LINK}
  415. var
  416. _NetDfsAdd: Pointer;
  417. function NetDfsAdd;
  418. begin
  419. GetProcedureAddress(_NetDfsAdd, netapi32, 'NetDfsAdd');
  420. asm
  421. MOV ESP, EBP
  422. POP EBP
  423. JMP [_NetDfsAdd]
  424. end;
  425. end;
  426. var
  427. _NetDfsAddStdRoot: Pointer;
  428. function NetDfsAddStdRoot;
  429. begin
  430. GetProcedureAddress(_NetDfsAddStdRoot, netapi32, 'NetDfsAddStdRoot');
  431. asm
  432. MOV ESP, EBP
  433. POP EBP
  434. JMP [_NetDfsAddStdRoot]
  435. end;
  436. end;
  437. var
  438. _NetDfsRemoveStdRoot: Pointer;
  439. function NetDfsRemoveStdRoot;
  440. begin
  441. GetProcedureAddress(_NetDfsRemoveStdRoot, netapi32, 'NetDfsRemoveStdRoot');
  442. asm
  443. MOV ESP, EBP
  444. POP EBP
  445. JMP [_NetDfsRemoveStdRoot]
  446. end;
  447. end;
  448. var
  449. _NetDfsAddFtRoot: Pointer;
  450. function NetDfsAddFtRoot;
  451. begin
  452. GetProcedureAddress(_NetDfsAddFtRoot, netapi32, 'NetDfsAddFtRoot');
  453. asm
  454. MOV ESP, EBP
  455. POP EBP
  456. JMP [_NetDfsAddFtRoot]
  457. end;
  458. end;
  459. var
  460. _NetDfsRemoveFtRoot: Pointer;
  461. function NetDfsRemoveFtRoot;
  462. begin
  463. GetProcedureAddress(_NetDfsRemoveFtRoot, netapi32, 'NetDfsRemoveFtRoot');
  464. asm
  465. MOV ESP, EBP
  466. POP EBP
  467. JMP [_NetDfsRemoveFtRoot]
  468. end;
  469. end;
  470. var
  471. _NetDfsRemoveFtRootForced: Pointer;
  472. function NetDfsRemoveFtRootForced;
  473. begin
  474. GetProcedureAddress(_NetDfsRemoveFtRootForced, netapi32, 'NetDfsRemoveFtRootForced');
  475. asm
  476. MOV ESP, EBP
  477. POP EBP
  478. JMP [_NetDfsRemoveFtRootForced]
  479. end;
  480. end;
  481. var
  482. _NetDfsManagerInitialize: Pointer;
  483. function NetDfsManagerInitialize;
  484. begin
  485. GetProcedureAddress(_NetDfsManagerInitialize, netapi32, 'NetDfsManagerInitialize');
  486. asm
  487. MOV ESP, EBP
  488. POP EBP
  489. JMP [_NetDfsManagerInitialize]
  490. end;
  491. end;
  492. var
  493. _NetDfsAddStdRootForced: Pointer;
  494. function NetDfsAddStdRootForced;
  495. begin
  496. GetProcedureAddress(_NetDfsAddStdRootForced, netapi32, 'NetDfsAddStdRootForced');
  497. asm
  498. MOV ESP, EBP
  499. POP EBP
  500. JMP [_NetDfsAddStdRootForced]
  501. end;
  502. end;
  503. var
  504. _NetDfsGetDcAddress: Pointer;
  505. function NetDfsGetDcAddress;
  506. begin
  507. GetProcedureAddress(_NetDfsGetDcAddress, netapi32, 'NetDfsGetDcAddress');
  508. asm
  509. MOV ESP, EBP
  510. POP EBP
  511. JMP [_NetDfsGetDcAddress]
  512. end;
  513. end;
  514. var
  515. _NetDfsRemove: Pointer;
  516. function NetDfsRemove;
  517. begin
  518. GetProcedureAddress(_NetDfsRemove, netapi32, 'NetDfsRemove');
  519. asm
  520. MOV ESP, EBP
  521. POP EBP
  522. JMP [_NetDfsRemove]
  523. end;
  524. end;
  525. var
  526. _NetDfsEnum: Pointer;
  527. function NetDfsEnum;
  528. begin
  529. GetProcedureAddress(_NetDfsEnum, netapi32, 'NetDfsEnum');
  530. asm
  531. MOV ESP, EBP
  532. POP EBP
  533. JMP [_NetDfsEnum]
  534. end;
  535. end;
  536. var
  537. _NetDfsGetInfo: Pointer;
  538. function NetDfsGetInfo;
  539. begin
  540. GetProcedureAddress(_NetDfsGetInfo, netapi32, 'NetDfsGetInfo');
  541. asm
  542. MOV ESP, EBP
  543. POP EBP
  544. JMP [_NetDfsGetInfo]
  545. end;
  546. end;
  547. var
  548. _NetDfsSetInfo: Pointer;
  549. function NetDfsSetInfo;
  550. begin
  551. GetProcedureAddress(_NetDfsSetInfo, netapi32, 'NetDfsSetInfo');
  552. asm
  553. MOV ESP, EBP
  554. POP EBP
  555. JMP [_NetDfsSetInfo]
  556. end;
  557. end;
  558. var
  559. _NetDfsGetClientInfo: Pointer;
  560. function NetDfsGetClientInfo;
  561. begin
  562. GetProcedureAddress(_NetDfsGetClientInfo, netapi32, 'NetDfsGetClientInfo');
  563. asm
  564. MOV ESP, EBP
  565. POP EBP
  566. JMP [_NetDfsGetClientInfo]
  567. end;
  568. end;
  569. var
  570. _NetDfsSetClientInfo: Pointer;
  571. function NetDfsSetClientInfo;
  572. begin
  573. GetProcedureAddress(_NetDfsSetClientInfo, netapi32, 'NetDfsSetClientInfo');
  574. asm
  575. MOV ESP, EBP
  576. POP EBP
  577. JMP [_NetDfsSetClientInfo]
  578. end;
  579. end;
  580. var
  581. _NetDfsMove: Pointer;
  582. function NetDfsMove;
  583. begin
  584. GetProcedureAddress(_NetDfsMove, netapi32, 'NetDfsMove');
  585. asm
  586. MOV ESP, EBP
  587. POP EBP
  588. JMP [_NetDfsMove]
  589. end;
  590. end;
  591. var
  592. _NetDfsRename: Pointer;
  593. function NetDfsRename;
  594. begin
  595. GetProcedureAddress(_NetDfsRename, netapi32, 'NetDfsRename');
  596. asm
  597. MOV ESP, EBP
  598. POP EBP
  599. JMP [_NetDfsRename]
  600. end;
  601. end;
  602. {$ELSE}
  603. function NetDfsAdd; external netapi32 name 'NetDfsAdd';
  604. function NetDfsAddStdRoot; external netapi32 name 'NetDfsAddStdRoot';
  605. function NetDfsRemoveStdRoot; external netapi32 name 'NetDfsRemoveStdRoot';
  606. function NetDfsAddFtRoot; external netapi32 name 'NetDfsAddFtRoot';
  607. function NetDfsRemoveFtRoot; external netapi32 name 'NetDfsRemoveFtRoot';
  608. function NetDfsRemoveFtRootForced; external netapi32 name 'NetDfsRemoveFtRootForced';
  609. function NetDfsManagerInitialize; external netapi32 name 'NetDfsManagerInitialize';
  610. function NetDfsAddStdRootForced; external netapi32 name 'NetDfsAddStdRootForced';
  611. function NetDfsGetDcAddress; external netapi32 name 'NetDfsGetDcAddress';
  612. function NetDfsRemove; external netapi32 name 'NetDfsRemove';
  613. function NetDfsEnum; external netapi32 name 'NetDfsEnum';
  614. function NetDfsGetInfo; external netapi32 name 'NetDfsGetInfo';
  615. function NetDfsSetInfo; external netapi32 name 'NetDfsSetInfo';
  616. function NetDfsGetClientInfo; external netapi32 name 'NetDfsGetClientInfo';
  617. function NetDfsSetClientInfo; external netapi32 name 'NetDfsSetClientInfo';
  618. function NetDfsMove; external netapi32 name 'NetDfsMove';
  619. function NetDfsRename; external netapi32 name 'NetDfsRename';
  620. {$ENDIF DYNAMIC_LINK}
  621. end.