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.

121 lines
3.2 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name :
  4. export.h
  5. Abstract:
  6. Declarations used by export.cpp and other utility functions that
  7. support wamreg setup.
  8. Author:
  9. Taylor Weiss ( TaylorW ) 08-Mar-1999
  10. Environment:
  11. User Mode - Win32
  12. Project:
  13. iis\svcs\wam\wamreg
  14. --*/
  15. #ifndef _WAMREG_EXPORT_H_
  16. #define _WAMREG_EXPORT_H_
  17. // 0 = log errors only
  18. // 1 = log errors and warnings
  19. // 2 = log errors, warnings and program flow type statemtns
  20. // 3 = log errors, warnings, program flow and basic trace activity
  21. // 4 = log errors, warnings, program flow, basic trace activity and trace to win32 api calls.
  22. #define LOG_TYPE_ERROR 0
  23. #define LOG_TYPE_WARN 1
  24. #define LOG_TYPE_PROGRAM_FLOW 2
  25. #define LOG_TYPE_TRACE 3
  26. #define LOG_TYPE_TRACE_WIN32_API 4
  27. typedef void (*IIS5LOG_FUNCTION)(int iLogType, WCHAR *pszfmt);
  28. #define CREATECATALOG_TRY_INTERVAL 200
  29. #define CREATECATALOG_MAX_WAIT 10000
  30. //
  31. // Local Declarations supporting setup.
  32. //
  33. extern IIS5LOG_FUNCTION g_pfnSetupWriteLog;
  34. //
  35. // Macros that collapse a debug and setup trace call. Note these will add code to
  36. // fre builds, the setup tracing is always on.
  37. //
  38. #if DBG
  39. #define SETUP_TRACE(args) \
  40. DBGINFO(args); \
  41. if ( g_pfnSetupWriteLog != NULL ) { \
  42. LogSetupTrace args ; \
  43. } else {}
  44. #define SETUP_TRACE_ERROR(args) \
  45. DBGINFO(args); \
  46. if ( g_pfnSetupWriteLog != NULL ) { \
  47. LogSetupTraceError args ; \
  48. } else {}
  49. #define SETUP_TRACE_ASSERT( exp ) \
  50. if ( !(exp) ) { \
  51. if ( g_pfnSetupWriteLog != NULL ) { \
  52. LogSetupTraceError( DBG_CONTEXT, "Assertion Failed: (%s)", #exp ); \
  53. } \
  54. PuDbgAssertFailed( DBG_CONTEXT, #exp, NULL ); \
  55. } else {}
  56. #else // No debug
  57. // Defining DBG_CONTEXT in fre build. Since the DBG macros do not
  58. // disappear, DBG_CONTEXT needs to be defined.
  59. #ifndef DBG_CONTEXT
  60. #define DBG_CONTEXT NULL, __FILE__, __LINE__, __FUNCTION__
  61. #endif
  62. #define SETUP_TRACE(args) \
  63. if ( g_pfnSetupWriteLog != NULL ) { \
  64. LogSetupTrace args ; \
  65. } else {}
  66. #define SETUP_TRACE_ERROR(args) \
  67. if ( g_pfnSetupWriteLog != NULL ) { \
  68. LogSetupTraceError args ; \
  69. } else {}
  70. #define SETUP_TRACE_ASSERT( exp ) \
  71. if ( !(exp) ) { \
  72. if ( g_pfnSetupWriteLog != NULL ) { \
  73. LogSetupTraceError( DBG_CONTEXT, "Assertion Failed: (%s)", #exp ); \
  74. } \
  75. } else {}
  76. #endif
  77. VOID
  78. LogSetupTrace(
  79. IN LPDEBUG_PRINTS pDebugPrints,
  80. IN const char * pszFilePath,
  81. IN int nLineNum,
  82. IN const char * pszFunction,
  83. IN const char * pszFormat,
  84. ...
  85. );
  86. VOID
  87. LogSetupTraceError(
  88. IN LPDEBUG_PRINTS pDebugPrints,
  89. IN const char * pszFilePath,
  90. IN int nLineNum,
  91. IN const char * pszFunction,
  92. IN const char * pszFormat,
  93. ...
  94. );
  95. #endif _WAMREG_EXPORT_H_