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