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.

222 lines
5.9 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1997, Microsoft Corporation
  4. //
  5. // File: struct.hxx
  6. //
  7. //-----------------------------------------------------------------------------
  8. #ifndef _STRUCT_HXX
  9. #define _STRUCT_HXX
  10. #define DOMUNKNONN 0
  11. #define DOMDFS 1
  12. #define STDDFS 2
  13. typedef struct _DFS_LOCALVOLUME {
  14. LPWSTR wszObjectName;
  15. LPWSTR wszEntryPath;
  16. } DFS_LOCALVOLUME, *PDFS_LOCALVOLUME;
  17. typedef struct _DFS_ROOTLOCALVOL {
  18. LPWSTR wszObjectName;
  19. LPWSTR wszEntryPath;
  20. LPWSTR wszShortEntryPath;
  21. ULONG dwEntryType;
  22. LPWSTR wszShareName;
  23. LPWSTR wszStorageId;
  24. PDFS_LOCALVOLUME pDfsLocalVol;
  25. ULONG cLocalVolCount;
  26. } DFS_ROOTLOCALVOL, *PDFS_ROOTLOCALVOL;
  27. typedef struct _DFS_VOLUME {
  28. LPWSTR wszObjectName;
  29. GUID idVolume;
  30. LPWSTR wszPrefix;
  31. LPWSTR wszShortPrefix;
  32. ULONG dwType;
  33. ULONG dwState;
  34. LPWSTR wszComment;
  35. ULONG dwTimeout;
  36. FILETIME ftPrefix;
  37. FILETIME ftState;
  38. FILETIME ftComment;
  39. ULONG dwVersion;
  40. FILETIME *FtModification;
  41. ULONG ReplCount;
  42. ULONG AllocatedReplCount;
  43. DFS_REPLICA_INFO *ReplicaInfo;
  44. FILETIME *DelFtModification;
  45. ULONG DelReplCount;
  46. ULONG AllocatedDelReplCount;
  47. DFS_REPLICA_INFO *DelReplicaInfo;
  48. ULONG cbRecovery;
  49. PBYTE pRecovery;
  50. ULONG vFlags;
  51. } DFS_VOLUME, *PDFS_VOLUME;
  52. typedef struct _DFS_VOLUME_LIST {
  53. ULONG DfsType;
  54. ULONG Version;
  55. ULONG VolCount;
  56. ULONG AllocatedVolCount;
  57. PDFS_VOLUME *Volumes;
  58. GUID SiteGuid;
  59. ULONG SiteCount;
  60. ULONG sFlags;
  61. LIST_ENTRY SiteList;
  62. LPWSTR *RootServers;
  63. PDFS_ROOTLOCALVOL pRootLocalVol;
  64. ULONG cRootLocalVol;
  65. } DFS_VOLUME_LIST, *PDFS_VOLUME_LIST;
  66. typedef struct _LDAP_OBJECT {
  67. LPWSTR wszObjectName;
  68. ULONG cbObjectData;
  69. PCHAR pObjectData;
  70. } LDAP_OBJECT, *PLDAP_OBJECT;
  71. typedef struct _LDAP_PKT {
  72. ULONG cLdapObjects;
  73. PLDAP_OBJECT rgldapObjects;
  74. } LDAP_PKT, *PLDAP_PKT;
  75. typedef struct _DFS_VOLUME_PROPERTIES {
  76. GUID idVolume;
  77. LPWSTR wszPrefix;
  78. LPWSTR wszShortPrefix;
  79. ULONG dwType;
  80. ULONG dwState;
  81. LPWSTR wszComment;
  82. ULONG dwTimeout;
  83. FILETIME ftPrefix;
  84. FILETIME ftState;
  85. FILETIME ftComment;
  86. ULONG dwVersion;
  87. ULONG cbSvc;
  88. PBYTE pSvc;
  89. ULONG cbRecovery;
  90. PBYTE pRecovery;
  91. } DFS_VOLUME_PROPERTIES, *PDFS_VOLUME_PROPERTIES;
  92. //
  93. // Following are the recovery states that can be associated with the
  94. // volumes. These are only the operations that can be in progress i.e. the
  95. // first part of the recovery state. The exact stage of operations are
  96. // denoted by the states below this.
  97. //
  98. #define DFS_RECOVERY_STATE_NONE (0x0000)
  99. #define DFS_RECOVERY_STATE_CREATING (0x0001)
  100. #define DFS_RECOVERY_STATE_ADD_SERVICE (0x0002)
  101. #define DFS_RECOVERY_STATE_REMOVE_SERVICE (0x0003)
  102. #define DFS_RECOVERY_STATE_DELETE (0x0004)
  103. #define DFS_RECOVERY_STATE_MOVE (0x0005)
  104. typedef enum _DFS_RECOVERY_STATE {
  105. DFS_OPER_STAGE_START=1,
  106. DFS_OPER_STAGE_SVCLIST_UPDATED=2,
  107. DFS_OPER_STAGE_INFORMED_SERVICE=3,
  108. DFS_OPER_STAGE_INFORMED_PARENT=4
  109. } DFS_RECOVERY_STATE;
  110. //
  111. // Some MACROS to help in manipulating state and stage of VOL_RECOVERY_STATE.
  112. //
  113. #define DFS_COMPOSE_RECOVERY_STATE(op, s) ((op<<16)|(s))
  114. #define DFS_SET_RECOVERY_STATE(State, s) ((State&0xffff)|(s<<16))
  115. #define DFS_SET_OPER_STAGE(State, s) ((State&0xffff0000)|s)
  116. #define DFS_GET_RECOVERY_STATE(s) ((s & 0xffff0000) >> 16)
  117. #define DFS_GET_OPER_STAGE(s) (s & 0xffff)
  118. //
  119. // vFlags
  120. //
  121. #define VFLAGS_MODIFY 0x001
  122. #define VFLAGS_DELETE 0x002
  123. //
  124. // Globals
  125. //
  126. extern WCHAR DfsConfigContainer[];
  127. extern WCHAR DfsSpecialContainer[];
  128. extern WCHAR DfsSpecialObject[];
  129. extern WCHAR wszDfsRootName[];
  130. extern ULONG GTimeout;
  131. extern WCHAR wszDcName[];
  132. //
  133. // Undocumented
  134. //
  135. extern BOOLEAN fSwDebug;
  136. extern BOOLEAN fArgView;
  137. extern BOOLEAN fArgVerify;
  138. VOID
  139. MyPrintf(
  140. PWCHAR format,
  141. ...);
  142. VOID
  143. MyFPrintf(
  144. HANDLE hHandle,
  145. PWCHAR format,
  146. ...);
  147. //
  148. // Entry types
  149. //
  150. #define PKT_ENTRY_TYPE_DFS 0x0001
  151. #define PKT_ENTRY_TYPE_MACHINE 0x0002
  152. #define PKT_ENTRY_TYPE_NONDFS 0x0004
  153. #define PKT_ENTRY_TYPE_LEAFONLY 0x0008
  154. #define PKT_ENTRY_TYPE_OUTSIDE_MY_DOM 0x0010
  155. #define PKT_ENTRY_TYPE_INSITE_ONLY 0x0020 // Only give insite referrals.
  156. #define PKT_ENTRY_TYPE_SYSVOL 0x0040
  157. #define PKT_ENTRY_TYPE_REFERRAL_SVC 0x0080
  158. #define PKT_ENTRY_TYPE_PERMANENT 0x0100
  159. #define PKT_ENTRY_TYPE_DELETE_PENDING 0x0200
  160. #define PKT_ENTRY_TYPE_LOCAL 0x0400
  161. #define PKT_ENTRY_TYPE_LOCAL_XPOINT 0x0800
  162. #define PKT_ENTRY_TYPE_OFFLINE 0x2000
  163. #define PKT_ENTRY_TYPE_STALE 0x4000
  164. //
  165. // Sevice states
  166. //
  167. #define DFS_SERVICE_TYPE_MASTER (0x0001)
  168. #define DFS_SERVICE_TYPE_READONLY (0x0002)
  169. #define DFS_SERVICE_TYPE_LOCAL (0x0004)
  170. #define DFS_SERVICE_TYPE_REFERRAL (0x0008)
  171. #define DFS_SERVICE_TYPE_ACTIVE (0x0010)
  172. #define DFS_SERVICE_TYPE_DOWN_LEVEL (0x0020)
  173. #define DFS_SERVICE_TYPE_COSTLIER (0x0040)
  174. #define DFS_SERVICE_TYPE_OFFLINE (0x0080)
  175. //
  176. // How we make args & switches
  177. //
  178. #define MAKEARG(x) \
  179. WCHAR Arg##x[] = L"/" L#x L":"; \
  180. LONG ArgLen##x = (sizeof(Arg##x) / sizeof(WCHAR)) - 1; \
  181. BOOLEAN fArg##x;
  182. #define SWITCH(x) \
  183. WCHAR Sw##x[] = L"/" L#x ; \
  184. BOOLEAN fSw##x;
  185. #define FMAKEARG(x) \
  186. static WCHAR Arg##x[] = L#x L":"; \
  187. static LONG ArgLen##x = (sizeof(Arg##x) / sizeof(WCHAR)) - 1; \
  188. static BOOLEAN fArg##x;
  189. #define FSWITCH(x) \
  190. static WCHAR Sw##x[] = L"/" L#x ; \
  191. static BOOLEAN fSw##x;
  192. #endif _STRUCT_HXX