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.

273 lines
5.3 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1992, Microsoft Corporation.
  4. //
  5. // File: dfsstruc.h
  6. //
  7. // Contents:
  8. // This module defines the data structures that make up the major internal
  9. // part of the DFS file system.
  10. //
  11. // Functions:
  12. //
  13. //-----------------------------------------------------------------------------
  14. #ifndef _DFSSTRUC_
  15. #define _DFSSTRUC_
  16. typedef enum {
  17. DFS_STATE_UNINITIALIZED = 0,
  18. DFS_STATE_INITIALIZED = 1,
  19. DFS_STATE_STARTED = 2,
  20. DFS_STATE_STOPPING = 3,
  21. DFS_STATE_STOPPED = 4
  22. } DFS_OPERATIONAL_STATE;
  23. typedef enum {
  24. DFS_UNKNOWN = 0,
  25. DFS_CLIENT = 1,
  26. DFS_SERVER = 2,
  27. DFS_ROOT_SERVER = 3,
  28. } DFS_MACHINE_STATE;
  29. typedef enum {
  30. LV_UNINITIALIZED = 0,
  31. LV_INITSCHEDULED,
  32. LV_INITINPROGRESS,
  33. LV_INITIALIZED,
  34. LV_VALIDATED
  35. } DFS_LV_STATE;
  36. //
  37. // The DFS_DATA record is the top record in the DFS file system in-memory
  38. // data structure. This structure must be allocated from non-paged pool.
  39. //
  40. typedef struct _DFS_DATA {
  41. //
  42. // The type and size of this record (must be DFS_NTC_DATA_HEADER)
  43. //
  44. NODE_TYPE_CODE NodeTypeCode;
  45. NODE_BYTE_SIZE NodeByteSize;
  46. //
  47. // A queue of all attached volume device objects
  48. //
  49. LIST_ENTRY AVdoQueue;
  50. //
  51. // A queue of all attached file system device objects
  52. //
  53. LIST_ENTRY AFsoQueue;
  54. //
  55. // A pointer to the Driver object we were initialized with
  56. //
  57. PDRIVER_OBJECT DriverObject;
  58. //
  59. // A pointer to the \Dfs device object
  60. //
  61. PDEVICE_OBJECT FileSysDeviceObject;
  62. //
  63. // A pointer to an array of provider records
  64. //
  65. struct _PROVIDER_DEF *pProvider;
  66. int cProvider, maxProvider;
  67. //
  68. // A resource variable to control access to the global data record
  69. //
  70. ERESOURCE Resource;
  71. //
  72. // A pointer to our EPROCESS struct, which is a required input to the
  73. // Cache Management subsystem. This field is simply set each time an
  74. // FSP thread is started, since it is easiest to do while running in the
  75. // Fsp.
  76. //
  77. PEPROCESS OurProcess;
  78. //
  79. // Principal Name of this machine.
  80. //
  81. UNICODE_STRING PrincipalName;
  82. //
  83. // The NetBIOS name of this machine. Needed for public Dfs APIs.
  84. //
  85. UNICODE_STRING NetBIOSName;
  86. //
  87. // The operational state of the machine - Started, Stopped, etc.
  88. //
  89. DFS_OPERATIONAL_STATE OperationalState;
  90. //
  91. // The state of the machine - DC, Server, Client etc.
  92. //
  93. DFS_MACHINE_STATE MachineState;
  94. //
  95. // Is this a DC?
  96. //
  97. BOOLEAN IsDC;
  98. //
  99. // The state of the local volumes - initialize or validated
  100. DFS_LV_STATE LvState;
  101. //
  102. // The system wide Partition Knowledge Table (PKT)
  103. //
  104. DFS_PKT Pkt;
  105. //
  106. // A hash table for associating DFS_FCBs with file objects
  107. //
  108. struct _FCB_HASH_TABLE *FcbHashTable;
  109. //
  110. // A hash table for associating Sites with machines
  111. //
  112. struct _SITE_HASH_TABLE *SiteHashTable;
  113. //
  114. // Another hash table for associating IP addresses with sites
  115. //
  116. struct _IP_HASH_TABLE *IpHashTable;
  117. //
  118. // Hash table for special names
  119. //
  120. struct _SPECIAL_HASH_TABLE *SpcHashTable;
  121. //
  122. // Hash table for FtDfs's
  123. //
  124. struct _SPECIAL_HASH_TABLE *FtDfsHashTable;
  125. //
  126. // Lpc Port info
  127. //
  128. struct _DFS_LPC_INFO DfsLpcInfo;
  129. } DFS_DATA, *PDFS_DATA;
  130. #define MAX_PROVIDERS 5 // number of pre-allocated provider records
  131. //
  132. // A PROVIDER_DEF is a provider definition record, which maps a provider
  133. // ID in a referral record to an installed provider.
  134. //
  135. typedef struct _PROVIDER_DEF {
  136. //
  137. // The type and size of this record (must be DFS_NTC_PROVIDER)
  138. //
  139. NODE_TYPE_CODE NodeTypeCode;
  140. NODE_BYTE_SIZE NodeByteSize;
  141. //
  142. // Provider ID and Capabilities, same as in the DS_REFERRAL structure.
  143. //
  144. USHORT eProviderId;
  145. USHORT fProvCapability;
  146. //
  147. // The following field gives the name of the device for the provider.
  148. //
  149. UNICODE_STRING DeviceName;
  150. //
  151. // Referenced pointers to the associated file and device objects
  152. //
  153. PDEVICE_OBJECT DeviceObject;
  154. PFILE_OBJECT FileObject;
  155. } PROVIDER_DEF, *PPROVIDER_DEF;
  156. //
  157. // For every open file on a volume object to which we are attached, we
  158. // maintain an FCB.
  159. //
  160. typedef struct _DFS_FCB {
  161. //
  162. // Type and size of this record (must be DFS_NTC_FCB)
  163. //
  164. NODE_TYPE_CODE NodeTypeCode;
  165. NODE_BYTE_SIZE NodeByteSize;
  166. //
  167. // A list entry for the hash table chain.
  168. //
  169. LIST_ENTRY HashChain;
  170. //
  171. // The following field is the fully qualified file name for this DFS_FCB/DCB
  172. // starting from the logical root.
  173. //
  174. UNICODE_STRING FullFileName;
  175. //
  176. // The following fields give the file on which this DFS_FCB
  177. // have been opened.
  178. //
  179. PFILE_OBJECT FileObject;
  180. } DFS_FCB, *PDFS_FCB;
  181. //
  182. // We need to order our referrals by site; we normalize the referral list of names and
  183. // types into the following structure.
  184. //
  185. typedef struct _DFS_REFERRAL_LIST {
  186. UNICODE_STRING pName; // ex: JHARPERDC1
  187. UNICODE_STRING pAddress; // ex: \\JHARPERDC1\MYFTDFS
  188. ULONG Type;
  189. } DFS_REFERRAL_LIST, *PDFS_REFERRAL_LIST;
  190. #endif // _DFSSTRUC_