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.

84 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. vs_assert.hxx
  5. Abstract:
  6. Various macros for correctly defining the ASSERTS in VSS and ATL code.
  7. In order to use ASSERTs in VSS and ATL you must:
  8. * add -D_DEBUG -D_ATL_NO_DEBUG_CRT into the compiling options on Checked builds
  9. * Include this file _before_ atlbase.h and vs_inc.hxx whenever you use ATL traces or BS_ASSERT
  10. This file will "hook" the ATL asserts and BS_ASSERT and make them visible.
  11. Author:
  12. Adi Oltean [aoltean] 26/04/2000
  13. Revision History:
  14. Name Date Comments
  15. aoltean 26/04/2000 Creating this file based on BrianB's ASSERTS
  16. --*/
  17. #ifndef __VSS_ASSRT_HXX__
  18. #define __VSS_ASSRT_HXX__
  19. #if _MSC_VER > 1000
  20. #pragma once
  21. #endif
  22. #include <wtypes.h>
  23. ////////////////////////////////////////////////////////////////////////
  24. // Standard foo for file name aliasing. This code block must be after
  25. // all includes of VSS header files.
  26. //
  27. #ifdef VSS_FILE_ALIAS
  28. #undef VSS_FILE_ALIAS
  29. #endif
  30. #define VSS_FILE_ALIAS "INCASRTH"
  31. //
  32. ////////////////////////////////////////////////////////////////////////
  33. #ifdef _DEBUG
  34. #define _ASSERTE(x) { if (!(x)) AssertFail(__FILE__, __LINE__, #x ); }
  35. #define assert(x) _ASSERTE(x)
  36. #define ATLASSERT(x) _ASSERTE(x)
  37. #define BS_ASSERT(x) _ASSERTE(x)
  38. #else
  39. #define _ASSERTE(x)
  40. #define assert(x)
  41. #define ATLASSERT(x)
  42. #define BS_ASSERT(x)
  43. #endif
  44. enum _VSS_DEBUG_REPORT_FLAGS
  45. {
  46. VSS_DBG_TO_DEBUG_CONSOLE = 0x00000002, // Assert displayed as a string at console debug
  47. VSS_DBG_MESSAGE_BOX = 0x00000004, // Assert displayed as a message box
  48. };
  49. // Used to report the asserts
  50. void AssertFail(LPCSTR FileName, UINT LineNumber, LPCSTR Condition);
  51. // Used to set the reporting mode.
  52. // By default the reporting mode uses a message box and reporting to the debug console.
  53. void VssSetDebugReport( LONG lDebugReportFlags );
  54. #endif // __VSS_ASSRT_HXX__