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.

58 lines
1.2 KiB

  1. /****************************************************************************/
  2. // trace.c
  3. //
  4. // Tracing code and definitions. See trace.h for other info.
  5. //
  6. // Copyright (C) 1999-2000 Microsoft Corporation
  7. /****************************************************************************/
  8. #if DBG || defined(_DEBUG)
  9. #include <windows.h>
  10. #include "trace.h"
  11. struct _ZoneInfo
  12. {
  13. UINT32 Zone;
  14. char *Prefix;
  15. } TRC_ZI[] =
  16. {
  17. { Z_ASSERT, "TSSDSQL: !!! ASSERT: " },
  18. { Z_ERR, "TSSDSQL: *** ERROR: " },
  19. { Z_WRN, "TSSDSQL: Warning: " },
  20. { Z_TRC1, "TSSDSQL: " },
  21. { Z_TRC2, "TSSDSQL: " },
  22. };
  23. int NumTRC_ZIEntries = sizeof(TRC_ZI) / sizeof(struct _ZoneInfo);
  24. // Globals.
  25. UINT32 g_TraceMask = 0xFFFFFFFF;
  26. char TB[1024];
  27. char TB2[1024];
  28. // Main output function.
  29. void TracePrintZ(UINT32 ZoneFlag, char *OutString)
  30. {
  31. int i;
  32. char *Prefix = "";
  33. // Find the zone information in the zone table.
  34. for (i = 0; i < NumTRC_ZIEntries; i++)
  35. if (TRC_ZI[i].Zone == ZoneFlag)
  36. Prefix = TRC_ZI[i].Prefix;
  37. // Now create the final string.
  38. wsprintfA(TB2, "%s%s\n", Prefix, OutString);
  39. // Send to output.
  40. OutputDebugStringA(TB2);
  41. }
  42. #endif // DBG