home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / lmdfs.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  7KB  |  201 lines

  1. /*++ BUILD Version: 0001    // Increment this if a change has global effects
  2.  
  3. Copyright 1991-1998 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. #define _LMDFS_
  26.  
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30.  
  31. //
  32. // DFS Volume state
  33. //
  34.  
  35. #define DFS_VOLUME_STATE_OK            1
  36. #define DFS_VOLUME_STATE_INCONSISTENT  2
  37. #define DFS_VOLUME_STATE_OFFLINE       3
  38. #define DFS_VOLUME_STATE_ONLINE        4
  39.  
  40. //
  41. // DFS Storage State
  42. //
  43.  
  44. #define DFS_STORAGE_STATE_OFFLINE      1
  45. #define DFS_STORAGE_STATE_ONLINE       2
  46.  
  47. //
  48. // Level 1:
  49. //
  50. typedef struct _DFS_INFO_1 {
  51.     LPWSTR  EntryPath;              // Dfs name for the top of this piece of storage
  52. } DFS_INFO_1, *PDFS_INFO_1, *LPDFS_INFO_1;
  53.  
  54. //
  55. // Level 2:
  56. //
  57. typedef struct _DFS_INFO_2 {
  58.     LPWSTR  EntryPath;              // Dfs name for the top of this volume
  59.     LPWSTR  Comment;                // Comment for this volume
  60.     DWORD   State;                  // State of this volume, one of DFS_VOLUME_STATE_*
  61.     DWORD   NumberOfStorages;       // Number of storages for this volume
  62. } DFS_INFO_2, *PDFS_INFO_2, *LPDFS_INFO_2;
  63.  
  64. typedef struct _DFS_STORAGE_INFO {
  65.     ULONG   State;                  // State of this storage, one of DFS_STORAGE_STATE_*
  66.     LPWSTR  ServerName;             // Name of server hosting this storage
  67.     LPWSTR  ShareName;              // Name of share hosting this storage
  68. } DFS_STORAGE_INFO, *PDFS_STORAGE_INFO, *LPDFS_STORAGE_INFO;
  69.  
  70. //
  71. // Level 3:
  72. //
  73. typedef struct _DFS_INFO_3 {
  74.     LPWSTR  EntryPath;              // Dfs name for the top of this volume
  75.     LPWSTR  Comment;                // Comment for this volume
  76.     DWORD   State;                  // State of this volume, one of DFS_VOLUME_STATE_*
  77.     DWORD   NumberOfStorages;       // Number of storage servers for this volume
  78. #ifdef MIDL_PASS
  79.     [size_is(NumberOfStorages)] LPDFS_STORAGE_INFO Storage;
  80. #else
  81.     LPDFS_STORAGE_INFO   Storage;   // An array (of NumberOfStorages elements) of storage-specific information.
  82. #endif // MIDL_PASS
  83. } DFS_INFO_3, *PDFS_INFO_3, *LPDFS_INFO_3;
  84.  
  85. //
  86. // Level 100:
  87. //
  88. typedef struct _DFS_INFO_100 {
  89.     LPWSTR  Comment;                // Comment for this volume or storage
  90. } DFS_INFO_100, *PDFS_INFO_100, *LPDFS_INFO_100;
  91.  
  92. //
  93. // Level 101:
  94. //
  95. typedef struct _DFS_INFO_101 {
  96.     DWORD   State;                  // State of this storage, one of DFS_STORAGE_STATE_*
  97. } DFS_INFO_101, *PDFS_INFO_101, *LPDFS_INFO_101;
  98.  
  99. //
  100. // Add a new volume or additional storage for an existing volume at
  101. // DfsEntryPath.
  102. //
  103. NET_API_STATUS NET_API_FUNCTION
  104. NetDfsAdd(
  105.     IN  LPWSTR DfsEntryPath,        // DFS entry path for this added volume or storage
  106.     IN  LPWSTR ServerName,          // Name of server hosting the storage
  107.     IN  LPWSTR ShareName,           // Existing share name for the storage
  108.     IN  LPWSTR Comment OPTIONAL,    // Optional comment for this volume or storage
  109.     IN  DWORD  Flags                // See below. Zero for no flags.
  110. );
  111.  
  112. //
  113. // Flags:
  114. //
  115. #define DFS_ADD_VOLUME          1   // Add a new volume to the DFS if not already there
  116. #define DFS_RESTORE_VOLUME      2   // Volume/Replica is being restored - do not verify share etc.
  117.  
  118. //
  119. // Remove a volume or additional storage for volume from the Dfs at
  120. // DfsEntryPath. When applied to the last storage in a volume, removes
  121. // the volume from the DFS.
  122. //
  123. NET_API_STATUS NET_API_FUNCTION
  124. NetDfsRemove(
  125.     IN  LPWSTR  DfsEntryPath,       // DFS entry path for this added volume or storage
  126.     IN  LPWSTR  ServerName,         // Name of server hosting the storage
  127.     IN  LPWSTR  ShareName           // Name of share hosting the storage
  128. );
  129.  
  130. //
  131. // Get information about all of the volumes in the Dfs. DfsName is
  132. // the "server" part of the UNC name used to refer to this particular Dfs.
  133. //
  134. // Valid levels are 1-3.
  135. //
  136. NET_API_STATUS NET_API_FUNCTION
  137. NetDfsEnum(
  138.     IN      LPWSTR  DfsName,        // Name of the Dfs for enumeration
  139.     IN      DWORD   Level,          // Level of information requested
  140.     IN      DWORD   PrefMaxLen,     // Advisory, but -1 means "get it all"
  141.     OUT     LPBYTE* Buffer,         // API allocates and returns buffer with requested info
  142.     OUT     LPDWORD EntriesRead,    // Number of entries returned
  143.     IN OUT  LPDWORD ResumeHandle    // Must be 0 on first call, reused on subsequent calls
  144. );
  145.  
  146. //
  147. // Get information about the volume or storage.
  148. // If ServerName and ShareName are specified, the information returned
  149. // is specific to that server and share, else the information is specific
  150. // to the volume as a whole.
  151. //
  152. // Valid levels are 1-3, 100-101.
  153. //
  154. NET_API_STATUS NET_API_FUNCTION
  155. NetDfsGetInfo(
  156.     IN  LPWSTR  DfsEntryPath,       // DFS entry path for the volume
  157.     IN  LPWSTR  ServerName OPTIONAL,// Name of server hosting a storage
  158.     IN  LPWSTR  ShareName OPTIONAL, // Name of share on server serving the volume
  159.     IN  DWORD   Level,              // Level of information requested
  160.     OUT LPBYTE* Buffer              // API allocates and returns buffer with requested info
  161. );
  162.  
  163. //
  164. // Set info about the volume or storage.
  165. // If ServerName and ShareName are specified, the information set is
  166. // specific to that server and share, else the information is specific
  167. // to the volume as a whole.
  168. //
  169. // Valid levels are 100 and 101.
  170. //
  171. NET_API_STATUS NET_API_FUNCTION
  172. NetDfsSetInfo(
  173.     IN  LPWSTR  DfsEntryPath,           // DFS entry path for the volume
  174.     IN  LPWSTR  ServerName OPTIONAL,    // Name of server hosting a storage
  175.     IN  LPWSTR  ShareName OPTIONAL,     // Name of share hosting a storage
  176.     IN  DWORD   Level,                  // Level of information to be set
  177.     IN  LPBYTE  Buffer                  // Buffer holding information
  178. );
  179.  
  180. //
  181. // Move a DFS volume and all subordinate volumes from one place in the
  182. // DFS to another place in the DFS.
  183. //
  184. NET_API_STATUS NET_API_FUNCTION
  185. NetDfsMove(
  186.     IN  LPWSTR  DfsEntryPath,           // Current DFS entry path for this volume
  187.     IN  LPWSTR  DfsNewEntryPath         // New DFS entry path for this volume
  188. );
  189.  
  190. NET_API_STATUS NET_API_FUNCTION
  191. NetDfsRename(
  192.     IN  LPWSTR  Path,                   // Current Win32 path in a Dfs
  193.     IN  LPWSTR  NewPath                 // New Win32 path in the same Dfs
  194. );
  195.  
  196. #ifdef __cplusplus
  197. }
  198. #endif
  199.  
  200. #endif // _LMDFS_
  201.