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.

327 lines
6.5 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation.
  3. Module Name:
  4. header.h
  5. Abstract:
  6. This module contains the main infrastructure for mup data structures.
  7. Revision History:
  8. Uday Hegde (udayh) 02\06\2001
  9. NOTES:
  10. */
  11. #ifndef __DFS_SERVER_LIBRARY_H__
  12. #define __DFS_SERVER_LIBRARY_H__
  13. #include <netdfs.h>
  14. #define DEFAULT_LINK_TIMEOUT 300
  15. #define DEFAULT_LINK_STATE DFS_VOLUME_STATE_OK
  16. #define DEFAULT_TARGET_STATE DFS_STORAGE_STATE_ONLINE
  17. #define PKT_ENTRY_TYPE_DFS 0x0001 // Entry refers to DFS
  18. #define PKT_ENTRY_TYPE_LEAFONLY 0x0008
  19. #define PKT_ENTRY_TYPE_OUTSIDE_MY_DOM 0x0010 // Entry refers to volume in
  20. // foreign domain
  21. #define PKT_ENTRY_TYPE_INSITE_ONLY 0x0020 // Only give insite referrals.
  22. #define PKT_ENTRY_TYPE_COST_BASED_SITE_SELECTION 0x0040 // get inter-site costs from DS.
  23. #define PKT_ENTRY_TYPE_REFERRAL_SVC 0x0080 // Entry refers to a DC
  24. #define PKT_ENTRY_TYPE_PERMANENT 0x0100 // Entry cannot be scavenged
  25. #define PKT_ENTRY_TYPE_ROOT_SCALABILITY 0x0200
  26. #define PKT_ENTRY_TYPE_OFFLINE 0x2000 // Entry refers to a volume
  27. // that is offline
  28. #define PKT_ENTRY_TYPE_STALE 0x4000 // Entry is stale
  29. #define PKT_ENTRY_TYPE_EXTENDED_ATTRIBUTES \
  30. (PKT_ENTRY_TYPE_INSITE_ONLY | PKT_ENTRY_TYPE_COST_BASED_SITE_SELECTION | \
  31. PKT_ENTRY_TYPE_ROOT_SCALABILITY )
  32. //
  33. // Used for DfsSetInfo.
  34. //
  35. typedef union _DFS_API_INFO {
  36. DFS_INFO_1 Info1;
  37. DFS_INFO_2 Info2;
  38. DFS_INFO_3 Info3;
  39. DFS_INFO_4 Info4;
  40. DFS_INFO_100 Info100;
  41. DFS_INFO_101 Info101;
  42. DFS_INFO_102 Info102;
  43. } DFS_API_INFO, *PDFS_API_INFO;
  44. //
  45. // Flags needed for initialize the DfsServerLibrary.
  46. //
  47. #define DFS_LOCAL_NAMESPACE 0x1
  48. #define DFS_CREATE_DIRECTORIES 0x2
  49. #define DFS_MIGRATE 0x4
  50. #define DFS_DIRECT_MODE 0x8
  51. #define DFS_DONT_SUBSTITUTE_PATHS 0x10
  52. #define DFS_INSITE_REFERRALS 0x20
  53. #define DFS_SITE_COSTED_REFERRALS 0x40
  54. #define DFS_POST_EVENT_LOG 0x80
  55. typedef DWORD DFSSTATUS;
  56. typedef struct _DFS_DIRECT_API_CONTEXT {
  57. UNICODE_STRING RootName;
  58. UNICODE_STRING ServerName;
  59. UNICODE_STRING ShareName;
  60. PVOID pObject;
  61. BOOLEAN IsInitialized;
  62. BOOLEAN IsWriteable;
  63. } DFS_DIRECT_API_CONTEXT, *PDFS_DIRECT_API_CONTEXT;
  64. typedef PDFS_DIRECT_API_CONTEXT DFS_SERVER_LIB_HANDLE, *PDFS_SERVER_LIB_HANDLE;
  65. #define SetDirectHandleWriteable(_hndl) (((PDFS_DIRECT_API_CONTEXT)(_hndl))->IsWriteable = TRUE)
  66. #define ResetDirectHandleWriteable(_hndl) (((PDFS_DIRECT_API_CONTEXT)(_hndl))->IsWriteable = FALSE)
  67. DFSSTATUS
  68. DfsAdd(
  69. LPWSTR DfsPathName,
  70. LPWSTR ServerName,
  71. LPWSTR ShareName,
  72. LPWSTR Comment,
  73. DWORD Flags );
  74. DFSSTATUS
  75. DfsRemove(
  76. LPWSTR DfsPathName,
  77. LPWSTR ServerName,
  78. LPWSTR ShareName );
  79. DFSSTATUS
  80. DfsEnumerate(
  81. LPWSTR DfsPathName,
  82. DWORD Level,
  83. DWORD PrefMaxLen,
  84. LPBYTE pBuffer,
  85. LONG BufferSize,
  86. LPDWORD pEntriesRead,
  87. LPDWORD pResumeHandle,
  88. PLONG pNextSizeRequired );
  89. DFSSTATUS
  90. DfsGetInfo(
  91. LPWSTR DfsPathName,
  92. DWORD Level,
  93. LPBYTE pBuffer,
  94. LONG BufferSize,
  95. PLONG pSizeRequired );
  96. DFSSTATUS
  97. DfsSetInfo(
  98. LPWSTR DfsPathName,
  99. LPWSTR Server,
  100. LPWSTR Share,
  101. DWORD Level,
  102. LPBYTE pBuffer );
  103. DFSSTATUS
  104. DfsSetInfoCheckAccess(
  105. LPWSTR DfsPathName,
  106. LPWSTR Server,
  107. LPWSTR Share,
  108. DWORD Level,
  109. LPBYTE pBuffer,
  110. DFSSTATUS AccessCheckStatus );
  111. DFSSTATUS
  112. DfsAddStandaloneRoot(
  113. LPWSTR MachineName,
  114. LPWSTR ShareName,
  115. LPWSTR Comment,
  116. ULONG Flags );
  117. DFSSTATUS
  118. DfsDeleteStandaloneRoot(
  119. LPWSTR ServerName,
  120. LPWSTR ShareName );
  121. DFSSTATUS
  122. DfsEnumerateRoots(
  123. LPWSTR DfsName,
  124. BOOLEAN DomainRoots,
  125. LPBYTE pBuffer,
  126. ULONG BufferSize,
  127. PULONG pEntriesRead,
  128. LPDWORD pResumeHandle,
  129. PULONG pSizeRequired );
  130. DFSSTATUS
  131. DfsAddHandledNamespace(
  132. LPWSTR Name,
  133. BOOLEAN Migrate );
  134. DFSSTATUS
  135. DfsServerInitialize(
  136. ULONG Flags );
  137. DFSSTATUS
  138. DfsDeleteADBlobRoot(
  139. LPWSTR MachineName,
  140. LPWSTR DcName,
  141. LPWSTR ShareName,
  142. LPWSTR LogicalShare,
  143. DWORD Flags,
  144. PVOID ppList );
  145. DFSSTATUS
  146. DfsAddADBlobRoot(
  147. LPWSTR MachineName,
  148. LPWSTR DcName,
  149. LPWSTR ShareName,
  150. LPWSTR LogicalShare,
  151. LPWSTR Comment,
  152. BOOLEAN NewFtDfs,
  153. DWORD Flags,
  154. PVOID ppList );
  155. DFSSTATUS
  156. AccessImpersonateCheckRpcClient();
  157. //
  158. // DirectApi specific calls.
  159. //
  160. DFSSTATUS
  161. DfsServerLibraryInitialize(
  162. ULONG Flags);
  163. DFSSTATUS
  164. DfsDirectApiOpen(
  165. IN LPWSTR DfsNameSpace,
  166. IN LPWSTR DcName,
  167. OUT PVOID *pLibHandle );
  168. DFSSTATUS
  169. DfsDirectApiCommitChanges(
  170. IN PVOID LibHandle );
  171. DFSSTATUS
  172. DfsDirectApiClose(
  173. IN PVOID LibHandle );
  174. DFSSTATUS
  175. DfsEnum(
  176. IN LPWSTR DfsName,
  177. IN DWORD Level,
  178. IN DWORD PrefMaxLen,
  179. OUT LPBYTE *pBuffer,
  180. OUT LPDWORD pEntriesRead,
  181. IN OUT LPDWORD pResumeHandle);
  182. DFSSTATUS
  183. DfsRenameLinks(
  184. IN LPWSTR DfsPath,
  185. IN LPWSTR OldDomainName,
  186. IN LPWSTR NewDomainName);
  187. DFSSTATUS
  188. DfsUnmapFtRootReplica(
  189. LPWSTR DfsPathName,
  190. LPWSTR ReplicaServerName,
  191. LPWSTR ReplicaShareName
  192. );
  193. DFSSTATUS
  194. DfsClean(
  195. LPWSTR HostServerName,
  196. LPWSTR ShareNameToClean
  197. );
  198. DFSSTATUS
  199. DfsExtendedRootAttributes(
  200. IN PVOID Handle,
  201. IN OUT PULONG pAttr,
  202. IN PUNICODE_STRING pRemaining,
  203. BOOLEAN Set );
  204. DFSSTATUS
  205. DfsGetBlobSize(
  206. IN PVOID Handle,
  207. OUT PULONG pBlobSize );
  208. DFSSTATUS
  209. DfsGetSiteBlob(
  210. IN PVOID Handle,
  211. OUT PVOID *ppBuffer,
  212. OUT PULONG pBlobSize );
  213. DFSSTATUS
  214. DfsSetSiteBlob(
  215. IN PVOID Handle,
  216. IN PVOID pBuffer,
  217. OUT ULONG BlobSize );
  218. VOID
  219. DfsFreeBlob(
  220. PUNICODE_STRING DfsPath,
  221. LPBYTE pBlob);
  222. //
  223. // Given a root share name, generate a
  224. // LDAP string of the form CN=,DC=,...
  225. //
  226. DFSSTATUS
  227. DfsGenerateDNPathString(
  228. IN LPWSTR RootObjName,
  229. OUT LPWSTR *pPathString);
  230. VOID
  231. DfsDeleteDNPathString(
  232. LPWSTR PathString);
  233. DFSSTATUS
  234. DfsSetupRpcImpersonation();
  235. DFSSTATUS
  236. DfsDisableRpcImpersonation();
  237. DFSSTATUS
  238. DfsReEnableRpcImpersonation();
  239. DFSSTATUS
  240. DfsTeardownRpcImpersonation();
  241. DFSSTATUS
  242. DfsGetErrorFromHr(
  243. HRESULT hr );
  244. BOOLEAN
  245. DfsIsMachineDomainController();
  246. #endif // __DFS_SERVER_LIBRARY_H__