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.

100 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. DfsAssert.h
  5. Abstract:
  6. This module declares the prototypes and global data used by the special RDBSS assert facilties.
  7. Author:
  8. Rohan Phillips [Rohanp] 18-Jan-2001
  9. Revision History:
  10. Notes:
  11. --*/
  12. #ifndef _DFSASSERT_INCLUDED_
  13. #define _DFSASSERT_INCLUDED_
  14. VOID DfsDbgBreakPoint(PCHAR FileName, ULONG LineNumber);
  15. //only do this is my routine is the one of interest.......
  16. #ifdef DFS_ASSERTS
  17. #if !DBG
  18. //here, ntifs will have already defined the asserts away..........
  19. // so, we just put them back.....this code is duplicated from ntifs.h
  20. #undef ASSERT
  21. #define ASSERT( exp ) \
  22. if (!(exp)) \
  23. DfsDbgBreakPoint(__FILE__,__LINE__)
  24. #undef ASSERTMSG
  25. #define ASSERTMSG( msg, exp ) \
  26. if (!(exp)) \
  27. DfsDbgBreakPoint(__FILE__,__LINE__)
  28. #endif //!DBG
  29. //this will make asserts go to our routine
  30. #define RtlAssert DfsAssert
  31. VOID
  32. DfsAssert(
  33. IN PVOID FailedAssertion,
  34. IN PVOID FileName,
  35. IN ULONG LineNumber,
  36. IN PCHAR Message OPTIONAL
  37. );
  38. #endif //ifdef DFS_ASSERTS
  39. #if DBG
  40. ULONG DfsDebugVector = 0;
  41. #define DFS_TRACE_ERROR 0x00000001
  42. #define DFS_TRACE_DEBUG 0x00000002
  43. #define DFS_TRACE_CONTEXT 0x00000004
  44. #define DFS_TRACE_DETAIL 0x00000008
  45. #define DFS_TRACE_ENTRYEXIT 0x00000010
  46. #define DFS_TRACE_WARNING 0x00000020
  47. #define DFS_TRACE_ALL 0xffffffff
  48. #define DfsDbgTrace(_x_, _y_) { \
  49. if (_x_ & DfsDebugVector) { \
  50. DbgPrint _y_; \
  51. } \
  52. }
  53. #else
  54. #define DfsDbgTrace(_x_, _y_)
  55. #endif
  56. #define DfsTraceEnter(func) \
  57. PCHAR __pszFunction = func; \
  58. DfsDbgTrace(DFS_TRACE_ENTRYEXIT,("Entering %s\n",__pszFunction));
  59. #define DfsTraceLeave(status) \
  60. DfsDbgTrace(DFS_TRACE_ENTRYEXIT,("Leaving %s Status -> %08lx\n",__pszFunction,status))
  61. #define RxDbgTrace(x, y, z)
  62. #define CHECK_STATUS( status ) if( (status) == g_CheckStatus) \
  63. { DbgBreakPoint() ; }
  64. #endif // _DFSASSERT_INCLUDED_
  65.