1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
/*++ BUILD Version: 0001 // Increment this if a change has global effects
Copyright (c) 1991-1995 Microsoft Corporation
Module Name:
lmdfs.h
Abstract:
This file contains structures, function prototypes, and definitions
for the NetDfs API
Environment:
User Mode - Win32
Notes:
You must include <windef.h> and <lmcons.h> before this file.
--*/
#ifndef _LMDFS_
#define _LMDFS_
#ifdef __cplusplus
extern "C" {
#endif
//
// DFS Volume state
//
#define DFS_VOLUME_STATE_OK 1
#define DFS_VOLUME_STATE_INCONSISTENT 2
#define DFS_VOLUME_STATE_OFFLINE 3
#define DFS_VOLUME_STATE_ONLINE 4
//
// DFS Storage State
//
#define DFS_STORAGE_STATE_OFFLINE 1
#define DFS_STORAGE_STATE_ONLINE 2
//
// Path Type flags
//
#define DFS_PATH_NONDFS 1 // eg, d:\foo\bar or \\nwsrv1\vol, where neither is in a Dfs at all.
#define DFS_PATH_REDIRECTED 2 // eg, x:\foo\bar, where x:\ is a Dfs redirected drive
#define DFS_PATH_LOCAL 3 // eg, c:\foo\bar, where c:\foo\bar is in Dfs
#define DFS_PATH_UNC_IN_DFS 4 // eg, \\remote-server\share, where \\remote-server\share is in Dfs
#define DFS_PATH_UNIVERSAL 5 // eg, \\c_or_d\DFS\foo\bar
//
// Level 1:
//
typedef struct _DFS_INFO_1 {
LPWSTR EntryPath; // Dfs name for the top of this piece of storage
} DFS_INFO_1, *PDFS_INFO_1, *LPDFS_INFO_1;
//
// Level 2:
//
typedef struct _DFS_INFO_2 {
LPWSTR EntryPath; // Dfs name for the top of this volume
LPWSTR Comment; // Comment for this volume
DWORD State; // State of this volume, one of DFS_VOLUME_STATE_*
DWORD NumberOfStorages; // Number of storages for this volume
} DFS_INFO_2, *PDFS_INFO_2, *LPDFS_INFO_2;
typedef struct _DFS_STORAGE_INFO {
ULONG State; // State of this storage, one of DFS_STORAGE_STATE_*
LPWSTR ServerName; // Name of server hosting this storage
LPWSTR ShareName; // Name of share hosting this storage
} DFS_STORAGE_INFO, *PDFS_STORAGE_INFO, *LPDFS_STORAGE_INFO;
//
// Level 3:
//
typedef struct _DFS_INFO_3 {
LPWSTR EntryPath; // Dfs name for the top of this volume
LPWSTR Comment; // Comment for this volume
DWORD State; // State of this volume, one of DFS_VOLUME_STATE_*
DWORD NumberOfStorages; // Number of storage servers for this volume
#ifdef MIDL_PASS
[size_is(NumberOfStorages)] LPDFS_STORAGE_INFO Storage;
#else
LPDFS_STORAGE_INFO Storage; // An array (of NumberOfStorages elements) of storage-specific information.
#endif // MIDL_PASS
} DFS_INFO_3, *PDFS_INFO_3, *LPDFS_INFO_3;
//
// Level 100:
//
typedef struct _DFS_INFO_100 {
LPWSTR Comment; // Comment for this volume or storage
} DFS_INFO_100, *PDFS_INFO_100, *LPDFS_INFO_100;
//
// Level 101:
//
typedef struct _DFS_INFO_101 {
DWORD State; // State of this storage, one of DFS_STORAGE_STATE_*
} DFS_INFO_101, *PDFS_INFO_101, *LPDFS_INFO_101;
//
// Level 200:
//
typedef struct _DFS_INFO_200 {
DWORD PathType; // Type of path, see DFS_PATH_XXX flags
} DFS_INFO_200, *PDFS_INFO_200, *LPDFS_INFO_200;
//
// Level 201:
//
typedef struct _DFS_INFO_201 {
DWORD PathType; // Type of path, see DFS_PATH_XXX flags
LPWSTR DfsUniversalPath; // Dfs Universal Path of input path,
// of the form \\DfsName\dfs\... Only
// valid if PathType != DFS_PATH_NONDFS
} DFS_INFO_201, *PDFS_INFO_201, *LPDFS_INFO_201;
//
// Level 202:
//
typedef struct _DFS_INFO_202 {
DWORD PathType; // Type of path, see DFS_PATH_XXX flags
LPWSTR DfsUniversalPath; // Dfs Universal Path of input path,
// of the form \\DfsName\dfs\... Only
// valid if PathType != DFS_PATH_NONDFS
DWORD EntryPathLen; // Length of entry path portion of DfsUniversalPath. Only
// valid if PathType != DFS_PATH_NONDFS
} DFS_INFO_202, *PDFS_INFO_202, *LPDFS_INFO_202;
//
// Add a new volume or additional storage for an existing volume at
// DfsEntryPath.
//
NET_API_STATUS NET_API_FUNCTION
NetDfsAdd(
IN LPWSTR DfsEntryPath, // DFS entry path for this added volume or storage
IN LPWSTR ServerName, // Name of server hosting the storage
IN LPWSTR ShareName, // Existing share name for the storage
IN LPWSTR Comment OPTIONAL, // Optional comment for this volume or storage
IN DWORD Flags // See below. Zero for no flags.
);
//
// Flags:
//
#define DFS_ADD_VOLUME 1 // Add a new volume to the DFS if not already there
//
// Remove a volume or additional storage for volume from the Dfs at
// DfsEntryPath. When applied to the last storage in a volume, removes
// the volume from the DFS.
//
NET_API_STATUS NET_API_FUNCTION
NetDfsRemove(
IN LPWSTR DfsEntryPath, // DFS entry path for this added volume or storage
IN LPWSTR ServerName, // Name of server hosting the storage
IN LPWSTR ShareName // Name of share hosting the storage
);
//
// Get information about all of the volumes in the Dfs. DfsName is
// the "server" part of the UNC name used to refer to this particular Dfs.
//
// Valid levels are 1-3.
//
NET_API_STATUS NET_API_FUNCTION
NetDfsEnum(
IN LPWSTR DfsName, // Name of the Dfs for enumeration
IN DWORD Level, // Level of information requested
IN DWORD PrefMaxLen, // Advisory, but -1 means "get it all"
OUT LPBYTE* Buffer, // API allocates and returns buffer with requested info
OUT LPDWORD EntriesRead, // Number of entries returned
IN OUT LPDWORD ResumeHandle // Must be 0 on first call, reused on subsequent calls
);
//
// Get information about the volume or storage.
// If ServerName and ShareName are specified, the information returned
// is specific to that server and share, else the information is specific
// to the volume as a whole.
//
// Valid levels are 1-3, 100-101.
//
NET_API_STATUS NET_API_FUNCTION
NetDfsGetInfo(
IN LPWSTR DfsEntryPath, // DFS entry path for the volume
IN LPWSTR ServerName OPTIONAL,// Name of server hosting a storage
IN LPWSTR ShareName OPTIONAL, // Name of share on server serving the volume
IN DWORD Level, // Level of information requested
OUT LPBYTE* Buffer // API allocates and returns buffer with requested info
);
//
// Get information about the path.
//
// Valid levels are 200-202.
//
NET_API_STATUS NET_API_FUNCTION
NetDfsGetPathInfo(
IN LPWSTR Path, // Win32 path
IN DWORD Level, // Level of information requested
OUT LPBYTE* Buffer // API allocates and returns buffer with requested info
);
//
// Set info about the volume or storage.
// If ServerName and ShareName are specified, the information set is
// specific to that server and share, else the information is specific
// to the volume as a whole.
//
// Valid levels are 100 and 101.
//
NET_API_STATUS NET_API_FUNCTION
NetDfsSetInfo(
IN LPWSTR DfsEntryPath, // DFS entry path for the volume
IN LPWSTR ServerName OPTIONAL, // Name of server hosting a storage
IN LPWSTR ShareName OPTIONAL, // Name of share hosting a storage
IN DWORD Level, // Level of information to be set
IN LPBYTE Buffer // Buffer holding information
);
//
// Move a DFS volume and all subordinate volumes from one place in the
// DFS to another place in the DFS.
//
NET_API_STATUS NET_API_FUNCTION
NetDfsMove(
IN LPWSTR DfsEntryPath, // Current DFS entry path for this volume
IN LPWSTR DfsNewEntryPath // New DFS entry path for this volume
);
NET_API_STATUS NET_API_FUNCTION
NetDfsRename(
IN LPWSTR Path, // Current Win32 path in a Dfs
IN LPWSTR NewPath // New Win32 path in the same Dfs
);
#ifdef __cplusplus
}
#endif
#endif // _LMDFS_
|