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.

237 lines
6.9 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1995, Microsoft Corporation
  4. //
  5. // File: dfsmsrv.h
  6. //
  7. // Contents: Server side helper functions for Dfs Manager.
  8. //
  9. // Classes:
  10. //
  11. // Functions: DfsManager --
  12. //
  13. // History: 12-28-95 Milans Created
  14. //
  15. //-----------------------------------------------------------------------------
  16. #ifndef _DFSM_SERVER_
  17. #define _DFSM_SERVER_
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif // __cplusplus
  21. #define DFS_MANAGER_SERVER 0x1
  22. #define DFS_MANAGER_FTDFS 0x2
  23. //+----------------------------------------------------------------------------
  24. //
  25. // Function: DfsInitGlobals
  26. //
  27. // Synopsis: Initializes the Dfs Manager globals. This is to be used for
  28. // setup purposes only - it must be called before calling
  29. // DfsManagerCreateVolumeObject.
  30. //
  31. // Arguments: [wszDomain] -- Name of dfs root for which this Dfs Manager
  32. // is being initialized.
  33. // [dwType] -- Type of Dfs Manager being initialized -
  34. // DFS_MANAGER_SERVER or DFS_MANAGER_DOMAIN_DC
  35. //
  36. // Returns: [ERROR_SUCCESS] -- If init succeeded.
  37. //
  38. // [ERROR_OUTOFMEMORY] -- Out of memory initializing global variables
  39. //
  40. //-----------------------------------------------------------------------------
  41. DWORD
  42. DfsInitGlobals(
  43. LPWSTR wszDomain,
  44. DWORD dwType);
  45. //+----------------------------------------------------------------------------
  46. //
  47. // Function: DfsManager
  48. //
  49. // Synopsis: Entry point for Dfs Manager.
  50. //
  51. // Arguments: [wszDomain] -- Name of dfs root for which this Dfs Manager
  52. // is being instantiated.
  53. // [dwType] -- Type of Dfs Manager being instantiated -
  54. // DFS_MANAGER_SERVER or DFS_MANAGER_DOMAIN_DC
  55. //
  56. // Returns: [ERROR_SUCCESS] -- If Dfs Manager started correctly.
  57. //
  58. // [ERROR_OUTOFMEMORY] -- If globals could not be allocated.
  59. //
  60. // Win32 error from reading the Dfs Volume Objects.
  61. //
  62. // Win32 error from registering the RPC interface.
  63. //
  64. // Win32 error from creating the knowledge sync thread.
  65. //
  66. //-----------------------------------------------------------------------------
  67. DWORD
  68. DfsManager(
  69. LPWSTR wszDomain,
  70. DWORD dwType);
  71. //+----------------------------------------------------------------------------
  72. //
  73. // Function: DfsManagerCreateVolumeObject
  74. //
  75. // Synopsis: Bootstrap routine to create a volume object directly (ie,
  76. // without having to call DfsCreateChildVolume on a parent
  77. // volume)
  78. //
  79. // Arguments: [pwszObjectName] -- Name of the volume object.
  80. // [pwszPrefix] -- Entry Path of dfs volume.
  81. // [pwszServer] -- Name of server.
  82. // [pwszShare] -- Name of share.
  83. // [pwszComment] -- Comment for dfs volume.
  84. // [guidVolume] -- Id of dfs volume.
  85. //
  86. // Returns:
  87. //
  88. //-----------------------------------------------------------------------------
  89. DWORD
  90. DfsManagerCreateVolumeObject(
  91. IN LPWSTR pwszObjectName,
  92. IN LPWSTR pwszPrefix,
  93. IN LPWSTR pwszServer,
  94. IN LPWSTR pwszShare,
  95. IN LPWSTR pwszComment,
  96. IN GUID *guidVolume);
  97. //+----------------------------------------------------------------------------
  98. //
  99. // Function: DfsManagerAddService
  100. //
  101. // Synopsis: Bootstrap routine for adding a service to an existing volume
  102. // object. Used to set up additional root servers in an FTDfs
  103. // setup.
  104. //
  105. // Arguments: [pwszFullObjectName] -- Name of the volume object.
  106. // [pwszServer] -- Name of server to add.
  107. // [pwszShare] -- Name of share.
  108. // [guidVolume] -- On successful return, id of volume.
  109. //
  110. // Returns:
  111. //
  112. //-----------------------------------------------------------------------------
  113. DWORD
  114. DfsManagerAddService(
  115. IN LPWSTR pwszFullObjectName,
  116. IN LPWSTR pwszServer,
  117. IN LPWSTR pwszShare,
  118. OUT GUID *guidVolume);
  119. //+----------------------------------------------------------------------------
  120. //
  121. // Function: DfsManagerRemoveService
  122. //
  123. // Synopsis: Bootstrap routine for removing a service from an existing
  124. // volume object. Used to remove root servers in an FTDfs
  125. // setup.
  126. //
  127. // Arguments: [pwszFullObjectName] -- Name of the volume object.
  128. // [pwszServer] -- Name of server to remove.
  129. //
  130. // Returns:
  131. //
  132. //-----------------------------------------------------------------------------
  133. DWORD
  134. DfsManagerRemoveService(
  135. IN LPWSTR pwszFullObjectName,
  136. IN LPWSTR pwszServer);
  137. //+----------------------------------------------------------------------------
  138. //
  139. // Function: DfsManagerRemoveServiceForced
  140. //
  141. // Synopsis: Routine for removing a service from an existing
  142. // volume object. Used to remove root servers in an FTDfs
  143. // setup, even if the root is not available.
  144. //
  145. // Arguments: [pwszServer] -- Name of server to remove.
  146. //
  147. // Returns:
  148. //
  149. //-----------------------------------------------------------------------------
  150. DWORD
  151. DfsManagerRemoveServiceForced(
  152. IN LPWSTR pwszServer);
  153. //+----------------------------------------------------------------------------
  154. //
  155. // Function: DfsManagerHandleKnowledgeInconsistency
  156. //
  157. // Synopsis: Routine to handle knowledge inconsistencies being reported by
  158. // Dfs clients.
  159. //
  160. // Arguments: [pBuffer] -- Pointer to marshalled Volume Verify Arg
  161. // [cbBuffer] -- size in bytes of pBuffer
  162. //
  163. // Returns: [STATUS_SUCCESS] -- Knowledge inconsistency fixed.
  164. //
  165. // [STATUS_UNSUCCESSFUL] -- Unable to fix Knowledge inconsistency.
  166. // Problem has been logged to event log.
  167. //
  168. //-----------------------------------------------------------------------------
  169. NTSTATUS
  170. DfsManagerHandleKnowledgeInconsistency(
  171. PBYTE pBuffer,
  172. ULONG cbBuffer);
  173. //+----------------------------------------------------------------------------
  174. //
  175. // Function: DfsManagerValidateLocalVolumes
  176. //
  177. // Synopsis: Validates the relation info of all local volumes with the
  178. // Dfs Root server
  179. //
  180. // Arguments: None
  181. //
  182. // Returns: TRUE if validation attempt succeeded, FALSE if could not
  183. // validate all local volumes
  184. //
  185. //-----------------------------------------------------------------------------
  186. BOOLEAN
  187. DfsManagerValidateLocalVolumes();
  188. //+----------------------------------------------------------------------------
  189. //
  190. // Function: DfsManagerSetDCName
  191. //
  192. // Synopsis: Sets the DC we should first attempt to connect to.
  193. //
  194. // Arguments: [pwszDCName] -- Name of the DC
  195. //
  196. // Returns: ERROR_SUCCESS
  197. //
  198. //-----------------------------------------------------------------------------
  199. DWORD
  200. DfsManagerSetDcName(
  201. IN LPWSTR pwszDCName);
  202. VOID
  203. LogWriteMessage(
  204. ULONG UniqueErrorCode,
  205. DWORD dwErr,
  206. ULONG nStrings,
  207. LPCWSTR *pwStr);
  208. #ifdef __cplusplus
  209. }
  210. #endif
  211. #endif // _DFSM_SERVER_