home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / lmdfs.h < prev    next >
C/C++ Source or Header  |  2000-02-01  |  13KB  |  388 lines

  1. /*++ BUILD Version: 0001    // Increment this if a change has global effects
  2.  
  3. Copyright (c) 1991-1999  Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     lmdfs.h
  8.  
  9. Abstract:
  10.  
  11.     This file contains structures, function prototypes, and definitions
  12.     for the NetDfs API
  13.  
  14. Environment:
  15.  
  16.     User Mode - Win32
  17.  
  18. Notes:
  19.  
  20.     You must include <windef.h> and <lmcons.h> before this file.
  21.  
  22. --*/
  23.  
  24. #ifndef _LMDFS_
  25. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  26. #define _LMDFS_
  27.  
  28. #if _MSC_VER > 1000
  29. #pragma once
  30. #endif
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. //
  37. // DFS Volume state
  38. //
  39.  
  40. #define DFS_VOLUME_STATE_OK            1
  41. #define DFS_VOLUME_STATE_INCONSISTENT  2
  42. #define DFS_VOLUME_STATE_OFFLINE       3
  43. #define DFS_VOLUME_STATE_ONLINE        4
  44.  
  45. //
  46. // DFS Storage State
  47. //
  48.  
  49. #define DFS_STORAGE_STATE_OFFLINE      1
  50. #define DFS_STORAGE_STATE_ONLINE       2
  51. #define DFS_STORAGE_STATE_ACTIVE       4
  52.  
  53. //
  54. // Level 1:
  55. //
  56. typedef struct _DFS_INFO_1 {
  57.     LPWSTR  EntryPath;              // Dfs name for the top of this piece of storage
  58. } DFS_INFO_1, *PDFS_INFO_1, *LPDFS_INFO_1;
  59.  
  60. //
  61. // Level 2:
  62. //
  63. typedef struct _DFS_INFO_2 {
  64.     LPWSTR  EntryPath;              // Dfs name for the top of this volume
  65.     LPWSTR  Comment;                // Comment for this volume
  66.     DWORD   State;                  // State of this volume, one of DFS_VOLUME_STATE_*
  67.     DWORD   NumberOfStorages;       // Number of storages for this volume
  68. } DFS_INFO_2, *PDFS_INFO_2, *LPDFS_INFO_2;
  69.  
  70. typedef struct _DFS_STORAGE_INFO {
  71.     ULONG   State;                  // State of this storage, one of DFS_STORAGE_STATE_*
  72.                                     // possibly OR'd with DFS_STORAGE_STATE_ACTIVE
  73.     LPWSTR  ServerName;             // Name of server hosting this storage
  74.     LPWSTR  ShareName;              // Name of share hosting this storage
  75. } DFS_STORAGE_INFO, *PDFS_STORAGE_INFO, *LPDFS_STORAGE_INFO;
  76.  
  77. //
  78. // Level 3:
  79. //
  80. typedef struct _DFS_INFO_3 {
  81.     LPWSTR  EntryPath;              // Dfs name for the top of this volume
  82.     LPWSTR  Comment;                // Comment for this volume
  83.     DWORD   State;                  // State of this volume, one of DFS_VOLUME_STATE_*
  84.     DWORD   NumberOfStorages;       // Number of storage servers for this volume
  85. #ifdef MIDL_PASS
  86.     [size_is(NumberOfStorages)] LPDFS_STORAGE_INFO Storage;
  87. #else
  88.     LPDFS_STORAGE_INFO   Storage;   // An array (of NumberOfStorages elements) of storage-specific information.
  89. #endif // MIDL_PASS
  90. } DFS_INFO_3, *PDFS_INFO_3, *LPDFS_INFO_3;
  91.  
  92. //
  93. // Level 4:
  94. //
  95. typedef struct _DFS_INFO_4 {
  96.     LPWSTR  EntryPath;              // Dfs name for the top of this volume
  97.     LPWSTR  Comment;                // Comment for this volume
  98.     DWORD   State;                  // State of this volume, one of DFS_VOLUME_STATE_*
  99.     ULONG   Timeout;                // Timeout, in seconds, of this junction point
  100.     GUID    Guid;                   // Guid of this junction point
  101.     DWORD   NumberOfStorages;       // Number of storage servers for this volume
  102. #ifdef MIDL_PASS
  103.     [size_is(NumberOfStorages)] LPDFS_STORAGE_INFO Storage;
  104. #else
  105.     LPDFS_STORAGE_INFO   Storage;   // An array (of NumberOfStorages elements) of storage-specific information.
  106. #endif // MIDL_PASS
  107. } DFS_INFO_4, *PDFS_INFO_4, *LPDFS_INFO_4;
  108.  
  109. //
  110. // Level 100:
  111. //
  112. typedef struct _DFS_INFO_100 {
  113.     LPWSTR  Comment;                // Comment for this volume or storage
  114. } DFS_INFO_100, *PDFS_INFO_100, *LPDFS_INFO_100;
  115.  
  116. //
  117. // Level 101:
  118. //
  119. typedef struct _DFS_INFO_101 {
  120.     DWORD   State;                  // State of this storage, one of DFS_STORAGE_STATE_*
  121.                                     // possibly OR'd with DFS_STORAGE_STATE_ACTIVE
  122. } DFS_INFO_101, *PDFS_INFO_101, *LPDFS_INFO_101;
  123.  
  124. //
  125. // Level 102:
  126. //
  127. typedef struct _DFS_INFO_102 {
  128.     ULONG   Timeout;                // Timeout, in seconds, of the junction
  129. } DFS_INFO_102, *PDFS_INFO_102, *LPDFS_INFO_102;
  130.  
  131. //
  132. // Level 200:
  133. //
  134. typedef struct _DFS_INFO_200 {
  135.     LPWSTR  FtDfsName;              // FtDfs name
  136. } DFS_INFO_200, *PDFS_INFO_200, *LPDFS_INFO_200;
  137.  
  138. //
  139. // Add a new volume or additional storage for an existing volume at
  140. // DfsEntryPath.
  141. //
  142. NET_API_STATUS NET_API_FUNCTION
  143. NetDfsAdd(
  144.     IN  LPWSTR DfsEntryPath,        // DFS entry path for this added volume or storage
  145.     IN  LPWSTR ServerName,          // Name of server hosting the storage
  146.     IN  LPWSTR ShareName,           // Existing share name for the storage
  147.     IN  LPWSTR Comment OPTIONAL,    // Optional comment for this volume or storage
  148.     IN  DWORD  Flags                // See below. Zero for no flags.
  149. );
  150.  
  151. //
  152. // Flags:
  153. //
  154. #define DFS_ADD_VOLUME          1   // Add a new volume to the DFS if not already there
  155. #define DFS_RESTORE_VOLUME      2   // Volume/Replica is being restored - do not verify share etc.
  156.  
  157. //
  158. // Setup/teardown API's for standard and FtDfs roots.
  159. //
  160.  
  161. NET_API_STATUS NET_API_FUNCTION
  162. NetDfsAddStdRoot(
  163.     IN  LPWSTR ServerName,          // Server to remote to
  164.     IN  LPWSTR RootShare,           // Share to make Dfs root
  165.     IN  LPWSTR Comment OPTIONAL,    // Comment
  166.     IN  DWORD  Flags                // Flags for operation.  Zero for no flags.
  167. );
  168.  
  169. NET_API_STATUS NET_API_FUNCTION
  170. NetDfsRemoveStdRoot(
  171.     IN  LPWSTR ServerName,          // Server to remote to
  172.     IN  LPWSTR RootShare,           // Share that host Dfs root
  173.     IN  DWORD  Flags                // Flags for operation.  Zero for no flags.
  174. );
  175.  
  176. NET_API_STATUS NET_API_FUNCTION
  177. NetDfsAddFtRoot(
  178.     IN  LPWSTR ServerName,          // Server to remote to
  179.     IN  LPWSTR RootShare,           // Share to make Dfs root
  180.     IN  LPWSTR FtDfsName,           // Name of FtDfs to create/join
  181.     IN  LPWSTR Comment,             // Comment
  182.     IN  DWORD  Flags                // Flags for operation.  Zero for no flags.
  183. );
  184.  
  185. NET_API_STATUS NET_API_FUNCTION
  186. NetDfsRemoveFtRoot(
  187.     IN  LPWSTR ServerName,          // Server to remote to
  188.     IN  LPWSTR RootShare,           // Share that host Dfs root
  189.     IN  LPWSTR FtDfsName,           // Name of FtDfs to remove or unjoin from.
  190.     IN  DWORD  Flags                // Flags for operation.  Zero for no flags.
  191. );
  192.  
  193. NET_API_STATUS NET_API_FUNCTION
  194. NetDfsRemoveFtRootForced(
  195.     IN  LPWSTR DomainName,          // Name of domain the server is in
  196.     IN  LPWSTR ServerName,          // Server to remote to
  197.     IN  LPWSTR RootShare,           // Share that host Dfs root
  198.     IN  LPWSTR FtDfsName,           // Name of FtDfs to remove or unjoin from.
  199.     IN  DWORD  Flags                // Flags for operation.  Zero for no flags.
  200. );
  201.  
  202. //
  203. // Call to reinitialize the dfsmanager on a machine
  204. //
  205.  
  206. NET_API_STATUS NET_API_FUNCTION
  207. NetDfsManagerInitialize(
  208.     IN  LPWSTR ServerName,          // Server to remote to
  209.     IN  DWORD  Flags                // Flags for operation.  Zero for no flags.
  210. );
  211.  
  212. NET_API_STATUS NET_API_FUNCTION
  213. NetDfsAddStdRootForced(
  214.     IN  LPWSTR ServerName,          // Server to remote to
  215.     IN  LPWSTR RootShare,           // Share to make Dfs root
  216.     IN  LPWSTR Comment OPTIONAL,    // Comment
  217.     IN  LPWSTR Store                // Drive:\dir backing the share
  218. );
  219.  
  220. NET_API_STATUS NET_API_FUNCTION
  221. NetDfsGetDcAddress(
  222.     IN  LPWSTR ServerName,          // Server to remote to
  223.     IN  OUT LPWSTR *DcIpAddress,    // The IP address of the DC to use
  224.     IN  OUT BOOLEAN *IsRoot,        // TRUE if server is a Dfs root, FALSE otherwise
  225.     IN  OUT ULONG *Timeout          // Time, in sec, that we stay with this DC
  226. );
  227.  
  228. NET_API_STATUS NET_API_FUNCTION
  229. NetDfsSetDcAddress(
  230.     IN  LPWSTR ServerName,          // Server to remote to
  231.     IN  LPWSTR DcIpAddress,         // The IP address of the DC to use
  232.     IN  ULONG Timeout,              // Time, in sec, to stay with this DC
  233.     IN  DWORD Flags                 // See below
  234. );
  235.  
  236. //
  237. // Flags for NetDfsSetDcAddress()
  238. //
  239.  
  240. #define NET_DFS_SETDC_FLAGS                 0x00000000
  241. #define NET_DFS_SETDC_TIMEOUT               0x00000001
  242. #define NET_DFS_SETDC_INITPKT               0x00000002
  243.  
  244. //
  245. // Structures used for site reporting
  246. //
  247.  
  248. typedef struct {
  249.     ULONG SiteFlags;    // Below
  250. #ifdef  MIDL_PASS
  251.     [string,unique] LPWSTR SiteName;
  252. #else
  253.     LPWSTR SiteName;
  254. #endif
  255. } DFS_SITENAME_INFO, *PDFS_SITENAME_INFO, *LPDFS_SITENAME_INFO;
  256.  
  257. // SiteFlags
  258.  
  259. #define DFS_SITE_PRIMARY    0x1     // This site returned by DsGetSiteName()
  260.  
  261. typedef struct {
  262.     ULONG cSites;
  263. #ifdef  MIDL_PASS
  264.     [size_is(cSites)] DFS_SITENAME_INFO Site[];
  265. #else
  266.     DFS_SITENAME_INFO Site[1];
  267. #endif
  268. } DFS_SITELIST_INFO, *PDFS_SITELIST_INFO, *LPDFS_SITELIST_INFO;
  269.  
  270. //
  271. // Remove a volume or additional storage for volume from the Dfs at
  272. // DfsEntryPath. When applied to the last storage in a volume, removes
  273. // the volume from the DFS.
  274. //
  275. NET_API_STATUS NET_API_FUNCTION
  276. NetDfsRemove(
  277.     IN  LPWSTR  DfsEntryPath,       // DFS entry path for this added volume or storage
  278.     IN  LPWSTR  ServerName,         // Name of server hosting the storage
  279.     IN  LPWSTR  ShareName           // Name of share hosting the storage
  280. );
  281.  
  282. //
  283. // Get information about all of the volumes in the Dfs. DfsName is
  284. // the "server" part of the UNC name used to refer to this particular Dfs.
  285. //
  286. // Valid levels are 1-4, 200
  287. //
  288. NET_API_STATUS NET_API_FUNCTION
  289. NetDfsEnum(
  290.     IN      LPWSTR  DfsName,        // Name of the Dfs for enumeration
  291.     IN      DWORD   Level,          // Level of information requested
  292.     IN      DWORD   PrefMaxLen,     // Advisory, but -1 means "get it all"
  293.     OUT     LPBYTE* Buffer,         // API allocates and returns buffer with requested info
  294.     OUT     LPDWORD EntriesRead,    // Number of entries returned
  295.     IN OUT  LPDWORD ResumeHandle    // Must be 0 on first call, reused on subsequent calls
  296. );
  297.  
  298. //
  299. // Get information about the volume or storage.
  300. // If ServerName and ShareName are specified, the information returned
  301. // is specific to that server and share, else the information is specific
  302. // to the volume as a whole.
  303. //
  304. // Valid levels are 1-4, 100
  305. //
  306. NET_API_STATUS NET_API_FUNCTION
  307. NetDfsGetInfo(
  308.     IN  LPWSTR  DfsEntryPath,       // DFS entry path for the volume
  309.     IN  LPWSTR  ServerName OPTIONAL,// Name of server hosting a storage
  310.     IN  LPWSTR  ShareName OPTIONAL, // Name of share on server serving the volume
  311.     IN  DWORD   Level,              // Level of information requested
  312.     OUT LPBYTE* Buffer              // API allocates and returns buffer with requested info
  313. );
  314.  
  315. //
  316. // Set info about the volume or storage.
  317. // If ServerName and ShareName are specified, the information set is
  318. // specific to that server and share, else the information is specific
  319. // to the volume as a whole.
  320. //
  321. // Valid levels are 100, 101 and 102
  322. //
  323. NET_API_STATUS NET_API_FUNCTION
  324. NetDfsSetInfo(
  325.     IN  LPWSTR  DfsEntryPath,           // DFS entry path for the volume
  326.     IN  LPWSTR  ServerName OPTIONAL,    // Name of server hosting a storage
  327.     IN  LPWSTR  ShareName OPTIONAL,     // Name of share hosting a storage
  328.     IN  DWORD   Level,                  // Level of information to be set
  329.     IN  LPBYTE  Buffer                  // Buffer holding information
  330. );
  331.  
  332. //
  333. // Get client's cached information about the volume or storage.
  334. // If ServerName and ShareName are specified, the information returned
  335. // is specific to that server and share, else the information is specific
  336. // to the volume as a whole.
  337. //
  338. // Valid levels are 1-4
  339. //
  340. NET_API_STATUS NET_API_FUNCTION
  341. NetDfsGetClientInfo(
  342.     IN  LPWSTR  DfsEntryPath,       // DFS entry path for the volume
  343.     IN  LPWSTR  ServerName OPTIONAL,// Name of server hosting a storage
  344.     IN  LPWSTR  ShareName OPTIONAL, // Name of share on server serving the volume
  345.     IN  DWORD   Level,              // Level of information requested
  346.     OUT LPBYTE* Buffer              // API allocates and returns buffer with requested info
  347. );
  348.  
  349. //
  350. // Set client's cached info about the volume or storage.
  351. // If ServerName and ShareName are specified, the information set is
  352. // specific to that server and share, else the information is specific
  353. // to the volume as a whole.
  354. //
  355. // Valid levels are 101 and 102.
  356. //
  357. NET_API_STATUS NET_API_FUNCTION
  358. NetDfsSetClientInfo(
  359.     IN  LPWSTR  DfsEntryPath,           // DFS entry path for the volume
  360.     IN  LPWSTR  ServerName OPTIONAL,    // Name of server hosting a storage
  361.     IN  LPWSTR  ShareName OPTIONAL,     // Name of share hosting a storage
  362.     IN  DWORD   Level,                  // Level of information to be set
  363.     IN  LPBYTE  Buffer                  // Buffer holding information
  364. );
  365.  
  366. //
  367. // Move a DFS volume and all subordinate volumes from one place in the
  368. // DFS to another place in the DFS.
  369. //
  370. NET_API_STATUS NET_API_FUNCTION
  371. NetDfsMove(
  372.     IN  LPWSTR  DfsEntryPath,           // Current DFS entry path for this volume
  373.     IN  LPWSTR  DfsNewEntryPath         // New DFS entry path for this volume
  374. );
  375.  
  376. NET_API_STATUS NET_API_FUNCTION
  377. NetDfsRename(
  378.     IN  LPWSTR  Path,                   // Current Win32 path in a Dfs
  379.     IN  LPWSTR  NewPath                 // New Win32 path in the same Dfs
  380. );
  381.  
  382. #ifdef __cplusplus
  383. }
  384. #endif
  385.  
  386. #pragma option pop /*P_O_Pop*/
  387. #endif // _LMDFS_
  388.