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.

162 lines
4.0 KiB

  1. #ifndef __DFS_UTIL_H__
  2. #define __DFS_UTIL_H__
  3. #include "lm.h"
  4. #include "lmdfs.h"
  5. #include <netdfs.h>
  6. #include <dfsprefix.h>
  7. #include <DfsServerLibrary.hxx>
  8. #include <dfsmisc.h>
  9. #include "Struct.hxx"
  10. #include "misc.hxx"
  11. typedef enum _DFS_API_MODE {
  12. MODE_INVALID = 0,
  13. MODE_API,
  14. MODE_DIRECT,
  15. MODE_EITHER
  16. } DFS_API_MODE;
  17. typedef struct _DFS_UPDATE_STATISTICS
  18. {
  19. ULONG LinkAdded;
  20. ULONG LinkDeleted;
  21. ULONG LinkModified;
  22. ULONG TargetAdded;
  23. ULONG TargetDeleted;
  24. ULONG TargetModified;
  25. ULONG ApiCount;
  26. } DFS_UPDATE_STATISTICS, *PDFS_UPDATE_STATISTICS;
  27. class DfsPathName;
  28. class DfsRoot;
  29. class DfsLink;
  30. class DfsTarget;
  31. DFSSTATUS
  32. DfsView (
  33. LPWSTR RootName,
  34. FILE *Out,
  35. BOOLEAN ScriptOut );
  36. DumpDfsInfo(
  37. DWORD Entry,
  38. DWORD Level,
  39. PVOID pBuf,
  40. FILE *Out);
  41. DFSSTATUS
  42. DfsRenameLinksToDomain(
  43. IN DfsPathName *pDfsPath,
  44. IN LPWSTR OldDomainName,
  45. IN LPWSTR NewDomainName);
  46. DFSSTATUS
  47. SetInfoReSynchronize(
  48. LPWSTR ServerName,
  49. LPWSTR ShareName);
  50. VOID
  51. AddToCost(
  52. LPWSTR Name,
  53. BOOLEAN IsLink
  54. );
  55. DFSSTATUS
  56. DfsReadDocument(
  57. LPWSTR FileToRead,
  58. DfsRoot **ppRoot );
  59. DFSSTATUS
  60. SetDfsRoots(
  61. DfsRoot *pRoot,
  62. DfsRoot *pImportRoot,
  63. HANDLE FileHandle,
  64. BOOLEAN NoBackup);
  65. DFSSTATUS
  66. MergeDfsRoots(
  67. DfsRoot *pRoot,
  68. DfsRoot *pImportRoot,
  69. HANDLE FileHandle,
  70. BOOLEAN NoBackup);
  71. DFSSTATUS
  72. VerifyDfsRoots(
  73. DfsRoot *pRoot,
  74. DfsRoot *pImportRoot );
  75. DFSSTATUS
  76. DumpRoots (DfsRoot *pRoot, HANDLE Handle, BOOLEAN x);
  77. DFSSTATUS
  78. DfsBuildNameSpaceInformation ( DfsPathName *pNameSpace,
  79. LPWSTR UseDC,
  80. DFS_API_MODE Mode,
  81. BOOLEAN SiteAware,
  82. DfsRoot **ppRoot);
  83. extern BOOLEAN fSwDirect;
  84. extern BOOLEAN fSwDebug;
  85. extern BOOLEAN fSwVerbose;
  86. extern BOOLEAN fSwSet, fSwMerge;
  87. extern BOOLEAN fSwVerify;
  88. extern BOOLEAN fSwBlobSize;
  89. extern DfsPathName *gDfsNameSpace;
  90. extern BOOLEAN CommandSucceeded;
  91. extern BOOLEAN ErrorDisplayed;
  92. extern FILE *DebugOut;
  93. //
  94. // DirectMode bypasses NetDfs* calls to the remote dfssvc.exe
  95. // server process and calls Active Directory directly. As a result
  96. // it bypasses the AD Blob Cache on the server to create a fast
  97. // path for importing deep DFS trees.
  98. //
  99. //
  100. // DirectMode bypasses NetDfs* calls to the remote dfssvc.exe
  101. // server process and calls Active Directory directly. As a result
  102. // it bypasses the AD Blob Cache on the server to create a fast
  103. // path for importing deep DFS trees.
  104. //
  105. #define DfsApiRemove( md, x, y, z ) (((md) == MODE_DIRECT) ? \
  106. DfsRemove( (x), (y), (z) ) : \
  107. NetDfsRemove( (x), (y), (z) ))
  108. #define DfsApiAdd( md, Rt, Sr, Sh, Cm, Fl ) (((md) == MODE_DIRECT) ? \
  109. DfsAdd( (Rt), (Sr), (Sh), (Cm), (Fl) ) : \
  110. NetDfsAdd( (Rt), (Sr), (Sh), (Cm), (Fl) ))
  111. #define DfsApiSetInfo( md, Rt, Sr, Sh, Cm, Fl ) (((md) == MODE_DIRECT) ? \
  112. DfsSetInfo( (Rt), (Sr), (Sh), (Cm), (LPBYTE)(Fl) ) : \
  113. NetDfsSetInfo( (Rt), (Sr), (Sh), (Cm), (LPBYTE)(&((*Fl)->Info101)) ))
  114. #define DfsApiEnumerate( md, Nm, Lv, Ml, Bf, Er, Rh ) (((md) == MODE_DIRECT) ? \
  115. DfsEnum( (Nm), (Lv), (Ml), (Bf), (Er), (Rh) ) : \
  116. NetDfsEnum( (Nm), (Lv), (Ml), (Bf), (Er), (Rh) ))
  117. #define DfsFreeApiBuffer( x ) ((fSwDirect == TRUE) ? \
  118. MIDL_user_free( x ) : \
  119. NetApiBufferFree( x ))
  120. #define DebugInformation(x) if (fSwVerbose) ShowDebugInformation x
  121. #define ShowInformation(x) ShowVerboseInformation x
  122. #endif // __DFS_UTIL_H__