Source code of Windows XP (NT5)
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.

592 lines
24 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_CREATE_LOCAL_PARTITION CTL_CODE(FSCTL_DFS_BASE, 8, METHOD_BUFFERED, FILE_WRITE_DATA)
  82. #define FSCTL_DFS_DELETE_LOCAL_PARTITION CTL_CODE(FSCTL_DFS_BASE, 9, METHOD_BUFFERED, FILE_WRITE_DATA)
  83. #define FSCTL_DFS_SET_LOCAL_VOLUME_STATE CTL_CODE(FSCTL_DFS_BASE, 10, METHOD_BUFFERED, FILE_WRITE_DATA)
  84. #define FSCTL_DFS_SET_SERVER_INFO CTL_CODE(FSCTL_DFS_BASE, 24, METHOD_BUFFERED, FILE_WRITE_DATA)
  85. #define FSCTL_DFS_CREATE_EXIT_POINT CTL_CODE(FSCTL_DFS_BASE, 29, METHOD_BUFFERED, FILE_WRITE_DATA)
  86. #define FSCTL_DFS_DELETE_EXIT_POINT CTL_CODE(FSCTL_DFS_BASE, 30, METHOD_BUFFERED, FILE_WRITE_DATA)
  87. #define FSCTL_DFS_MODIFY_PREFIX CTL_CODE(FSCTL_DFS_BASE, 38, METHOD_BUFFERED, FILE_WRITE_DATA)
  88. #define FSCTL_DFS_FIX_LOCAL_VOLUME CTL_CODE(FSCTL_DFS_BASE, 39, METHOD_BUFFERED, FILE_WRITE_DATA)
  89. #define FSCTL_DFS_PKT_FLUSH_CACHE CTL_CODE(FSCTL_DFS_BASE, 2044, METHOD_BUFFERED, FILE_WRITE_DATA)
  90. #define FSCTL_DFS_PKT_FLUSH_SPC_CACHE CTL_CODE(FSCTL_DFS_BASE, 2051, METHOD_BUFFERED, FILE_WRITE_DATA)
  91. #define FSCTL_DFS_GET_PKT_ENTRY_STATE CTL_CODE(FSCTL_DFS_BASE, 2031, METHOD_BUFFERED, FILE_ANY_ACCESS)
  92. #define FSCTL_DFS_SET_PKT_ENTRY_STATE CTL_CODE(FSCTL_DFS_BASE, 2032, METHOD_BUFFERED, FILE_WRITE_DATA)
  93. //
  94. // These are the fsctl codes used by the SMB server to support shares in the
  95. // Dfs
  96. //
  97. #define FSCTL_DFS_TRANSLATE_PATH CTL_CODE(FSCTL_DFS_BASE, 100, METHOD_BUFFERED, FILE_ANY_ACCESS)
  98. #define FSCTL_DFS_GET_REFERRALS CTL_CODE(FSCTL_DFS_BASE, 101, METHOD_BUFFERED, FILE_ANY_ACCESS)
  99. #define FSCTL_DFS_REPORT_INCONSISTENCY CTL_CODE(FSCTL_DFS_BASE, 102, METHOD_BUFFERED, FILE_ANY_ACCESS)
  100. #define FSCTL_DFS_IS_SHARE_IN_DFS CTL_CODE(FSCTL_DFS_BASE, 103, METHOD_BUFFERED, FILE_ANY_ACCESS)
  101. #define FSCTL_DFS_IS_ROOT CTL_CODE(FSCTL_DFS_BASE, 104, METHOD_BUFFERED, FILE_ANY_ACCESS)
  102. #define FSCTL_DFS_GET_VERSION CTL_CODE(FSCTL_DFS_BASE, 105, METHOD_BUFFERED, FILE_ANY_ACCESS)
  103. #define FSCTL_DFS_FIND_SHARE CTL_CODE(FSCTL_DFS_BASE, 108, METHOD_BUFFERED, FILE_ANY_ACCESS)
  104. //
  105. // These are the fsctl codes supported by the Dfs client to identify quickly
  106. // whether paths are in the Dfs or not.
  107. //
  108. #define FSCTL_DFS_IS_VALID_PREFIX CTL_CODE(FSCTL_DFS_BASE, 106, METHOD_BUFFERED, FILE_ANY_ACCESS)
  109. #define FSCTL_DFS_IS_VALID_LOGICAL_ROOT CTL_CODE(FSCTL_DFS_BASE, 107, METHOD_BUFFERED, FILE_ANY_ACCESS)
  110. //
  111. // These are the fsctl codes used by the Dfs Manager / Dfs Service to
  112. // manipulate the Dfs.
  113. //
  114. #define FSCTL_DFS_STOP_DFS CTL_CODE(FSCTL_DFS_BASE, 3, METHOD_BUFFERED, FILE_WRITE_DATA)
  115. #define FSCTL_DFS_START_DFS CTL_CODE(FSCTL_DFS_BASE, 6, METHOD_BUFFERED, FILE_WRITE_DATA)
  116. #define FSCTL_DFS_INIT_LOCAL_PARTITIONS CTL_CODE(FSCTL_DFS_BASE, 7, METHOD_BUFFERED, FILE_WRITE_DATA)
  117. #define FSCTL_DFS_SET_SERVICE_STATE CTL_CODE(FSCTL_DFS_BASE, 11, METHOD_BUFFERED, FILE_WRITE_DATA)
  118. #define FSCTL_DFS_DC_SET_VOLUME_STATE CTL_CODE(FSCTL_DFS_BASE, 12, METHOD_BUFFERED, FILE_WRITE_DATA)
  119. #define FSCTL_DFS_SET_VOLUME_TIMEOUT CTL_CODE(FSCTL_DFS_BASE, 13, METHOD_BUFFERED, FILE_WRITE_DATA)
  120. #define FSCTL_DFS_IS_CHILDNAME_LEGAL CTL_CODE(FSCTL_DFS_BASE, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
  121. #define FSCTL_DFS_PKT_CREATE_ENTRY CTL_CODE(FSCTL_DFS_BASE, 16, METHOD_BUFFERED, FILE_WRITE_DATA)
  122. #define FSCTL_DFS_PKT_CREATE_SUBORDINATE_ENTRY CTL_CODE(FSCTL_DFS_BASE, 17, METHOD_BUFFERED, FILE_WRITE_DATA)
  123. #define FSCTL_DFS_CHECK_STGID_IN_USE CTL_CODE(FSCTL_DFS_BASE, 18, METHOD_BUFFERED, FILE_ANY_ACCESS)
  124. #define FSCTL_DFS_PKT_SET_RELATION_INFO CTL_CODE(FSCTL_DFS_BASE, 22, METHOD_BUFFERED, FILE_WRITE_DATA)
  125. #define FSCTL_DFS_GET_SERVER_INFO CTL_CODE(FSCTL_DFS_BASE, 23, METHOD_BUFFERED, FILE_ANY_ACCESS)
  126. #define FSCTL_DFS_PKT_DESTROY_ENTRY CTL_CODE(FSCTL_DFS_BASE, 26, METHOD_BUFFERED, FILE_WRITE_DATA)
  127. #define FSCTL_DFS_PKT_GET_RELATION_INFO CTL_CODE(FSCTL_DFS_BASE, 27, METHOD_BUFFERED, FILE_ANY_ACCESS)
  128. #define FSCTL_DFS_CHECK_REMOTE_PARTITION CTL_CODE(FSCTL_DFS_BASE, 34, METHOD_BUFFERED, FILE_ANY_ACCESS)
  129. #define FSCTL_DFS_VERIFY_REMOTE_VOLUME_KNOWLEDGE CTL_CODE(FSCTL_DFS_BASE, 35, METHOD_BUFFERED, FILE_ANY_ACCESS)
  130. #define FSCTL_DFS_VERIFY_LOCAL_VOLUME_KNOWLEDGE CTL_CODE(FSCTL_DFS_BASE, 36, METHOD_BUFFERED, FILE_ANY_ACCESS)
  131. #define FSCTL_DFS_PRUNE_LOCAL_PARTITION CTL_CODE(FSCTL_DFS_BASE, 37, METHOD_BUFFERED, FILE_WRITE_DATA)
  132. #define FSCTL_DFS_PKT_SET_DC_NAME CTL_CODE(FSCTL_DFS_BASE, 41, METHOD_BUFFERED, FILE_WRITE_DATA)
  133. #define FSCTL_DFS_CREATE_SITE_INFO CTL_CODE(FSCTL_DFS_BASE, 56, METHOD_BUFFERED, FILE_WRITE_DATA)
  134. #define FSCTL_DFS_DELETE_SITE_INFO CTL_CODE(FSCTL_DFS_BASE, 57, METHOD_BUFFERED, FILE_WRITE_DATA)
  135. #define FSCTL_SRV_DFSSRV_CONNECT CTL_CODE(FSCTL_DFS_BASE, 58, METHOD_BUFFERED, FILE_ANY_ACCESS)
  136. #define FSCTL_SRV_DFSSRV_IPADDR CTL_CODE(FSCTL_DFS_BASE, 59, METHOD_BUFFERED, FILE_ANY_ACCESS)
  137. #define FSCTL_DFS_CREATE_IP_INFO CTL_CODE(FSCTL_DFS_BASE, 60, METHOD_BUFFERED, FILE_WRITE_DATA)
  138. #define FSCTL_DFS_DELETE_IP_INFO CTL_CODE(FSCTL_DFS_BASE, 61, METHOD_BUFFERED, FILE_WRITE_DATA)
  139. #define FSCTL_DFS_CREATE_SPECIAL_INFO CTL_CODE(FSCTL_DFS_BASE, 62, METHOD_BUFFERED, FILE_WRITE_DATA)
  140. #define FSCTL_DFS_DELETE_SPECIAL_INFO CTL_CODE(FSCTL_DFS_BASE, 63, METHOD_BUFFERED, FILE_WRITE_DATA)
  141. #define FSCTL_DFS_CREATE_FTDFS_INFO CTL_CODE(FSCTL_DFS_BASE, 64, METHOD_BUFFERED, FILE_WRITE_DATA)
  142. #define FSCTL_DFS_DELETE_FTDFS_INFO CTL_CODE(FSCTL_DFS_BASE, 66, METHOD_BUFFERED, FILE_WRITE_DATA)
  143. #define FSCTL_DFS_ISDC CTL_CODE(FSCTL_DFS_BASE, 67, METHOD_BUFFERED, FILE_WRITE_DATA)
  144. #define FSCTL_DFS_ISNOTDC CTL_CODE(FSCTL_DFS_BASE, 68, METHOD_BUFFERED, FILE_WRITE_DATA)
  145. #define FSCTL_DFS_RESET_PKT CTL_CODE(FSCTL_DFS_BASE, 69, METHOD_BUFFERED, FILE_WRITE_DATA)
  146. #define FSCTL_DFS_PKT_SET_DOMAINNAMEFLAT CTL_CODE(FSCTL_DFS_BASE, 71, METHOD_BUFFERED, FILE_WRITE_DATA)
  147. #define FSCTL_DFS_PKT_SET_DOMAINNAMEDNS CTL_CODE(FSCTL_DFS_BASE, 72, METHOD_BUFFERED, FILE_WRITE_DATA)
  148. #define FSCTL_DFS_SPECIAL_SET_DC CTL_CODE(FSCTL_DFS_BASE, 74, METHOD_BUFFERED, FILE_WRITE_DATA)
  149. #define FSCTL_DFS_REREAD_REGISTRY CTL_CODE(FSCTL_DFS_BASE, 75, METHOD_BUFFERED, FILE_ANY_ACCESS)
  150. #define FSCTL_DFS_GET_CONNECTION_PERF_INFO CTL_CODE(FSCTL_DFS_BASE, 76, METHOD_BUFFERED, FILE_ANY_ACCESS)
  151. // this fsctl tells the DFS that a server has gone offline or come online
  152. // At present, it is issued by the CSC agent thread in winlogon
  153. #define FSCTL_DFS_CSC_SERVER_OFFLINE CTL_CODE(FSCTL_DFS_BASE, 77, METHOD_BUFFERED, FILE_WRITE_DATA)
  154. #define FSCTL_DFS_CSC_SERVER_ONLINE CTL_CODE(FSCTL_DFS_BASE, 78, METHOD_BUFFERED, FILE_ANY_ACCESS)
  155. #define FSCTL_DFS_SPC_REFRESH CTL_CODE(FSCTL_DFS_BASE, 79, METHOD_BUFFERED, FILE_ANY_ACCESS)
  156. #define FSCTL_DFS_MARK_STALE_PKT_ENTRIES CTL_CODE(FSCTL_DFS_BASE, 80, METHOD_BUFFERED, FILE_WRITE_DATA)
  157. #define FSCTL_DFS_FLUSH_STALE_PKT_ENTRIES CTL_CODE(FSCTL_DFS_BASE, 81, METHOD_BUFFERED, FILE_WRITE_DATA)
  158. #define FSCTL_DFS_GET_NEXT_LONG_DOMAIN_NAME CTL_CODE(FSCTL_DFS_BASE, 82, METHOD_BUFFERED, FILE_WRITE_DATA)
  159. //
  160. // These are the fsctl codes used by the Dfs WNet provider to support the
  161. // WNet APIs for Dfs
  162. //
  163. #define FSCTL_DFS_DEFINE_LOGICAL_ROOT CTL_CODE(FSCTL_DFS_BASE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
  164. #define FSCTL_DFS_DELETE_LOGICAL_ROOT CTL_CODE(FSCTL_DFS_BASE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
  165. #define FSCTL_DFS_GET_LOGICAL_ROOT_PREFIX CTL_CODE(FSCTL_DFS_BASE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
  166. #define FSCTL_DFS_GET_CONNECTED_RESOURCES CTL_CODE(FSCTL_DFS_BASE, 47, METHOD_BUFFERED, FILE_ANY_ACCESS)
  167. #define FSCTL_DFS_GET_SERVER_NAME CTL_CODE(FSCTL_DFS_BASE, 48, METHOD_BUFFERED, FILE_ANY_ACCESS)
  168. #define FSCTL_DFS_DEFINE_ROOT_CREDENTIALS CTL_CODE(FSCTL_DFS_BASE, 49, METHOD_BUFFERED, FILE_ANY_ACCESS)
  169. //
  170. // These are fsctl codes used by the Dfs Perfmon DLL
  171. //
  172. #define FSCTL_DFS_READ_METERS CTL_CODE(FSCTL_DFS_BASE, 50, METHOD_BUFFERED, FILE_ANY_ACCESS)
  173. //
  174. // These are fsctls useful for testing Dfs
  175. //
  176. #define FSCTL_DFS_SHUFFLE_ENTRY CTL_CODE(FSCTL_DFS_BASE, 51, METHOD_BUFFERED, FILE_WRITE_DATA)
  177. #define FSCTL_DFS_GET_FIRST_SVC CTL_CODE(FSCTL_DFS_BASE, 52, METHOD_BUFFERED, FILE_ANY_ACCESS)
  178. #define FSCTL_DFS_GET_NEXT_SVC CTL_CODE(FSCTL_DFS_BASE, 53, METHOD_BUFFERED, FILE_ANY_ACCESS)
  179. #define FSCTL_DFS_GET_ENTRY_TYPE CTL_CODE(FSCTL_DFS_BASE, 54, METHOD_BUFFERED, FILE_ANY_ACCESS)
  180. #define FSCTL_DFS_GET_PKT CTL_CODE(FSCTL_DFS_BASE, 70, METHOD_BUFFERED, FILE_ANY_ACCESS)
  181. #define FSCTL_DFS_GET_SPC_TABLE CTL_CODE(FSCTL_DFS_BASE, 73, METHOD_BUFFERED, FILE_ANY_ACCESS)
  182. //
  183. // These are the fsctl codes that might be useful in the future.
  184. //
  185. #define FSCTL_DFS_NAME_RESOLVE CTL_CODE(FSCTL_DFS_BASE, 25, METHOD_BUFFERED, FILE_ANY_ACCESS)
  186. #define FSCTL_DFS_SET_DOMAIN_GLUON CTL_CODE(FSCTL_DFS_BASE, 20, METHOD_BUFFERED, FILE_WRITE_DATA)
  187. //
  188. // Registry key/value for site coverage
  189. //
  190. #define REG_KEY_COVERED_SITES L"SYSTEM\\CurrentControlSet\\Services\\DfsDriver\\CoveredSites"
  191. #define REG_VALUE_COVERED_SITES L"CoveredSites"
  192. typedef struct _DFS_IPADDRESS {
  193. USHORT IpFamily; // probably AF_INET == 2
  194. USHORT IpLen; // # bytes that count in IpData
  195. CHAR IpData[14]; // IpLen bytes used
  196. } DFS_IPADDRESS, *PDFS_IPADDRESS;
  197. #ifdef MIDL_PASS
  198. #define DFSMIDLSTRING [string] LPWSTR
  199. #define DFSSIZEIS [size_is(Count)]
  200. #else
  201. #define DFSMIDLSTRING LPWSTR
  202. #define DFSSIZEIS
  203. #endif
  204. // FSCTL_DFS_IS_VALID_PREFIX Input Buffer
  205. // The length values are in bytes.
  206. typedef struct {
  207. BOOLEAN CSCAgentCreate;
  208. SHORT RemoteNameLen;
  209. WCHAR RemoteName[1];
  210. } DFS_IS_VALID_PREFIX_ARG, *PDFS_IS_VALID_PREFIX_ARG;
  211. // FSCTL_DFS_GET_PKT_ENTRY_STATE Input Buffer
  212. // All the strings appear in Buffer in the same order as the length fields. The strings
  213. // are not NULL terminated. The length values are in bytes.
  214. typedef struct {
  215. SHORT DfsEntryPathLen;
  216. SHORT ServerNameLen;
  217. SHORT ShareNameLen;
  218. ULONG Level;
  219. WCHAR Buffer[1];
  220. } DFS_GET_PKT_ENTRY_STATE_ARG, *PDFS_GET_PKT_ENTRY_STATE_ARG;
  221. // FSCTRL_DFS_SET_PKT_ENTRY_STATE Input Buffer
  222. // All the strings appear in Buffer in the same order as the length fields. The strings
  223. // are not NULL terminated. The length values are in bytes.
  224. typedef struct {
  225. SHORT DfsEntryPathLen;
  226. SHORT ServerNameLen;
  227. SHORT ShareNameLen;
  228. ULONG Level;
  229. union {
  230. ULONG State; // DFS_INFO_101
  231. ULONG Timeout; // DFS_INFL_102
  232. };
  233. WCHAR Buffer[1];
  234. } DFS_SET_PKT_ENTRY_STATE_ARG, *PDFS_SET_PKT_ENTRY_STATE_ARG;
  235. // FSCTL_DFS_PKT_CREATE_SPECIAL_NAMES Input Buffer:
  236. typedef struct {
  237. ULONG Count;
  238. LPWSTR SpecialName;
  239. LPWSTR *ExpandedNames;
  240. } DFS_SPECIAL_NAME_CONTAINER, *PDFS_SPECIAL_NAME_CONTAINER;
  241. typedef struct {
  242. ULONG Count;
  243. PDFS_SPECIAL_NAME_CONTAINER *SpecialNameContainers;
  244. } DFS_PKT_CREATE_SPECIAL_NAMES_ARG, *PDFS_PKT_CREATE_SPECIAL_NAMES_ARG;
  245. typedef struct {
  246. GUID Uid;
  247. DFSMIDLSTRING Prefix;
  248. } NET_DFS_ENTRY_ID, *LPNET_DFS_ENTRY_ID;
  249. typedef struct {
  250. ULONG Count;
  251. DFSSIZEIS LPNET_DFS_ENTRY_ID Buffer;
  252. } NET_DFS_ENTRY_ID_CONTAINER, *LPNET_DFS_ENTRY_ID_CONTAINER;
  253. // FSCTL_DFS_CREATE_LOCAL_PARTITION Input Buffer:
  254. typedef struct {
  255. LPWSTR ShareName;
  256. LPWSTR SharePath;
  257. GUID EntryUid;
  258. LPWSTR EntryPrefix;
  259. LPWSTR ShortName;
  260. LPNET_DFS_ENTRY_ID_CONTAINER RelationInfo;
  261. BOOLEAN Force;
  262. } *PDFS_CREATE_LOCAL_PARTITION_ARG;
  263. // FSCTL_DFS_DELETE_LOCAL_PARTITION Input Buffer:
  264. typedef struct {
  265. GUID Uid;
  266. LPWSTR Prefix;
  267. } *PDFS_DELETE_LOCAL_PARTITION_ARG;
  268. // FSCTL_DFS_SET_LOCAL_VOLUME_STATE Input Buffer
  269. typedef struct {
  270. GUID Uid;
  271. LPWSTR Prefix;
  272. ULONG State;
  273. } *PDFS_SET_LOCAL_VOLUME_STATE_ARG;
  274. // FSCTL_DFS_SET_SERVER_INFO Input Buffer
  275. typedef struct {
  276. GUID Uid;
  277. LPWSTR Prefix;
  278. } *PDFS_SET_SERVER_INFO_ARG;
  279. // FSCTL_DFS_CREATE_EXIT_POINT Input Buffer
  280. typedef struct {
  281. GUID Uid;
  282. LPWSTR Prefix;
  283. ULONG Type;
  284. } *PDFS_CREATE_EXIT_POINT_ARG;
  285. // FSCTL_DFS_DELETE_EXIT_POINT Input Buffer
  286. typedef struct {
  287. GUID Uid;
  288. LPWSTR Prefix;
  289. ULONG Type;
  290. } *PDFS_DELETE_EXIT_POINT_ARG;
  291. // FSCTL_DFS_MODIFY_PREFIX Input Buffer
  292. typedef struct {
  293. GUID Uid;
  294. LPWSTR Prefix;
  295. } *PDFS_MODIFY_PREFIX_ARG;
  296. // FSCTL_DFS_FIX_LOCAL_VOLUME Input Buffer
  297. typedef struct {
  298. LPWSTR VolumeName;
  299. ULONG EntryType;
  300. ULONG ServiceType;
  301. LPWSTR StgId;
  302. GUID EntryUid;
  303. LPWSTR EntryPrefix;
  304. LPWSTR ShortPrefix;
  305. LPNET_DFS_ENTRY_ID_CONTAINER RelationInfo;
  306. ULONG CreateDisposition;
  307. } *PDFS_FIX_LOCAL_VOLUME_ARG;
  308. // FSCTL_DFS_TRANSLATE_PATH Input Buffer
  309. typedef struct {
  310. ULONG Flags;
  311. UNICODE_STRING SubDirectory;
  312. UNICODE_STRING ParentPathName;
  313. UNICODE_STRING DfsPathName;
  314. } DFS_TRANSLATE_PATH_ARG, *PDFS_TRANSLATE_PATH_ARG;
  315. #define DFS_TRANSLATE_STRIP_LAST_COMPONENT 1
  316. // FSCTL_DFS_FIND_SHARE Input Buffer
  317. typedef struct {
  318. UNICODE_STRING ShareName;
  319. } DFS_FIND_SHARE_ARG, *PDFS_FIND_SHARE_ARG;
  320. // FSCTL_DFS_CREATE_SITE_INFO Input Buffer:
  321. typedef struct {
  322. UNICODE_STRING ServerName;
  323. ULONG SiteCount;
  324. UNICODE_STRING SiteName[1]; // actually SiteCount
  325. } DFS_CREATE_SITE_INFO_ARG, *PDFS_CREATE_SITE_INFO_ARG;
  326. // FSCTL_DFS_DELETE_SITE_INFO Input Buffer:
  327. typedef struct {
  328. UNICODE_STRING ServerName;
  329. } DFS_DELETE_SITE_INFO_ARG, *PDFS_DELETE_SITE_INFO_ARG;
  330. // FSCTL_DFS_CREATE_IP_INFO Input Buffer:
  331. typedef struct {
  332. DFS_IPADDRESS IpAddress;
  333. UNICODE_STRING SiteName;
  334. } DFS_CREATE_IP_INFO_ARG, *PDFS_CREATE_IP_INFO_ARG;
  335. // FSCTL_DFS_DELETE_IP_INFO Input Buffer:
  336. typedef struct {
  337. DFS_IPADDRESS IpAddress;
  338. } DFS_DELETE_IP_INFO_ARG, *PDFS_DELETE_IP_INFO_ARG;
  339. // FSCTL_DFS_CREATE_SPECIAL_INFO Input Buffer:
  340. typedef struct {
  341. UNICODE_STRING SpecialName;
  342. ULONG Flags;
  343. ULONG TrustDirection;
  344. ULONG TrustType;
  345. ULONG Timeout;
  346. LONG NameCount;
  347. UNICODE_STRING Name[1]; // actually NameCount
  348. } DFS_CREATE_SPECIAL_INFO_ARG, *PDFS_CREATE_SPECIAL_INFO_ARG;
  349. // Flags for FSCTL_DFS_CREATE_SPECIAL_INFO
  350. #define DFS_SPECIAL_INFO_PRIMARY 0x00000001
  351. #define DFS_SPECIAL_INFO_NETBIOS 0x00000002
  352. // FSCTL_DFS_DELETE_SPECIAL_INFO Input Buffer:
  353. typedef struct {
  354. UNICODE_STRING SpecialName;
  355. } DFS_DELETE_SPECIAL_INFO_ARG, *PDFS_DELETE_SPECIAL_INFO_ARG;
  356. // FSCTL_SRV_DFSSRV_CONNECT Input Buffer:
  357. typedef struct {
  358. UNICODE_STRING PortName;
  359. } DFS_SRV_DFSSRV_CONNECT_ARG, *PDFS_SRV_DFSSRV_CONNECT_ARG;
  360. // FSCTL_SRV_DFSSRV_IPADDR Input Buffer:
  361. typedef struct {
  362. DFS_IPADDRESS IpAddress;
  363. } DFS_SRV_DFSSRV_IPADDR_ARG, *PDFS_SRV_DFSSRV_IPADDR_ARG;
  364. // FSCTL_DFS_GET_REFERRALS Input Buffer
  365. typedef struct {
  366. UNICODE_STRING DfsPathName;
  367. ULONG MaxReferralLevel;
  368. DFS_IPADDRESS IpAddress;
  369. } DFS_GET_REFERRALS_INPUT_ARG, *PDFS_GET_REFERRALS_INPUT_ARG;
  370. // FSCTL_DFS_SPECIAL_SET_DC Input Buffer
  371. typedef struct {
  372. UNICODE_STRING SpecialName;
  373. UNICODE_STRING DcName;
  374. } DFS_SPECIAL_SET_DC_INPUT_ARG, *PDFS_SPECIAL_SET_DC_INPUT_ARG;
  375. // FSCTL_DFS_GET_REFERRALS Output Buffer
  376. // IoStatus.Information contains the amount of data returned
  377. //
  378. // The format of the Output Buffer is simply that of RESP_GET_DFS_REFERRAL,
  379. // described in smbtrans.h
  380. //
  381. // FSCTL_DFS_REPORT_INCONSISTENCY Input Buffer
  382. typedef struct {
  383. UNICODE_STRING DfsPathName; // DFS path having inconsistency
  384. PCHAR Ref; // Actually, pointer to a DFS_REFERRAL_V1
  385. } DFS_REPORT_INCONSISTENCY_ARG, *PDFS_REPORT_INCONSISTENCY_ARG;
  386. // FSCTL_DFS_IS_SHARE_IN_DFS Input Buffer
  387. typedef struct {
  388. union {
  389. USHORT ServerType; // 0 == Don't know, 1 == SMB, 2 == Netware
  390. USHORT ShareType; // On return, 0x1 == share is root of a Dfs
  391. }; // 0x2 == share is participating in Dfs
  392. UNICODE_STRING ShareName; // Name of share
  393. UNICODE_STRING SharePath; // Path of the share
  394. } DFS_IS_SHARE_IN_DFS_ARG, *PDFS_IS_SHARE_IN_DFS_ARG;
  395. #define DFS_SHARE_TYPE_ROOT 0x1
  396. #define DFS_SHARE_TYPE_DFS_VOLUME 0x2
  397. typedef struct {
  398. ULONG EventType;
  399. LPWSTR DomainName; // Name of domain
  400. LPWSTR DCName; // Path of the share
  401. } DFS_SPC_REFRESH_INFO, *PDFS_SPC_REFRESH_INFO;
  402. //
  403. //FSCTL_DFS_GET_VERSION Input Buffer:
  404. // This fsctl returns the version number of the Dfs driver installed on the
  405. // machine.
  406. typedef struct {
  407. ULONG Version;
  408. } DFS_GET_VERSION_ARG, *PDFS_GET_VERSION_ARG;
  409. //
  410. // FSCTRL_DFS_GET_PKT address object
  411. //
  412. typedef struct {
  413. USHORT State; // See below
  414. WCHAR ServerShare[1]; // Really a WSTR, UNICODE_NULL terminated
  415. } DFS_PKT_ADDRESS_OBJECT, *PDFS_PKT_ADDRESS_OBJECT;
  416. #define DFS_PKT_ADDRESS_OBJECT_ACTIVE 0x001
  417. #define DFS_PKT_ADDRESS_OBJECT_OFFLINE 0x002
  418. //
  419. // FSCTRL_DFS_GET_PKT object
  420. //
  421. typedef struct {
  422. LPWSTR Prefix;
  423. LPWSTR ShortPrefix;
  424. ULONG Type;
  425. ULONG USN;
  426. ULONG ExpireTime;
  427. ULONG UseCount;
  428. GUID Uid;
  429. ULONG ServiceCount;
  430. PDFS_PKT_ADDRESS_OBJECT *Address; // Array of DFS_PKT_ADDRESS_OBJECTS's, len ServiceCount
  431. } DFS_PKT_ENTRY_OBJECT, *PDFS_PKT_ENTRY_OBJECT;
  432. //
  433. // FSCTRL_DFS_GET_PKT Output Buffer:
  434. // This fsctl returns what is in the PKT
  435. //
  436. typedef struct {
  437. ULONG EntryCount;
  438. DFS_PKT_ENTRY_OBJECT EntryObject[1]; // Really EntryCount
  439. } DFS_GET_PKT_ARG, *PDFS_GET_PKT_ARG;
  440. // Standardized provider IDs as given in eProviderId
  441. #define PROV_ID_LOCAL_FS 0x101 // generic local file system
  442. #define PROV_ID_DFS_RDR 0x201 // Uplevel LanMan redirector
  443. #define PROV_ID_MUP_RDR 0x202 // Mup
  444. #define PROV_ID_LM_RDR 0x202 // Compatability
  445. #define PROV_ID_LANM_RDR 0x203 // Downlevel LanMan redirector
  446. // Provider capabilities as given in fRefCapability and fProvCapability
  447. #define PROV_DFS_RDR 2 // accepts NtCreateFile with EA Principal
  448. #define PROV_STRIP_PREFIX 4 // strip file name prefix before redispatching
  449. #define PROV_UNAVAILABLE 8 // provider unavailable - try to reattach.
  450. //[ dfs_define_logical_root
  451. //
  452. // Control structure for FSCTL_DFS_DEFINE_LOGICAL_ROOT
  453. #define MAX_LOGICAL_ROOT_NAME 16
  454. typedef struct _FILE_DFS_DEF_LOGICAL_ROOT_BUFFER {
  455. BOOLEAN fForce;
  456. WCHAR LogicalRoot[MAX_LOGICAL_ROOT_NAME];
  457. WCHAR RootPrefix[1];
  458. } FILE_DFS_DEF_ROOT_BUFFER, *PFILE_DFS_DEF_ROOT_BUFFER;
  459. //
  460. // FORCE definition needed for NetrDfsRemoveFtRoot
  461. //
  462. #define DFS_FORCE_REMOVE 0x80000000
  463. //]
  464. //[ dfs_define_root_credentials
  465. //
  466. // Control structure for FSCTL_DFS_DEFINE_ROOT_CREDENTIALS. All the strings
  467. // appear in Buffer in the same order as the length fields. The strings
  468. // are not NULL terminated. The length values are in bytes.
  469. //
  470. typedef struct _FILE_DFS_DEF_ROOT_CREDENTIALS {
  471. BOOLEAN CSCAgentCreate;
  472. USHORT Flags;
  473. USHORT DomainNameLen;
  474. USHORT UserNameLen;
  475. USHORT PasswordLen;
  476. USHORT ServerNameLen;
  477. USHORT ShareNameLen;
  478. USHORT RootPrefixLen;
  479. WCHAR LogicalRoot[MAX_LOGICAL_ROOT_NAME];
  480. WCHAR Buffer[1];
  481. } FILE_DFS_DEF_ROOT_CREDENTIALS, *PFILE_DFS_DEF_ROOT_CREDENTIALS;
  482. #define DFS_DEFERRED_CONNECTION 1
  483. #define DFS_USE_NULL_PASSWORD 2
  484. //]
  485. //----------------------------------------------------------------------------
  486. //
  487. // Everything below here is to support the old Dfs design.
  488. //
  489. #define EA_NAME_OPENIFJP ".OpenIfJP"
  490. #endif