jwalmdfs.pas 21 KB

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