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.

143 lines
2.9 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. #define INITGUID
  20. #include <dbgeng.h>
  21. #include <guiddef.h>
  22. #include <extsfns.h>
  23. #include <lmerr.h>
  24. #define NTDLL_APIS
  25. #include <dllimp.h>
  26. #include "analyze.h"
  27. #include "crdb.h"
  28. #include "bugcheck.h"
  29. #include "uexcep.h"
  30. #include "outcap.hpp"
  31. #include "triager.h"
  32. #include <cmnutil.hpp>
  33. // To get _open to work
  34. #include <crt\io.h>
  35. #include <fcntl.h>
  36. #include <sys\types.h>
  37. #include <sys\stat.h>
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. DWORD
  42. _EFN_GetTriageFollowupFromSymbol(
  43. IN PDEBUG_CLIENT Client,
  44. IN PSTR SymbolName,
  45. OUT PDEBUG_TRIAGE_FOLLOWUP_INFO OwnerInfo
  46. );
  47. HRESULT
  48. _EFN_GetFailureAnalysis(
  49. IN PDEBUG_CLIENT Client,
  50. IN ULONG Flags,
  51. OUT PDEBUG_FAILURE_ANALYSIS* Analysis
  52. );
  53. void
  54. wchr2ansi(
  55. PWCHAR wstr,
  56. PCHAR astr
  57. );
  58. void
  59. ansi2wchr(
  60. const PCHAR astr,
  61. PWCHAR wstr
  62. );
  63. //
  64. // undef the wdbgexts
  65. //
  66. #undef DECLARE_API
  67. #define DECLARE_API(extension) \
  68. CPPMOD HRESULT CALLBACK extension(PDEBUG_CLIENT Client, PCSTR args)
  69. #define INIT_API() \
  70. HRESULT Status; \
  71. if ((Status = ExtQuery(Client)) != S_OK) return Status;
  72. #define EXIT_API ExtRelease
  73. // Safe release and NULL.
  74. #define EXT_RELEASE(Unk) \
  75. ((Unk) != NULL ? ((Unk)->Release(), (Unk) = NULL) : NULL)
  76. // Global variables initialized by query.
  77. extern PDEBUG_ADVANCED g_ExtAdvanced;
  78. extern PDEBUG_CLIENT g_ExtClient;
  79. extern PDEBUG_DATA_SPACES3 g_ExtData;
  80. extern PDEBUG_REGISTERS g_ExtRegisters;
  81. extern PDEBUG_SYMBOLS2 g_ExtSymbols;
  82. extern PDEBUG_SYSTEM_OBJECTS3 g_ExtSystem;
  83. extern PDEBUG_CONTROL3 g_ExtControl;
  84. HRESULT
  85. ExtQuery(PDEBUG_CLIENT Client);
  86. void
  87. ExtRelease(void);
  88. // Error output.
  89. void __cdecl ExtErr(PCSTR Format, ...);
  90. HRESULT
  91. FillTargetDebugInfo(
  92. PDEBUG_CLIENT Client,
  93. PTARGET_DEBUG_INFO pTargetInfo
  94. );
  95. VOID
  96. DecodeErrorForMessage(
  97. PDEBUG_DECODE_ERROR pDecodeError
  98. );
  99. //-----------------------------------------------------------------------------------------
  100. //
  101. // api declaration macros & api access macros
  102. //
  103. //-----------------------------------------------------------------------------------------
  104. extern WINDBG_EXTENSION_APIS ExtensionApis;
  105. extern ULONG g_TargetMachine;
  106. extern ULONG g_TargetClass;
  107. extern ULONG g_TargetQualifier;
  108. extern ULONG g_TargetBuild;
  109. extern ULONG g_TargetPlatform;
  110. #ifdef __cplusplus
  111. }
  112. #endif