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.

114 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1996-2003 Microsoft Corporation
  3. All rights reserved
  4. Module Name:
  5. local.h
  6. Abstract:
  7. Environment:
  8. User Mode -Win32
  9. Revision History:
  10. --*/
  11. // @@BEGIN_DDKSPLIT
  12. #ifdef INTERNAL
  13. #include "splcom.h"
  14. #else
  15. // @@END_DDKSPLIT
  16. LPWSTR AllocSplStr(LPWSTR pStr);
  17. LPVOID AllocSplMem(DWORD cbAlloc);
  18. #define FreeSplMem( pMem ) (GlobalFree( pMem ) ? FALSE:TRUE)
  19. #define FreeSplStr( lpStr ) ((lpStr) ? (GlobalFree(lpStr) ? FALSE:TRUE):TRUE)
  20. /* DEBUGGING:
  21. */
  22. #define DBG_NONE 0x0000
  23. #define DBG_INFO 0x0001
  24. #define DBG_WARN 0x0002
  25. #define DBG_WARNING 0x0002
  26. #define DBG_ERROR 0x0004
  27. #define DBG_TRACE 0x0008
  28. #define DBG_SECURITY 0x0010
  29. #define DBG_EXEC 0x0020
  30. #define DBG_PORT 0x0040
  31. #define DBG_NOTIFY 0x0080
  32. #define DBG_PAUSE 0x0100
  33. #define DBG_ASSERT 0x0200
  34. #define DBG_THREADM 0x0400
  35. #define DBG_MIN 0x0800
  36. #define DBG_TIME 0x1000
  37. #define DBG_FOLDER 0x2000
  38. #define DBG_NOHEAD 0x8000
  39. #if DBG
  40. ULONG
  41. DbgPrint(
  42. PCH Format,
  43. ...
  44. );
  45. VOID
  46. DbgBreakPoint(
  47. VOID
  48. );
  49. #define GLOBAL_DEBUG_FLAGS LocalMonDebug
  50. extern DWORD GLOBAL_DEBUG_FLAGS;
  51. /* These flags are not used as arguments to the DBGMSG macro.
  52. * You have to set the high word of the global variable to cause it to break.
  53. * It is ignored if used with DBGMSG.
  54. * (Here mainly for explanatory purposes.)
  55. */
  56. #define DBG_BREAK_ON_WARNING ( DBG_WARNING << 16 )
  57. #define DBG_BREAK_ON_ERROR ( DBG_ERROR << 16 )
  58. /* Double braces are needed for this one, e.g.:
  59. *
  60. * DBGMSG( DBG_ERROR, ( "Error code %d", Error ) );
  61. *
  62. * This is because we can't use variable parameter lists in macros.
  63. * The statement gets pre-processed to a semi-colon in non-debug mode.
  64. *
  65. * Set the global variable GLOBAL_DEBUG_FLAGS via the debugger.
  66. * Setting the flag in the low word causes that level to be printed;
  67. * setting the high word causes a break into the debugger.
  68. * E.g. setting it to 0x00040006 will print out all warning and error
  69. * messages, and break on errors.
  70. */
  71. #define LcmDBGMSG( Level, MsgAndArgs ) \
  72. { \
  73. if( ( Level & 0xFFFF ) & GLOBAL_DEBUG_FLAGS ) \
  74. DbgPrint MsgAndArgs; \
  75. if( ( Level << 16 ) & GLOBAL_DEBUG_FLAGS ) \
  76. DbgBreakPoint(); \
  77. }
  78. #else
  79. #define LcmDBGMSG
  80. #endif
  81. // @@BEGIN_DDKSPLIT
  82. #endif
  83. // @@END_DDKSPLIT