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.

158 lines
5.3 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // File: dfsdata.h
  4. //
  5. // Contents: This module declares the global data used by the
  6. // Dfs file system.
  7. //
  8. // Functions:
  9. //
  10. // History: 12 Nov 1991 AlanW Created.
  11. //
  12. //-----------------------------------------------------------------------------
  13. #ifndef _DFSDATA_
  14. #define _DFSDATA_
  15. //
  16. // The global Dfs FSD data record. All Dfs allocated data structures are
  17. // anchored off of DfsData.
  18. //
  19. extern DFS_DATA DfsData;
  20. //
  21. // The global timer context record, used by the timer thread and work items
  22. // queued by the timer thread.
  23. //
  24. extern DFS_TIMER_CONTEXT DfsTimerContext;
  25. //
  26. // The maximum length of a logical root device name: length
  27. // of the device name prefix, plus size of a path separator
  28. // plus the maximum logical root name length.
  29. //
  30. #define MAX_LOGICAL_ROOT_LEN (sizeof(DD_DFS_DEVICE_DIRECTORY) + \
  31. sizeof (UNICODE_PATH_SEP) + \
  32. MAX_LOGICAL_ROOT_NAME * sizeof (WCHAR))
  33. extern WCHAR LogicalRootDevPath[];
  34. extern ULONG DfsEventLog;
  35. extern ULONG MupVerbose;
  36. //
  37. // The global Dsfs debug level variable.
  38. //
  39. #if DBG
  40. extern LONG DfsDebugTraceLevel;
  41. extern LONG DfsDebugTraceIndent;
  42. #define DEBUG_TRACE_ERROR (0x00000001)
  43. #define DEBUG_TRACE_DEBUG_HOOKS (0x00000002)
  44. #define DEBUG_TRACE_CATCH_EXCEPTIONS (0x00000004)
  45. #define DEBUG_TRACE_UNWIND (0x00000008)
  46. #define DEBUG_TRACE_REGISTRY (0x00000010)
  47. #define DEBUG_TRACE_CLOSE (0x00000020)
  48. #define DEBUG_TRACE_CREATE (0x00000040)
  49. #define DEBUG_TRACE_INIT (0x00000080)
  50. #define DEBUG_TRACE_INSTRUM (0x00000100)
  51. #define DEBUG_TRACE_FILEINFO (0x00000200)
  52. #define DEBUG_TRACE_FSCTRL (0x00000400)
  53. #define DEBUG_TRACE_RTL (0x00000800)
  54. #define DEBUG_TRACE_READ (0x00001000)
  55. #define DEBUG_TRACE_VOLINFO (0x00002000)
  56. #define DEBUG_TRACE_WRITE (0x00004000)
  57. #define DEBUG_TRACE_DEVCTRL (0x00008000)
  58. #define DEBUG_TRACE_PKT (0x00010000)
  59. #define DEBUG_TRACE_DOTDFS (0x00020000)
  60. #define DEBUG_TRACE_LOCALVOL (0x00040000)
  61. #define DEBUG_TRACE_DNR (0x00080000)
  62. #define DEBUG_TRACE_ATTACH (0x00100000)
  63. #define DEBUG_TRACE_FASTIO (0x00200000)
  64. #define DEBUG_TRACE_DIRSUP (0x00400000)
  65. #define DEBUG_TRACE_FILOBSUP (0x00800000)
  66. #define DEBUG_TRACE_EVENTLOG (0x01000000)
  67. #define DEBUG_TRACE_LOGROOT (0x02000000)
  68. #define DEBUG_TRACE_CACHESUP (0x04000000)
  69. #define DEBUG_TRACE_PREFXSUP (0x08000000)
  70. #define DEBUG_TRACE_DEVIOSUP (0x10000000)
  71. #define DEBUG_TRACE_STRUCSUP (0x20000000)
  72. #define DEBUG_TRACE_FSP_DISPATCHER (0x40000000)
  73. #define DEBUG_TRACE_FSP_DUMP (0x80000000)
  74. //+---------------------------------------------------------------------------
  75. // Macro: DfsDbgTrace, public
  76. //
  77. // Synopsis: Conditionally print a debug trace message
  78. //
  79. // Arguments: [Indent] -- Indent to appluy: +1, 0 or -1
  80. // [Level] -- debug trace level
  81. // [Msg] -- Message to be printed, can include one prinf-style
  82. // format effector.
  83. // [Y] -- Value to be printed
  84. //
  85. // Returns: None
  86. //
  87. //----------------------------------------------------------------------------
  88. VOID DfsDebugTracePrint(PCHAR x, PVOID y);
  89. #define DfsDbgTrace(INDENT,LEVEL,X,Y) { \
  90. if (((LEVEL) == 0) || (DfsDebugTraceLevel & (LEVEL))) { \
  91. if ((INDENT) < 0) { \
  92. DfsDebugTraceIndent += (INDENT); \
  93. } \
  94. DfsDebugTracePrint(X, (PVOID)Y); \
  95. if ((INDENT) > 0) { \
  96. DfsDebugTraceIndent += (INDENT); \
  97. } \
  98. } \
  99. }
  100. #define DebugUnwind(X) { \
  101. if (AbnormalTermination()) { \
  102. DfsDbgTrace(0, DEBUG_TRACE_UNWIND, #X ", Abnormal termination.\n", 0); \
  103. } \
  104. }
  105. #else
  106. #define DfsDbgTrace(INDENT,LEVEL,X,Y) {NOTHING;}
  107. #define DebugUnwind(X) {NOTHING;}
  108. #endif // DBG
  109. //+---------------------------------------------------------------------------
  110. // Macro: BugCheck, public
  111. //
  112. // Synopsis: Call DfsBugCheck with invoker's file and line numbers
  113. //
  114. // Arguments: [Msg] -- Optional Message to be printed for debug
  115. // builds
  116. //
  117. // Returns: None
  118. //
  119. //----------------------------------------------------------------------------
  120. #if DBG
  121. VOID DfsBugCheck(CHAR *pszmsg, CHAR *pszfile, ULONG line);
  122. #define BugCheck(sz) DfsBugCheck(sz, __FILE__, __LINE__)
  123. #else
  124. VOID DfsBugCheck(VOID);
  125. #define BugCheck(sz) DfsBugCheck()
  126. #endif
  127. #endif // _DFSDATA_