lmdfs.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _LMDFS_
  7. #define _LMDFS_
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #ifndef NET_API_FUNCTION
  12. #define NET_API_FUNCTION WINAPI
  13. #endif
  14. #define DFS_VOLUME_STATES 0xF
  15. #define DFS_VOLUME_STATE_OK 1
  16. #define DFS_VOLUME_STATE_INCONSISTENT 2
  17. #define DFS_VOLUME_STATE_OFFLINE 3
  18. #define DFS_VOLUME_STATE_ONLINE 4
  19. #define DFS_VOLUME_STATE_RESYNCHRONIZE 0x10
  20. #define DFS_VOLUME_STATE_STANDBY 0x20
  21. #define DFS_VOLUME_FLAVORS 0x0300
  22. #define DFS_VOLUME_FLAVOR_UNUSED1 0x0000
  23. #define DFS_VOLUME_FLAVOR_STANDALONE 0x0100
  24. #define DFS_VOLUME_FLAVOR_AD_BLOB 0x0200
  25. #define DFS_STORAGE_FLAVOR_UNUSED2 0x0300
  26. #define DFS_STORAGE_STATES 0xF
  27. #define DFS_STORAGE_STATE_OFFLINE 1
  28. #define DFS_STORAGE_STATE_ONLINE 2
  29. #define DFS_STORAGE_STATE_ACTIVE 4
  30. typedef enum _DFS_TARGET_PRIORITY_CLASS {
  31. DfsInvalidPriorityClass = -1,DfsSiteCostNormalPriorityClass = 0,DfsGlobalHighPriorityClass,DfsSiteCostHighPriorityClass,
  32. DfsSiteCostLowPriorityClass,DfsGlobalLowPriorityClass
  33. } DFS_TARGET_PRIORITY_CLASS;
  34. typedef struct _DFS_TARGET_PRIORITY {
  35. DFS_TARGET_PRIORITY_CLASS TargetPriorityClass;
  36. USHORT TargetPriorityRank;
  37. USHORT Reserved;
  38. } DFS_TARGET_PRIORITY,*PDFS_TARGET_PRIORITY;
  39. typedef struct _DFS_INFO_1 {
  40. LPWSTR EntryPath;
  41. } DFS_INFO_1,*PDFS_INFO_1,*LPDFS_INFO_1;
  42. typedef struct _DFS_INFO_2 {
  43. LPWSTR EntryPath;
  44. LPWSTR Comment;
  45. DWORD State;
  46. DWORD NumberOfStorages;
  47. } DFS_INFO_2,*PDFS_INFO_2,*LPDFS_INFO_2;
  48. typedef struct _DFS_STORAGE_INFO {
  49. ULONG State;
  50. LPWSTR ServerName;
  51. LPWSTR ShareName;
  52. } DFS_STORAGE_INFO,*PDFS_STORAGE_INFO,*LPDFS_STORAGE_INFO;
  53. #ifdef _WIN64
  54. typedef struct _DFS_STORAGE_INFO_0_32 {
  55. ULONG State;
  56. ULONG ServerName;
  57. ULONG ShareName;
  58. } DFS_STORAGE_INFO_0_32,*PDFS_STORAGE_INFO_0_32,*LPDFS_STORAGE_INFO_0_32;
  59. #endif
  60. typedef struct _DFS_STORAGE_INFO_1 {
  61. ULONG State;
  62. LPWSTR ServerName;
  63. LPWSTR ShareName;
  64. DFS_TARGET_PRIORITY TargetPriority;
  65. } DFS_STORAGE_INFO_1,*PDFS_STORAGE_INFO_1,*LPDFS_STORAGE_INFO_1;
  66. typedef struct _DFS_INFO_3 {
  67. LPWSTR EntryPath;
  68. LPWSTR Comment;
  69. DWORD State;
  70. DWORD NumberOfStorages;
  71. LPDFS_STORAGE_INFO Storage;
  72. } DFS_INFO_3,*PDFS_INFO_3,*LPDFS_INFO_3;
  73. #ifdef _WIN64
  74. typedef struct _DFS_INFO_3_32 {
  75. ULONG EntryPath;
  76. ULONG Comment;
  77. DWORD State;
  78. DWORD NumberOfStorages;
  79. ULONG Storage;
  80. } DFS_INFO_3_32,*PDFS_INFO_3_32,*LPDFS_INFO_3_32;
  81. #endif
  82. typedef struct _DFS_INFO_4 {
  83. LPWSTR EntryPath;
  84. LPWSTR Comment;
  85. DWORD State;
  86. ULONG Timeout;
  87. GUID Guid;
  88. DWORD NumberOfStorages;
  89. LPDFS_STORAGE_INFO Storage;
  90. } DFS_INFO_4,*PDFS_INFO_4,*LPDFS_INFO_4;
  91. #ifdef _WIN64
  92. typedef struct _DFS_INFO_4_32 {
  93. ULONG EntryPath;
  94. ULONG Comment;
  95. DWORD State;
  96. ULONG Timeout;
  97. GUID Guid;
  98. DWORD NumberOfStorages;
  99. ULONG Storage;
  100. } DFS_INFO_4_32,*PDFS_INFO_4_32,*LPDFS_INFO_4_32;
  101. #endif
  102. typedef struct _DFS_INFO_5 {
  103. LPWSTR EntryPath;
  104. LPWSTR Comment;
  105. DWORD State;
  106. ULONG Timeout;
  107. GUID Guid;
  108. ULONG PropertyFlags;
  109. ULONG MetadataSize;
  110. DWORD NumberOfStorages;
  111. } DFS_INFO_5,*PDFS_INFO_5,*LPDFS_INFO_5;
  112. typedef struct _DFS_INFO_6 {
  113. LPWSTR EntryPath;
  114. LPWSTR Comment;
  115. DWORD State;
  116. ULONG Timeout;
  117. GUID Guid;
  118. ULONG PropertyFlags;
  119. ULONG MetadataSize;
  120. DWORD NumberOfStorages;
  121. LPDFS_STORAGE_INFO_1 Storage;
  122. } DFS_INFO_6,*PDFS_INFO_6,*LPDFS_INFO_6;
  123. typedef struct _DFS_INFO_7 {
  124. GUID GenerationGuid;
  125. } DFS_INFO_7,*PDFS_INFO_7,*LPDFS_INFO_7;
  126. #define DFS_PROPERTY_FLAG_INSITE_REFERRALS 0x00000001
  127. #define DFS_PROPERTY_FLAG_ROOT_SCALABILITY 0x00000002
  128. #define DFS_PROPERTY_FLAG_SITE_COSTING 0x00000004
  129. #define DFS_PROPERTY_FLAG_TARGET_FAILBACK 0x00000008
  130. #define DFS_PROPERTY_FLAG_CLUSTER_ENABLED 0x00000010
  131. #define DFS_PROPERTY_FLAG_ABDE 0x00000020
  132. typedef struct _DFS_INFO_100 {
  133. LPWSTR Comment;
  134. } DFS_INFO_100,*PDFS_INFO_100,*LPDFS_INFO_100;
  135. typedef struct _DFS_INFO_101 {
  136. DWORD State;
  137. } DFS_INFO_101,*PDFS_INFO_101,*LPDFS_INFO_101;
  138. typedef struct _DFS_INFO_102 {
  139. ULONG Timeout;
  140. } DFS_INFO_102,*PDFS_INFO_102,*LPDFS_INFO_102;
  141. typedef struct _DFS_INFO_103 {
  142. ULONG PropertyFlagMask;
  143. ULONG PropertyFlags;
  144. } DFS_INFO_103,*PDFS_INFO_103,*LPDFS_INFO_103;
  145. typedef struct _DFS_INFO_104 {
  146. DFS_TARGET_PRIORITY TargetPriority;
  147. } DFS_INFO_104,*PDFS_INFO_104,*LPDFS_INFO_104;
  148. typedef struct _DFS_INFO_105 {
  149. LPWSTR Comment;
  150. DWORD State;
  151. ULONG Timeout;
  152. ULONG PropertyFlagMask;
  153. ULONG PropertyFlags;
  154. } DFS_INFO_105,*PDFS_INFO_105,*LPDFS_INFO_105;
  155. typedef struct _DFS_INFO_106 {
  156. DWORD State;
  157. DFS_TARGET_PRIORITY TargetPriority;
  158. } DFS_INFO_106,*PDFS_INFO_106,*LPDFS_INFO_106;
  159. #if (_WIN32_WINNT >= 0x0600)
  160. #define DFS_NAMESPACE_CAPABILITY_ABDE 0x0000000000000001
  161. typedef enum _DFS_NAMESPACE_VERSION_ORIGIN {
  162. DFS_NAMESPACE_VERSION_ORIGIN_COMBINED = 0,
  163. DFS_NAMESPACE_VERSION_ORIGIN_SERVER = 1,
  164. DFS_NAMESPACE_VERSION_ORIGIN_DOMAIN = 2
  165. } DFS_NAMESPACE_VERSION_ORIGIN;
  166. typedef struct _DFS_SUPPORTED_NAMESPACE_VERSION_INFO {
  167. ULONG DomainDfsMajorVersion;
  168. ULONG NamespaceMinorVersion;
  169. ULONGLONG DomainDfsCapabilities;
  170. ULONG StandaloneDfsMajorVersion;
  171. ULONG StandaloneDfsMinorVersion;
  172. ULONGLONG StandaloneDfsCapabilities;
  173. } DFS_SUPPORTED_NAMESPACE_VERSION_INFO, *PDFS_SUPPORTED_NAMESPACE_VERSION_INFO;
  174. typedef struct _DFS_INFO_8 {
  175. LPWSTR EntryPath;
  176. LPWSTR Comment;
  177. DWORD State;
  178. ULONG Timeout;
  179. GUID Guid;
  180. ULONG PropertyFlags;
  181. ULONG MetadataSize;
  182. ULONG SdLengthReserved;
  183. PSECURITY_DESCRIPTOR pSecurityDescriptor;
  184. DWORD NumberOfStorages;
  185. } DFS_INFO_8, *PDFS_INFO_8;
  186. typedef struct _DFS_INFO_9 {
  187. LPWSTR EntryPath;
  188. LPWSTR Comment;
  189. DWORD State;
  190. ULONG Timeout;
  191. GUID Guid;
  192. ULONG PropertyFlags;
  193. ULONG MetadataSize;
  194. ULONG SdLengthReserved;
  195. PSECURITY_DESCRIPTOR pSecurityDescriptor;
  196. DWORD NumberOfStorages;
  197. LPDFS_STORAGE_INFO_1 Storage;
  198. } DFS_INFO_9, *PDFS_INFO_9;
  199. typedef struct _DFS_INFO_50 {
  200. ULONG NamespaceMajorVersion;
  201. ULONG NamespaceMinorVersion;
  202. ULONGLONG NamespaceCapabilities;
  203. } DFS_INFO_50, *PDFS_INFO_50;
  204. typedef struct _DFS_INFO_107 {
  205. LPWSTR Comment;
  206. DWORD State;
  207. ULONG Timeout;
  208. ULONG PropertyFlagMask;
  209. ULONG PropertyFlags;
  210. ULONG SdLengthReserved;
  211. PSECURITY_DESCRIPTOR pSecurityDescriptor;
  212. } DFS_INFO_107, *PDFS_INFO_107;
  213. typedef struct _DFS_INFO_150 {
  214. ULONG SdLengthReserved;
  215. PSECURITY_DESCRIPTOR pSecurityDescriptor;
  216. } DFS_INFO_150, *PDFS_INFO_150;
  217. NET_API_STATUS NET_API_FUNCTION NetDfsAddRootTarget(
  218. LPWSTR pDfsPath,
  219. LPWSTR pTargetPath,
  220. ULONG MajorVersion,
  221. LPWSTR pComment,
  222. ULONG Flags
  223. );
  224. NET_API_STATUS NET_API_FUNCTION NetDfsGetSupportedNamespaceVersion(
  225. DFS_NAMESPACE_VERSION_ORIGIN Origin,
  226. PWSTR pName,
  227. PDFS_SUPPORTED_NAMESPACE_VERSION_INFO *ppVersionInfo
  228. );
  229. NET_API_STATUS NET_API_FUNCTION NetDfsRemoveRootTarget(
  230. LPWSTR pDfsPath,
  231. LPWSTR pTargetPath,
  232. ULONG Flags
  233. );
  234. NET_API_STATUS WINAPI NetShareDelEx(
  235. LMSTR servername,
  236. DWORD level,
  237. LPBYTE buf
  238. );
  239. #endif /*(_WIN32_WINNT >= 0x0600)*/
  240. typedef struct _DFS_INFO_200 {
  241. LPWSTR FtDfsName;
  242. } DFS_INFO_200,*PDFS_INFO_200,*LPDFS_INFO_200;
  243. typedef struct _DFS_INFO_300 {
  244. DWORD Flags;
  245. LPWSTR DfsName;
  246. } DFS_INFO_300,*PDFS_INFO_300,*LPDFS_INFO_300;
  247. #define DFS_ADD_VOLUME 1
  248. #define DFS_RESTORE_VOLUME 2
  249. NET_API_STATUS WINAPI NetDfsAdd(LPWSTR DfsEntryPath,LPWSTR ServerName,LPWSTR ShareName,LPWSTR Comment,DWORD Flags);
  250. NET_API_STATUS WINAPI NetDfsAddStdRoot(LPWSTR ServerName,LPWSTR RootShare,LPWSTR Comment,DWORD Flags);
  251. NET_API_STATUS WINAPI NetDfsRemoveStdRoot(LPWSTR ServerName,LPWSTR RootShare,DWORD Flags);
  252. NET_API_STATUS WINAPI NetDfsAddFtRoot(LPWSTR ServerName,LPWSTR RootShare,LPWSTR FtDfsName,LPWSTR Comment,DWORD Flags);
  253. NET_API_STATUS WINAPI NetDfsRemoveFtRoot(LPWSTR ServerName,LPWSTR RootShare,LPWSTR FtDfsName,DWORD Flags);
  254. NET_API_STATUS WINAPI NetDfsRemoveFtRootForced(LPWSTR DomainName,LPWSTR ServerName,LPWSTR RootShare,LPWSTR FtDfsName,DWORD Flags);
  255. NET_API_STATUS WINAPI NetDfsManagerInitialize(LPWSTR ServerName,DWORD Flags);
  256. NET_API_STATUS WINAPI NetDfsAddStdRootForced(LPWSTR ServerName,LPWSTR RootShare,LPWSTR Comment,LPWSTR Store);
  257. NET_API_STATUS WINAPI NetDfsGetDcAddress(LPWSTR ServerName,LPWSTR *DcIpAddress,BOOLEAN *IsRoot,ULONG *Timeout);
  258. #define NET_DFS_SETDC_FLAGS 0x00000000
  259. #define NET_DFS_SETDC_TIMEOUT 0x00000001
  260. #define NET_DFS_SETDC_INITPKT 0x00000002
  261. typedef struct {
  262. ULONG SiteFlags;
  263. LPWSTR SiteName;
  264. } DFS_SITENAME_INFO,*PDFS_SITENAME_INFO,*LPDFS_SITENAME_INFO;
  265. #define DFS_SITE_PRIMARY 0x1
  266. typedef struct {
  267. ULONG cSites;
  268. DFS_SITENAME_INFO Site[1];
  269. } DFS_SITELIST_INFO,*PDFS_SITELIST_INFO,*LPDFS_SITELIST_INFO;
  270. NET_API_STATUS WINAPI NetDfsRemove(LPWSTR DfsEntryPath,LPWSTR ServerName,LPWSTR ShareName);
  271. NET_API_STATUS WINAPI NetDfsEnum(LPWSTR DfsName,DWORD Level,DWORD PrefMaxLen,LPBYTE *Buffer,LPDWORD EntriesRead,LPDWORD ResumeHandle);
  272. NET_API_STATUS WINAPI NetDfsGetInfo(LPWSTR DfsEntryPath,LPWSTR ServerName,LPWSTR ShareName,DWORD Level,LPBYTE *Buffer);
  273. NET_API_STATUS WINAPI NetDfsSetInfo(LPWSTR DfsEntryPath,LPWSTR ServerName,LPWSTR ShareName,DWORD Level,LPBYTE Buffer);
  274. NET_API_STATUS WINAPI NetDfsGetClientInfo(LPWSTR DfsEntryPath,LPWSTR ServerName,LPWSTR ShareName,DWORD Level,LPBYTE *Buffer);
  275. NET_API_STATUS WINAPI NetDfsSetClientInfo(LPWSTR DfsEntryPath,LPWSTR ServerName,LPWSTR ShareName,DWORD Level,LPBYTE Buffer);
  276. NET_API_STATUS WINAPI NetDfsMove(LPWSTR DfsEntryPath,LPWSTR DfsNewEntryPath,ULONG Flags);
  277. #define DFS_MOVE_FLAG_REPLACE_IF_EXISTS 0x00000001
  278. NET_API_STATUS WINAPI NetDfsRename(LPWSTR Path,LPWSTR NewPath);
  279. NET_API_STATUS WINAPI NetDfsGetSecurity(LPWSTR DfsEntryPath,SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR *ppSecurityDescriptor,LPDWORD lpcbSecurityDescriptor);
  280. NET_API_STATUS WINAPI NetDfsSetSecurity(LPWSTR DfsEntryPath,SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR pSecurityDescriptor);
  281. NET_API_STATUS WINAPI NetDfsGetStdContainerSecurity(LPWSTR MachineName,SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR *ppSecurityDescriptor,LPDWORD lpcbSecurityDescriptor);
  282. NET_API_STATUS WINAPI NetDfsSetStdContainerSecurity(LPWSTR MachineName,SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR pSecurityDescriptor);
  283. NET_API_STATUS WINAPI NetDfsGetFtContainerSecurity(LPWSTR DomainName,SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR *ppSecurityDescriptor,LPDWORD lpcbSecurityDescriptor);
  284. NET_API_STATUS WINAPI NetDfsSetFtContainerSecurity(LPWSTR DomainName,SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR pSecurityDescriptor);
  285. #ifdef __cplusplus
  286. }
  287. #endif
  288. #endif