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.

166 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 1993-1999 Microsoft Corporation
  3. Module Name:
  4. precomp.h
  5. Abstract:
  6. This header file is used to cause the correct machine/platform specific
  7. data structures to be used when compiling for a non-hosted platform.
  8. --*/
  9. // This is a 64 bit aware debugger extension
  10. #define KDEXT_64BIT
  11. #include <nt.h>
  12. #include <ntrtl.h>
  13. #include <nturtl.h>
  14. #include <windows.h>
  15. #include <wdbgexts.h>
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include <dbgeng.h>
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. //
  24. // undef the wdbgexts
  25. //
  26. #undef DECLARE_API
  27. #define DECLARE_API(extension) \
  28. CPPMOD HRESULT CALLBACK extension(PDEBUG_CLIENT Client, PCSTR args)
  29. #define INIT_API() \
  30. HRESULT Status; \
  31. if ((Status = ExtQuery(Client)) != S_OK) return Status;
  32. #define EXIT_API ExtRelease
  33. // Safe release and NULL.
  34. #define EXT_RELEASE(Unk) \
  35. ((Unk) != NULL ? ((Unk)->Release(), (Unk) = NULL) : NULL)
  36. // Global variables initialized by query.
  37. extern PDEBUG_ADVANCED g_ExtAdvanced;
  38. extern PDEBUG_CLIENT g_ExtClient;
  39. extern PDEBUG_CONTROL g_ExtControl;
  40. extern PDEBUG_DATA_SPACES g_ExtData;
  41. extern PDEBUG_REGISTERS g_ExtRegisters;
  42. extern PDEBUG_SYMBOLS2 g_ExtSymbols;
  43. extern PDEBUG_SYSTEM_OBJECTS g_ExtSystem;
  44. HRESULT
  45. ExtQuery(PDEBUG_CLIENT Client);
  46. void
  47. ExtRelease(void);
  48. #define PAGE_ALIGN64(Va) ((ULONG64)((Va) & ~((ULONG64) ((LONG64) (LONG) PageSize - 1))))
  49. extern ULONG PageSize;
  50. //-----------------------------------------------------------------------------------------
  51. //
  52. // api declaration macros & api access macros
  53. //
  54. //-----------------------------------------------------------------------------------------
  55. extern WINDBG_EXTENSION_APIS ExtensionApis;
  56. extern ULONG TargetMachine;
  57. extern ULONG g_TargetClass;
  58. //-----------------------------------------------------------------------------------------
  59. //
  60. // prototypes for internal non-exported support functions
  61. //
  62. //-----------------------------------------------------------------------------------------
  63. /////////////////////////////////////////////
  64. //
  65. // Util.c
  66. //
  67. /////////////////////////////////////////////
  68. typedef VOID
  69. (*PDUMP_SPLAY_NODE_FN)(
  70. ULONG64 RemoteAddress,
  71. ULONG Level
  72. );
  73. ULONG
  74. DumpSplayTree(
  75. IN ULONG64 pSplayLinks,
  76. IN PDUMP_SPLAY_NODE_FN DumpNodeFn
  77. );
  78. BOOLEAN
  79. DbgRtlIsRightChild(
  80. ULONG64 pLinks,
  81. ULONG64 Parent
  82. );
  83. BOOLEAN
  84. DbgRtlIsLeftChild(
  85. ULONG64 pLinks,
  86. ULONG64 Parent
  87. );
  88. ULONG
  89. GetBitFieldOffset (
  90. IN LPSTR Type,
  91. IN LPSTR Field,
  92. OUT PULONG pOffset,
  93. OUT PULONG pSize
  94. );
  95. ULONG64
  96. GetPointerFromAddress (
  97. ULONG64 Location
  98. );
  99. VOID
  100. DumpUnicode(
  101. UNICODE_STRING u
  102. );
  103. VOID
  104. DumpUnicode64(
  105. UNICODE_STRING64 u
  106. );
  107. ULONG64
  108. GetPointerValue (
  109. PCHAR String
  110. );
  111. BOOLEAN
  112. IsHexNumber(
  113. const char *szExpression
  114. );
  115. BOOLEAN
  116. IsDecNumber(
  117. const char *szExpression
  118. );
  119. VOID DumpImage(
  120. ULONG64 xBase,
  121. BOOL DoHeaders,
  122. BOOL DoSections
  123. );
  124. #ifdef __cplusplus
  125. }
  126. #endif