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.

92 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 2001-2002 Microsoft Corporation
  3. Module Name:
  4. strlog.h
  5. Abstract:
  6. A tracelog for variable-length strings. Strings are written to
  7. an in-memory circular buffer, instead of the debug output port.
  8. The buffer can be dumped with !ulkd.strlog.
  9. DbgPrint is verrry slooow and radically affects timing, especially
  10. on a multiprocessor system. Also, with this approach, you can
  11. have multiple string logs, instead of having all the output
  12. mixed up.
  13. Author:
  14. George V. Reilly Jul-2001
  15. Revision History:
  16. --*/
  17. #ifndef _STRLOG_H_
  18. #define _STRLOG_H_
  19. //
  20. // Manipulators.
  21. //
  22. typedef struct _STRING_LOG *PSTRING_LOG;
  23. PSTRING_LOG
  24. CreateStringLog(
  25. IN ULONG LogSize,
  26. IN ULONG ExtraBytesInHeader,
  27. BOOLEAN EchoDbgPrint
  28. );
  29. VOID
  30. DestroyStringLog(
  31. IN PSTRING_LOG pLog
  32. );
  33. LONGLONG
  34. __cdecl
  35. WriteStringLog(
  36. IN PSTRING_LOG pLog,
  37. IN PCH Format,
  38. ...
  39. );
  40. LONGLONG
  41. __cdecl
  42. WriteGlobalStringLog(
  43. IN PCH Format,
  44. ...
  45. );
  46. VOID
  47. ResetStringLog(
  48. IN PSTRING_LOG pLog
  49. );
  50. #if TRACE_TO_STRING_LOG
  51. #define CREATE_STRING_LOG( ptr, size, extra, dbgprint ) \
  52. (ptr) = CreateStringLog( (size), (extra), (dbgprint) )
  53. #define DESTROY_STRING_LOG( ptr ) \
  54. do \
  55. { \
  56. DestroyStringLog( ptr ); \
  57. (ptr) = NULL; \
  58. } while (FALSE, FALSE)
  59. #else // !TRACE_TO_STRING_LOG
  60. #define CREATE_STRING_LOG( ptr, size, extra, dbgprint ) NOP_FUNCTION
  61. #define DESTROY_STRING_LOG( ptr ) NOP_FUNCTION
  62. #endif // !TRACE_TO_STRING_LOG
  63. #endif // _STRLOG_H_