Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

568 lines
21 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // File: dfsfsctl.h
  6. //
  7. // Contents: The FsControl codes, data structures, and names needed for
  8. // communication between user-level code and the Dfs kernel
  9. // driver.
  10. //
  11. // Classes: None
  12. //
  13. // Functions:
  14. //
  15. //-----------------------------------------------------------------------------
  16. #ifndef _DFSFSCTL_
  17. #define _DFSFSCTL_
  18. //
  19. // Distributed file service file control code and structure declarations
  20. //
  21. //
  22. // The name of the Dfs driver file system device for server and client
  23. //
  24. #define DFS_DRIVER_NAME L"\\Dfs"
  25. #define DFS_SERVER_NAME L"\\DfsServer"
  26. //
  27. // The name of the NT object directory under which Dfs creates its own
  28. // devices.
  29. //
  30. #define DD_DFS_DEVICE_DIRECTORY L"\\Device\\WinDfs"
  31. //
  32. // The canonical device Dfs creates for fielding file open requests.
  33. //
  34. #define DD_DFS_DEVICE_NAME L"Root"
  35. // The following three context definitions are values that are used by the
  36. // DFS driver to distinguish opens to the underlying provider.
  37. // The first two DFS_OPEN_CONTEXT,DFS_DOWNLEVEL_OPEN_CONTEXT are passed in the
  38. // the FsContext2 field while the DFS_NAME_CONTEXT pointer is passed in the
  39. // FsContext field of the FILE_OBJECT
  40. //
  41. // Sundown Notes: Because these values are stored in PVOID, the way these
  42. // values are defined and how the compiler extends them to PVOIDs
  43. // should be considered. They are now considered as const unsigned int.
  44. // Note also that these values are unaligned and cannot be returned by
  45. // any memory allocator or coming from the stack. If the "unaligned" point
  46. // becomes incorrect in the future or if FsContext2 or FsContext fields are
  47. // tested in any way in terms of pointer address range validity, we should
  48. // revisit the following statement:
  49. // These values should be zero-extended when stored to PVOIDs.
  50. //
  51. #define DFS_OPEN_CONTEXT 0xFF444653
  52. #define DFS_DOWNLEVEL_OPEN_CONTEXT 0x11444653
  53. #define DFS_CSCAGENT_NAME_CONTEXT 0xaaaaaaaa
  54. #define DFS_USER_NAME_CONTEXT 0xbbbbbbbb
  55. #define DFS_FLAG_LAST_ALTERNATE 0x00000001
  56. typedef struct _DFS_NAME_CONTEXT_ {
  57. UNICODE_STRING UNCFileName;
  58. LONG NameContextType;
  59. ULONG Flags;
  60. PVOID pDfsTargetInfo; // Pointer to dfs crafted target info
  61. PVOID pLMRTargetInfo; // pointer to lmr crafted target info
  62. } DFS_NAME_CONTEXT, *PDFS_NAME_CONTEXT;
  63. //
  64. // NtDeviceIoControlFile IoControlCode values for this device.
  65. //
  66. // Warning: Remember that the low two bits of the code specify how the
  67. // buffers are passed to the driver!
  68. //
  69. #define FSCTL_DFS_BASE FILE_DEVICE_DFS
  70. //
  71. // DFS FSCTL operations. When a passed-in buffer contains pointers, and the caller
  72. // is not KernelMode, the passed-in pointer value is set relative to the beginning of
  73. // the buffer. They must be adjusted before use. If the caller mode was KernelMode,
  74. // pointers should be used as is.
  75. //
  76. //
  77. //
  78. // These are the fsctl codes used by the srvsvc to implement the I_NetDfsXXX
  79. // calls.
  80. //
  81. #define FSCTL_DFS_PKT_FLUSH_CACHE CTL_CODE(FSCTL_DFS_BASE, 2044, METHOD_BUFFERED, FILE_WRITE_DATA)
  82. #define FSCTL_DFS_PKT_FLUSH_SPC_CACHE CTL_CODE(FSCTL_DFS_BASE, 2051, METHOD_BUFFERED, FILE_WRITE_DATA)
  83. #define FSCTL_DFS_GET_PKT_ENTRY_STATE CTL_CODE(FSCTL_DFS_BASE, 2031, METHOD_BUFFERED, FILE_ANY_ACCESS)
  84. #define FSCTL_DFS_SET_PKT_ENTRY_STATE CTL_CODE(FSCTL_DFS_BASE, 2032, METHOD_BUFFERED, FILE_WRITE_DATA)
  85. //
  86. // These are the fsctl codes used by the SMB server to support shares in the
  87. // Dfs
  88. //
  89. #define FSCTL_DFS_TRANSLATE_PATH CTL_CODE(FSCTL_DFS_BASE, 100, METHOD_BUFFERED, FILE_ANY_ACCESS)
  90. #define FSCTL_DFS_GET_REFERRALS CTL_CODE(FSCTL_DFS_BASE, 101, METHOD_BUFFERED, FILE_ANY_ACCESS)
  91. #define FSCTL_DFS_REPORT_INCONSISTENCY CTL_CODE(FSCTL_DFS_BASE, 102, METHOD_BUFFERED, FILE_ANY_ACCESS)
  92. #define FSCTL_DFS_IS_SHARE_IN_DFS CTL_CODE(FSCTL_DFS_BASE, 103, METHOD_BUFFERED, FILE_ANY_ACCESS)
  93. #define FSCTL_DFS_IS_ROOT CTL_CODE(FSCTL_DFS_BASE, 104, METHOD_BUFFERED, FILE_ANY_ACCESS)
  94. #define FSCTL_DFS_GET_VERSION CTL_CODE(FSCTL_DFS_BASE, 105, METHOD_BUFFERED, FILE_ANY_ACCESS)
  95. #define FSCTL_DFS_FIND_SHARE CTL_CODE(FSCTL_DFS_BASE, 108, METHOD_BUFFERED, FILE_ANY_ACCESS)
  96. //
  97. // These are the fsctl codes supported by the Dfs client to identify quickly
  98. // whether paths are in the Dfs or not.
  99. //
  100. #define FSCTL_DFS_IS_VALID_PREFIX CTL_CODE(FSCTL_DFS_BASE, 106, METHOD_BUFFERED, FILE_ANY_ACCESS)
  101. #define FSCTL_DFS_IS_VALID_LOGICAL_ROOT CTL_CODE(FSCTL_DFS_BASE, 107, METHOD_BUFFERED, FILE_ANY_ACCESS)
  102. //
  103. // These are the fsctl codes used by the Dfs Manager / Dfs Service to
  104. // manipulate the Dfs.
  105. //
  106. #define FSCTL_DFS_START_DFS CTL_CODE(FSCTL_DFS_BASE, 6, METHOD_BUFFERED, FILE_WRITE_DATA)
  107. #define FSCTL_DFS_DEFINE_LOGICAL_ROOT CTL_CODE(FSCTL_DFS_BASE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
  108. #define FSCTL_DFS_DELETE_LOGICAL_ROOT CTL_CODE(FSCTL_DFS_BASE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
  109. #define FSCTL_DFS_GET_LOGICAL_ROOT_PREFIX CTL_CODE(FSCTL_DFS_BASE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
  110. #define FSCTL_DFS_STOP_DFS CTL_CODE(FSCTL_DFS_BASE, 3, METHOD_BUFFERED, FILE_WRITE_DATA)
  111. //
  112. // unused: keeping for historic reasons.
  113. //
  114. #define FSCTL_DFS_CREATE_LOCAL_PARTITION CTL_CODE(FSCTL_DFS_BASE, 8, METHOD_BUFFERED, FILE_WRITE_DATA)
  115. #define FSCTL_DFS_DELETE_LOCAL_PARTITION CTL_CODE(FSCTL_DFS_BASE, 9, METHOD_BUFFERED, FILE_WRITE_DATA)
  116. #define FSCTL_DFS_SET_LOCAL_VOLUME_STATE CTL_CODE(FSCTL_DFS_BASE, 10, METHOD_BUFFERED, FILE_WRITE_DATA)
  117. #define FSCTL_DFS_SET_SERVER_INFO CTL_CODE(FSCTL_DFS_BASE, 24, METHOD_BUFFERED, FILE_WRITE_DATA)
  118. #define FSCTL_DFS_CREATE_EXIT_POINT CTL_CODE(FSCTL_DFS_BASE, 29, METHOD_BUFFERED, FILE_WRITE_DATA)
  119. #define FSCTL_DFS_DELETE_EXIT_POINT CTL_CODE(FSCTL_DFS_BASE, 30, METHOD_BUFFERED, FILE_WRITE_DATA)
  120. #define FSCTL_DFS_VERIFY_REMOTE_VOLUME_KNOWLEDGE CTL_CODE(FSCTL_DFS_BASE, 35, METHOD_BUFFERED, FILE_ANY_ACCESS)
  121. #define FSCTL_DFS_MODIFY_PREFIX CTL_CODE(FSCTL_DFS_BASE, 38, METHOD_BUFFERED, FILE_WRITE_DATA)
  122. #define FSCTL_DFS_FIX_LOCAL_VOLUME CTL_CODE(FSCTL_DFS_BASE, 39, METHOD_BUFFERED, FILE_WRITE_DATA)
  123. //
  124. // used
  125. //
  126. #define FSCTL_DFS_PKT_SET_DC_NAME CTL_CODE(FSCTL_DFS_BASE, 41, METHOD_BUFFERED, FILE_WRITE_DATA)
  127. #define FSCTL_DFS_GET_CONNECTED_RESOURCES CTL_CODE(FSCTL_DFS_BASE, 47, METHOD_BUFFERED, FILE_ANY_ACCESS)
  128. #define FSCTL_DFS_GET_SERVER_NAME CTL_CODE(FSCTL_DFS_BASE, 48, METHOD_BUFFERED, FILE_ANY_ACCESS)
  129. #define FSCTL_DFS_DEFINE_ROOT_CREDENTIALS CTL_CODE(FSCTL_DFS_BASE, 49, METHOD_BUFFERED, FILE_ANY_ACCESS)
  130. #define FSCTL_DFS_PKT_SET_DOMAINNAMEFLAT CTL_CODE(FSCTL_DFS_BASE, 71, METHOD_BUFFERED, FILE_WRITE_DATA)
  131. #define FSCTL_DFS_PKT_SET_DOMAINNAMEDNS CTL_CODE(FSCTL_DFS_BASE, 72, METHOD_BUFFERED, FILE_WRITE_DATA)
  132. #define FSCTL_DFS_SPECIAL_SET_DC CTL_CODE(FSCTL_DFS_BASE, 74, METHOD_BUFFERED, FILE_WRITE_DATA)
  133. #define FSCTL_DFS_REREAD_REGISTRY CTL_CODE(FSCTL_DFS_BASE, 75, METHOD_BUFFERED, FILE_ANY_ACCESS)
  134. #define FSCTL_DFS_GET_CONNECTION_PERF_INFO CTL_CODE(FSCTL_DFS_BASE, 76, METHOD_BUFFERED, FILE_ANY_ACCESS)
  135. // this fsctl tells the DFS that a server has gone offline or come online
  136. // At present, it is issued by the CSC agent thread in winlogon
  137. #define FSCTL_DFS_CSC_SERVER_OFFLINE CTL_CODE(FSCTL_DFS_BASE, 77, METHOD_BUFFERED, FILE_WRITE_DATA)
  138. #define FSCTL_DFS_CSC_SERVER_ONLINE CTL_CODE(FSCTL_DFS_BASE, 78, METHOD_BUFFERED, FILE_ANY_ACCESS)
  139. #define FSCTL_DFS_SPC_REFRESH CTL_CODE(FSCTL_DFS_BASE, 79, METHOD_BUFFERED, FILE_ANY_ACCESS)
  140. //
  141. // These are the fsctl codes used by the Dfs WNet provider to support the
  142. // WNet APIs for Dfs
  143. //
  144. //
  145. // These are fsctl codes used by the Dfs Perfmon DLL
  146. //
  147. //
  148. // These are fsctls useful for testing Dfs
  149. //
  150. #define FSCTL_DFS_GET_ENTRY_TYPE CTL_CODE(FSCTL_DFS_BASE, 54, METHOD_BUFFERED, FILE_ANY_ACCESS)
  151. #define FSCTL_DFS_GET_PKT CTL_CODE(FSCTL_DFS_BASE, 70, METHOD_BUFFERED, FILE_ANY_ACCESS)
  152. #define FSCTL_DFS_GET_SPC_TABLE CTL_CODE(FSCTL_DFS_BASE, 73, METHOD_BUFFERED, FILE_ANY_ACCESS)
  153. //
  154. // These are the fsctl codes that might be useful in the future.
  155. //
  156. //
  157. // Registry key/value for site coverage
  158. //
  159. #define REG_KEY_COVERED_SITES L"SYSTEM\\CurrentControlSet\\Services\\DfsDriver\\CoveredSites"
  160. #define REG_VALUE_COVERED_SITES L"CoveredSites"
  161. typedef struct _DFS_IPADDRESS {
  162. USHORT IpFamily; // probably AF_INET == 2
  163. USHORT IpLen; // # bytes that count in IpData
  164. CHAR IpData[14]; // IpLen bytes used
  165. } DFS_IPADDRESS, *PDFS_IPADDRESS;
  166. #ifdef MIDL_PASS
  167. #define DFSMIDLSTRING [string] LPWSTR
  168. #define DFSSIZEIS [size_is(Count)]
  169. #else
  170. #define DFSMIDLSTRING LPWSTR
  171. #define DFSSIZEIS
  172. #endif
  173. // FSCTL_DFS_IS_VALID_PREFIX Input Buffer
  174. // The length values are in bytes.
  175. typedef struct {
  176. BOOLEAN CSCAgentCreate;
  177. SHORT RemoteNameLen;
  178. WCHAR RemoteName[1];
  179. } DFS_IS_VALID_PREFIX_ARG, *PDFS_IS_VALID_PREFIX_ARG;
  180. // FSCTL_DFS_GET_PKT_ENTRY_STATE Input Buffer
  181. // All the strings appear in Buffer in the same order as the length fields. The strings
  182. // are not NULL terminated. The length values are in bytes.
  183. typedef struct {
  184. SHORT DfsEntryPathLen;
  185. SHORT ServerNameLen;
  186. SHORT ShareNameLen;
  187. ULONG Level;
  188. WCHAR Buffer[1];
  189. } DFS_GET_PKT_ENTRY_STATE_ARG, *PDFS_GET_PKT_ENTRY_STATE_ARG;
  190. // FSCTRL_DFS_SET_PKT_ENTRY_STATE Input Buffer
  191. // All the strings appear in Buffer in the same order as the length fields. The strings
  192. // are not NULL terminated. The length values are in bytes.
  193. typedef struct {
  194. SHORT DfsEntryPathLen;
  195. SHORT ServerNameLen;
  196. SHORT ShareNameLen;
  197. ULONG Level;
  198. union {
  199. ULONG State; // DFS_INFO_101
  200. ULONG Timeout; // DFS_INFL_102
  201. };
  202. WCHAR Buffer[1];
  203. } DFS_SET_PKT_ENTRY_STATE_ARG, *PDFS_SET_PKT_ENTRY_STATE_ARG;
  204. // FSCTL_DFS_PKT_CREATE_SPECIAL_NAMES Input Buffer:
  205. typedef struct {
  206. ULONG Count;
  207. LPWSTR SpecialName;
  208. LPWSTR *ExpandedNames;
  209. } DFS_SPECIAL_NAME_CONTAINER, *PDFS_SPECIAL_NAME_CONTAINER;
  210. typedef struct {
  211. ULONG Count;
  212. PDFS_SPECIAL_NAME_CONTAINER *SpecialNameContainers;
  213. } DFS_PKT_CREATE_SPECIAL_NAMES_ARG, *PDFS_PKT_CREATE_SPECIAL_NAMES_ARG;
  214. typedef struct {
  215. GUID Uid;
  216. DFSMIDLSTRING Prefix;
  217. } NET_DFS_ENTRY_ID, *LPNET_DFS_ENTRY_ID;
  218. typedef struct {
  219. ULONG Count;
  220. DFSSIZEIS LPNET_DFS_ENTRY_ID Buffer;
  221. } NET_DFS_ENTRY_ID_CONTAINER, *LPNET_DFS_ENTRY_ID_CONTAINER;
  222. // FSCTL_DFS_CREATE_LOCAL_PARTITION Input Buffer:
  223. typedef struct {
  224. LPWSTR ShareName;
  225. LPWSTR SharePath;
  226. GUID EntryUid;
  227. LPWSTR EntryPrefix;
  228. LPWSTR ShortName;
  229. LPNET_DFS_ENTRY_ID_CONTAINER RelationInfo;
  230. BOOLEAN Force;
  231. } *PDFS_CREATE_LOCAL_PARTITION_ARG;
  232. // FSCTL_DFS_DELETE_LOCAL_PARTITION Input Buffer:
  233. typedef struct {
  234. GUID Uid;
  235. LPWSTR Prefix;
  236. } *PDFS_DELETE_LOCAL_PARTITION_ARG;
  237. // FSCTL_DFS_SET_LOCAL_VOLUME_STATE Input Buffer
  238. typedef struct {
  239. GUID Uid;
  240. LPWSTR Prefix;
  241. ULONG State;
  242. } *PDFS_SET_LOCAL_VOLUME_STATE_ARG;
  243. // FSCTL_DFS_SET_SERVER_INFO Input Buffer
  244. typedef struct {
  245. GUID Uid;
  246. LPWSTR Prefix;
  247. } *PDFS_SET_SERVER_INFO_ARG;
  248. // FSCTL_DFS_CREATE_EXIT_POINT Input Buffer
  249. typedef struct {
  250. GUID Uid;
  251. LPWSTR Prefix;
  252. ULONG Type;
  253. } *PDFS_CREATE_EXIT_POINT_ARG;
  254. // FSCTL_DFS_DELETE_EXIT_POINT Input Buffer
  255. typedef struct {
  256. GUID Uid;
  257. LPWSTR Prefix;
  258. ULONG Type;
  259. } *PDFS_DELETE_EXIT_POINT_ARG;
  260. // FSCTL_DFS_MODIFY_PREFIX Input Buffer
  261. typedef struct {
  262. GUID Uid;
  263. LPWSTR Prefix;
  264. } *PDFS_MODIFY_PREFIX_ARG;
  265. // FSCTL_DFS_FIX_LOCAL_VOLUME Input Buffer
  266. typedef struct {
  267. LPWSTR VolumeName;
  268. ULONG EntryType;
  269. ULONG ServiceType;
  270. LPWSTR StgId;
  271. GUID EntryUid;
  272. LPWSTR EntryPrefix;
  273. LPWSTR ShortPrefix;
  274. LPNET_DFS_ENTRY_ID_CONTAINER RelationInfo;
  275. ULONG CreateDisposition;
  276. } *PDFS_FIX_LOCAL_VOLUME_ARG;
  277. // FSCTL_DFS_TRANSLATE_PATH Input Buffer
  278. typedef struct {
  279. ULONG Flags;
  280. UNICODE_STRING SubDirectory;
  281. UNICODE_STRING ParentPathName;
  282. UNICODE_STRING DfsPathName;
  283. } DFS_TRANSLATE_PATH_ARG, *PDFS_TRANSLATE_PATH_ARG;
  284. #define DFS_TRANSLATE_STRIP_LAST_COMPONENT 1
  285. // FSCTL_DFS_FIND_SHARE Input Buffer
  286. typedef struct {
  287. UNICODE_STRING ShareName;
  288. } DFS_FIND_SHARE_ARG, *PDFS_FIND_SHARE_ARG;
  289. // FSCTL_DFS_CREATE_SITE_INFO Input Buffer:
  290. typedef struct {
  291. UNICODE_STRING ServerName;
  292. ULONG SiteCount;
  293. UNICODE_STRING SiteName[1]; // actually SiteCount
  294. } DFS_CREATE_SITE_INFO_ARG, *PDFS_CREATE_SITE_INFO_ARG;
  295. // FSCTL_DFS_DELETE_SITE_INFO Input Buffer:
  296. typedef struct {
  297. UNICODE_STRING ServerName;
  298. } DFS_DELETE_SITE_INFO_ARG, *PDFS_DELETE_SITE_INFO_ARG;
  299. // FSCTL_DFS_CREATE_IP_INFO Input Buffer:
  300. typedef struct {
  301. DFS_IPADDRESS IpAddress;
  302. UNICODE_STRING SiteName;
  303. } DFS_CREATE_IP_INFO_ARG, *PDFS_CREATE_IP_INFO_ARG;
  304. // FSCTL_DFS_DELETE_IP_INFO Input Buffer:
  305. typedef struct {
  306. DFS_IPADDRESS IpAddress;
  307. } DFS_DELETE_IP_INFO_ARG, *PDFS_DELETE_IP_INFO_ARG;
  308. // FSCTL_DFS_CREATE_SPECIAL_INFO Input Buffer:
  309. typedef struct {
  310. UNICODE_STRING SpecialName;
  311. ULONG Flags;
  312. ULONG TrustDirection;
  313. ULONG TrustType;
  314. ULONG Timeout;
  315. LONG NameCount;
  316. UNICODE_STRING Name[1]; // actually NameCount
  317. } DFS_CREATE_SPECIAL_INFO_ARG, *PDFS_CREATE_SPECIAL_INFO_ARG;
  318. // Flags for FSCTL_DFS_CREATE_SPECIAL_INFO
  319. #define DFS_SPECIAL_INFO_PRIMARY 0x00000001
  320. #define DFS_SPECIAL_INFO_NETBIOS 0x00000002
  321. // FSCTL_DFS_DELETE_SPECIAL_INFO Input Buffer:
  322. typedef struct {
  323. UNICODE_STRING SpecialName;
  324. } DFS_DELETE_SPECIAL_INFO_ARG, *PDFS_DELETE_SPECIAL_INFO_ARG;
  325. // FSCTL_SRV_DFSSRV_CONNECT Input Buffer:
  326. typedef struct {
  327. UNICODE_STRING PortName;
  328. } DFS_SRV_DFSSRV_CONNECT_ARG, *PDFS_SRV_DFSSRV_CONNECT_ARG;
  329. // FSCTL_SRV_DFSSRV_IPADDR Input Buffer:
  330. typedef struct {
  331. DFS_IPADDRESS IpAddress;
  332. } DFS_SRV_DFSSRV_IPADDR_ARG, *PDFS_SRV_DFSSRV_IPADDR_ARG;
  333. // FSCTL_DFS_GET_REFERRALS Input Buffer
  334. typedef struct {
  335. UNICODE_STRING DfsPathName;
  336. ULONG MaxReferralLevel;
  337. DFS_IPADDRESS IpAddress;
  338. } DFS_GET_REFERRALS_INPUT_ARG, *PDFS_GET_REFERRALS_INPUT_ARG;
  339. // FSCTL_DFS_SPECIAL_SET_DC Input Buffer
  340. typedef struct {
  341. UNICODE_STRING SpecialName;
  342. UNICODE_STRING DcName;
  343. } DFS_SPECIAL_SET_DC_INPUT_ARG, *PDFS_SPECIAL_SET_DC_INPUT_ARG;
  344. // FSCTL_DFS_GET_REFERRALS Output Buffer
  345. // IoStatus.Information contains the amount of data returned
  346. //
  347. // The format of the Output Buffer is simply that of RESP_GET_DFS_REFERRAL,
  348. // described in smbtrans.h
  349. //
  350. // FSCTL_DFS_REPORT_INCONSISTENCY Input Buffer
  351. typedef struct {
  352. UNICODE_STRING DfsPathName; // DFS path having inconsistency
  353. PCHAR Ref; // Actually, pointer to a DFS_REFERRAL_V1
  354. } DFS_REPORT_INCONSISTENCY_ARG, *PDFS_REPORT_INCONSISTENCY_ARG;
  355. // FSCTL_DFS_IS_SHARE_IN_DFS Input Buffer
  356. typedef struct {
  357. union {
  358. USHORT ServerType; // 0 == Don't know, 1 == SMB, 2 == Netware
  359. USHORT ShareType; // On return, 0x1 == share is root of a Dfs
  360. }; // 0x2 == share is participating in Dfs
  361. UNICODE_STRING ShareName; // Name of share
  362. UNICODE_STRING SharePath; // Path of the share
  363. } DFS_IS_SHARE_IN_DFS_ARG, *PDFS_IS_SHARE_IN_DFS_ARG;
  364. #define DFS_SHARE_TYPE_ROOT 0x1
  365. #define DFS_SHARE_TYPE_DFS_VOLUME 0x2
  366. typedef struct {
  367. ULONG EventType;
  368. LPWSTR DomainName; // Name of domain
  369. LPWSTR DCName; // Path of the share
  370. } DFS_SPC_REFRESH_INFO, *PDFS_SPC_REFRESH_INFO;
  371. //
  372. //FSCTL_DFS_GET_VERSION Input Buffer:
  373. // This fsctl returns the version number of the Dfs driver installed on the
  374. // machine.
  375. typedef struct {
  376. ULONG Version;
  377. } DFS_GET_VERSION_ARG, *PDFS_GET_VERSION_ARG;
  378. //
  379. // FSCTRL_DFS_GET_PKT address object
  380. //
  381. typedef struct {
  382. USHORT State; // See below
  383. WCHAR ServerShare[1]; // Really a WSTR, UNICODE_NULL terminated
  384. } DFS_PKT_ADDRESS_OBJECT, *PDFS_PKT_ADDRESS_OBJECT;
  385. #define DFS_PKT_ADDRESS_OBJECT_ACTIVE 0x001
  386. #define DFS_PKT_ADDRESS_OBJECT_OFFLINE 0x002
  387. //
  388. // FSCTRL_DFS_GET_PKT object
  389. //
  390. typedef struct {
  391. LPWSTR Prefix;
  392. LPWSTR ShortPrefix;
  393. ULONG Type;
  394. ULONG USN;
  395. ULONG ExpireTime;
  396. ULONG UseCount;
  397. GUID Uid;
  398. ULONG ServiceCount;
  399. PDFS_PKT_ADDRESS_OBJECT *Address; // Array of DFS_PKT_ADDRESS_OBJECTS's, len ServiceCount
  400. } DFS_PKT_ENTRY_OBJECT, *PDFS_PKT_ENTRY_OBJECT;
  401. //
  402. // FSCTRL_DFS_GET_PKT Output Buffer:
  403. // This fsctl returns what is in the PKT
  404. //
  405. typedef struct {
  406. ULONG EntryCount;
  407. DFS_PKT_ENTRY_OBJECT EntryObject[1]; // Really EntryCount
  408. } DFS_GET_PKT_ARG, *PDFS_GET_PKT_ARG;
  409. // Standardized provider IDs as given in eProviderId
  410. #define PROV_ID_LOCAL_FS 0x101 // generic local file system
  411. #define PROV_ID_DFS_RDR 0x201 // Uplevel LanMan redirector
  412. #define PROV_ID_MUP_RDR 0x202 // Mup
  413. #define PROV_ID_LM_RDR 0x202 // Compatability
  414. #define PROV_ID_LANM_RDR 0x203 // Downlevel LanMan redirector
  415. // Provider capabilities as given in fRefCapability and fProvCapability
  416. #define PROV_DFS_RDR 2 // accepts NtCreateFile with EA Principal
  417. #define PROV_STRIP_PREFIX 4 // strip file name prefix before redispatching
  418. #define PROV_UNAVAILABLE 8 // provider unavailable - try to reattach.
  419. //[ dfs_define_logical_root
  420. //
  421. // Control structure for FSCTL_DFS_DEFINE_LOGICAL_ROOT
  422. #define MAX_LOGICAL_ROOT_NAME 16
  423. typedef struct _FILE_DFS_DEF_LOGICAL_ROOT_BUFFER {
  424. BOOLEAN fForce;
  425. WCHAR LogicalRoot[MAX_LOGICAL_ROOT_NAME];
  426. WCHAR RootPrefix[1];
  427. } FILE_DFS_DEF_ROOT_BUFFER, *PFILE_DFS_DEF_ROOT_BUFFER;
  428. //
  429. // FORCE definition needed for NetrDfsRemoveFtRoot
  430. //
  431. #define DFS_FORCE_REMOVE 0x80000000
  432. //]
  433. //[ dfs_define_root_credentials
  434. //
  435. // Control structure for FSCTL_DFS_DEFINE_ROOT_CREDENTIALS. All the strings
  436. // appear in Buffer in the same order as the length fields. The strings
  437. // are not NULL terminated. The length values are in bytes.
  438. //
  439. typedef struct _FILE_DFS_DEF_ROOT_CREDENTIALS {
  440. BOOLEAN CSCAgentCreate;
  441. USHORT Flags;
  442. USHORT DomainNameLen;
  443. USHORT UserNameLen;
  444. USHORT PasswordLen;
  445. USHORT ServerNameLen;
  446. USHORT ShareNameLen;
  447. USHORT RootPrefixLen;
  448. WCHAR LogicalRoot[MAX_LOGICAL_ROOT_NAME];
  449. WCHAR Buffer[1];
  450. } FILE_DFS_DEF_ROOT_CREDENTIALS, *PFILE_DFS_DEF_ROOT_CREDENTIALS;
  451. #define DFS_DEFERRED_CONNECTION 1
  452. #define DFS_USE_NULL_PASSWORD 2
  453. typedef struct _DFS_ATTACH_SHARE_BUFFER {
  454. BOOLEAN fAttach;
  455. USHORT ShareNameLength;
  456. WCHAR ShareName[1];
  457. } DFS_ATTACH_SHARE_BUFFER, *PDFS_ATTACH_SHARE_BUFFER;
  458. //]
  459. //----------------------------------------------------------------------------
  460. //
  461. // Everything below here is to support the old Dfs design.
  462. //
  463. #define EA_NAME_OPENIFJP ".OpenIfJP"
  464. #endif