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.

110 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. reftrace.h
  5. Abstract:
  6. This module contains public declarations and definitions for tracing
  7. and debugging reference count problems. This module uses the generic
  8. TRACE_LOG facility in tracelog.h.
  9. Ref count trace logs can be dumped via the !inetdbg.ref command
  10. in either NTSD or CDB.
  11. Author:
  12. Keith Moore (keithmo) 01-May-1997
  13. Revision History:
  14. --*/
  15. #ifndef _REFTRACE_H_
  16. #define _REFTRACE_H_
  17. #if defined(__cplusplus)
  18. extern "C" {
  19. #endif // __cplusplus
  20. #include <tracelog.h>
  21. //
  22. // This is the number of stack backtrace values captured in each
  23. // trace log entry. This value is chosen to make the log entry
  24. // exactly twelve dwords long, making it a bit easier to interpret
  25. // from within the debugger without the debugger extension.
  26. //
  27. #define REF_TRACE_LOG_STACK_DEPTH 9
  28. // No-op value for the Context1,2,3 parameters of WriteRefTraceLogEx
  29. #define REF_TRACE_EMPTY_CONTEXT ((PVOID) -1)
  30. //
  31. // This defines the entry written to the trace log.
  32. //
  33. typedef struct _REF_TRACE_LOG_ENTRY {
  34. LONG NewRefCount;
  35. PVOID Context;
  36. PVOID Context1;
  37. PVOID Context2;
  38. PVOID Context3;
  39. DWORD Thread;
  40. PVOID Stack[REF_TRACE_LOG_STACK_DEPTH];
  41. } REF_TRACE_LOG_ENTRY, *PREF_TRACE_LOG_ENTRY;
  42. //
  43. // Manipulators.
  44. //
  45. PTRACE_LOG
  46. CreateRefTraceLog(
  47. IN LONG LogSize,
  48. IN LONG ExtraBytesInHeader
  49. );
  50. VOID
  51. DestroyRefTraceLog(
  52. IN PTRACE_LOG Log
  53. );
  54. LONG
  55. __cdecl
  56. WriteRefTraceLog(
  57. IN PTRACE_LOG Log,
  58. IN LONG NewRefCount,
  59. IN PVOID Context
  60. );
  61. LONG
  62. __cdecl
  63. WriteRefTraceLogEx(
  64. IN PTRACE_LOG Log,
  65. IN LONG NewRefCount,
  66. IN PVOID Context,
  67. IN PVOID Context1,
  68. IN PVOID Context2,
  69. IN PVOID Context3
  70. );
  71. #if defined(__cplusplus)
  72. } // extern "C"
  73. #endif // __cplusplus
  74. #endif // _REFTRACE_H_