Source code of Windows XP (NT5)
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.

65 lines
2.0 KiB

  1. /* ----------------------------------------------------------------------
  2. Copyright (c) 1995-1996, Microsoft Corporation
  3. All rights reserved
  4. siGlobal.h
  5. ---------------------------------------------------------------------- */
  6. #ifndef GLOBAL_H
  7. #define GLOBAL_H
  8. //-------------------------------------------------------
  9. // Useful macros
  10. #define ARRAY_ELEMENTS(rg) (sizeof(rg) / sizeof((rg)[0]))
  11. #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
  12. //-------------------------------------------------------
  13. // Function Prototypes
  14. #ifdef DEBUG /* These are only avaible for debug */
  15. VOID InitDebug(void);
  16. VOID DeInitDebug(void);
  17. #endif /* DEBUG */
  18. #ifdef DEBUG
  19. extern HDBGZONE ghZoneApi;
  20. #define ZONE_API_WARN_FLAG 0x01
  21. #define ZONE_API_EVENT_FLAG 0x02
  22. #define ZONE_API_TRACE_FLAG 0x04
  23. #define ZONE_API_DATA_FLAG 0x08
  24. #define ZONE_API_OBJ_FLAG 0x10
  25. #define ZONE_API_REF_FLAG 0x20
  26. UINT DbgApiWarn(PCSTR pszFormat,...);
  27. UINT DbgApiEvent(PCSTR pszFormat,...);
  28. UINT DbgApiTrace(PCSTR pszFormat,...);
  29. UINT DbgApiData(PCSTR pszFormat,...);
  30. #define DBGAPI_WARN (!IS_ZONE_ENABLED(ghZoneApi, ZONE_API_WARN_FLAG)) ? 0 : DbgApiWarn
  31. #define DBGAPI_EVENT (!IS_ZONE_ENABLED(ghZoneApi, ZONE_API_EVENT_FLAG)) ? 0 : DbgApiEvent
  32. #define DBGAPI_TRACE (!IS_ZONE_ENABLED(ghZoneApi, ZONE_API_TRACE_FLAG)) ? 0 : DbgApiTrace
  33. #define DBGAPI_DATA (!IS_ZONE_ENABLED(ghZoneApi, ZONE_API_DATA_FLAG)) ? 0 : DbgApiData
  34. #define DBGAPI_REF (!IS_ZONE_ENABLED(ghZoneApi, ZONE_API_REF_FLAG)) ? 0 : DbgApiTrace
  35. #define DBGAPI_OBJ (!IS_ZONE_ENABLED(ghZoneApi, ZONE_API_OBJ_FLAG)) ? 0 : DbgApiTrace
  36. #else
  37. inline void WINAPI DbgMsgApi(LPCTSTR, ...) { }
  38. #define DBGAPI_WARN 1 ? (void)0 : ::DbgMsgApi
  39. #define DBGAPI_EVENT 1 ? (void)0 : ::DbgMsgApi
  40. #define DBGAPI_TRACE 1 ? (void)0 : ::DbgMsgApi
  41. #define DBGAPI_DATA 1 ? (void)0 : ::DbgMsgApi
  42. #define DBGAPI_REF 1 ? (void)0 : ::DbgMsgApi
  43. #define DBGAPI_OBJ 1 ? (void)0 : ::DbgMsgApi
  44. #endif
  45. /////////////////////////////////
  46. // Global Variables
  47. extern HINSTANCE g_hInst;
  48. #endif /* GLOBAL_H */