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.

187 lines
2.7 KiB

  1. #ifndef _UMDH_MISCELLANEOUS_H_
  2. #define _UMDH_MISCELLANEOUS_H_
  3. PVOID
  4. Xalloc (
  5. PCHAR File,
  6. ULONG Line,
  7. SIZE_T Size
  8. );
  9. VOID
  10. Xfree (
  11. PVOID Object
  12. );
  13. PVOID
  14. Xrealloc (
  15. PCHAR File,
  16. ULONG Line,
  17. PVOID Object,
  18. SIZE_T Size
  19. );
  20. #define XALLOC(sz) Xalloc(__FILE__, __LINE__, (sz))
  21. #define XREALLOC(ob, sz) Xrealloc(__FILE__, __LINE__, (ob), (sz))
  22. #define XFREE(ob) Xfree(ob);
  23. VOID
  24. ReportStatistics (
  25. );
  26. VOID
  27. Info (
  28. PCHAR Format,
  29. ...
  30. );
  31. VOID
  32. Comment (
  33. PCHAR Format,
  34. ...
  35. );
  36. VOID
  37. Warning (
  38. PCHAR File,
  39. ULONG Line,
  40. PCHAR Format,
  41. ...
  42. );
  43. VOID
  44. Debug (
  45. PCHAR File,
  46. ULONG Line,
  47. PCHAR Format,
  48. ...
  49. );
  50. VOID
  51. Error (
  52. PCHAR File,
  53. ULONG Line,
  54. PCHAR Format,
  55. ...
  56. );
  57. BOOL
  58. UmdhReadAtVa(
  59. IN PCHAR File,
  60. IN ULONG Line,
  61. IN HANDLE Process,
  62. IN PVOID Address,
  63. IN PVOID Data,
  64. IN SIZE_T Size
  65. );
  66. #define READVM(Addr, Buf, Sz) UmdhReadAtVa(__FILE__, __LINE__, (Globals.Target), (Addr), (Buf), (Sz))
  67. typedef struct _GLOBALS
  68. {
  69. SIZE_T MaximumHeapUsage;
  70. SIZE_T CurrentHeapUsage;
  71. ULONG InfoLevel;
  72. PCHAR Version;
  73. //
  74. // Verbose (debug) mode active?
  75. //
  76. BOOL Verbose;
  77. //
  78. // Load and print file and line number information?
  79. //
  80. BOOL LineInfo;
  81. //
  82. // Do we print just a raw dump of the trace database?
  83. //
  84. BOOL RawDump;
  85. USHORT RawIndex;
  86. //
  87. // File name for the binary dump of trace database
  88. //
  89. PCHAR DumpFileName;
  90. //
  91. // Output and error files.
  92. //
  93. FILE * OutFile;
  94. FILE * ErrorFile;
  95. //
  96. // Complain about unresolved symbols?
  97. //
  98. BOOL ComplainAboutUnresolvedSymbols;
  99. //
  100. // Handle of the process from which we are retrieving information.
  101. //
  102. HANDLE Target;
  103. BOOL TargetSuspended;
  104. //
  105. // Page heap was enabled for the process.
  106. //
  107. BOOL PageHeapActive;
  108. BOOL LightPageHeapActive;
  109. //
  110. // Address of the copy kept in umdh of the entire trace database
  111. // of the target process.
  112. //
  113. PVOID Database;
  114. //
  115. // Symbols heap (support for persistent allocations)
  116. //
  117. PCHAR SymbolsHeapBase;
  118. PCHAR SymbolsHeapLimit;
  119. PCHAR SymbolsHeapFree;
  120. //
  121. // Suspend the process while doing dump
  122. //
  123. BOOL Suspend;
  124. //
  125. // Display Heap Fragmentation Statistics
  126. //
  127. BOOL HeapStatistics;
  128. //
  129. // Enable Garbage Collection
  130. //
  131. BOOL GarbageCollection;
  132. } GLOBALS, * PGLOBALS;
  133. extern GLOBALS Globals;
  134. BOOL
  135. SetSymbolsPath (
  136. );
  137. #endif