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.

104 lines
3.3 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation
  3. Module Name:
  4. fusiondump.h
  5. Abstract:
  6. Merge/refactor stuff in sxstest with dumpers.cpp
  7. Eventually merge with debug extensions, let it be optionally
  8. driven by symbol info available to debug extensions via .pdbs.
  9. Author:
  10. Jay Krell (JayKrell) November 2001
  11. Revision History:
  12. --*/
  13. //
  14. // Probably we should treat everything as a sized integer, and leave the
  15. // indirection up to the caller. This code was not originally intended
  16. // to be symbol driven in a debugger extension, so we'll keep the "native"
  17. // features for now.
  18. //
  19. #define FUSIONP_DUMP_TYPE_ULONG 0x01
  20. #define FUSIONP_DUMP_TYPE_ULONG_OFFSET_TO_PCWSTR 0x02
  21. #define FUSIONP_DUMP_TYPE_LARGE_INTEGER_TIME 0x03
  22. #define FUSIONP_DUMP_OFFSET_BASE_0 0x00
  23. #define FUSIONP_DUMP_OFFSET_BASE_1 0x10
  24. #define FUSIONP_DUMP_OFFSET_BASE_2 0x20
  25. typedef struct _FUSIONP_DUMP_BUILTIN_SYMBOLS_FIELD
  26. {
  27. // more generally, these UCHARs should be ULONG or SIZE_T
  28. PCSTR Name;
  29. UCHAR NameLength;
  30. UCHAR Type;
  31. UCHAR Offset;
  32. UCHAR Size;
  33. } FUSIONP_DUMP_BUILTIN_SYMBOLS_FIELD, *PFUSIONP_DUMP_BUILTIN_SYMBOLS_FIELD;
  34. typedef const FUSIONP_DUMP_BUILTIN_SYMBOLS_FIELD * PCFUSIONP_DUMP_BUILTIN_SYMBOLS_FIELD;
  35. #define FUSIONP_DUMP_MAKE_FIELD(x, t) \
  36. { \
  37. #x, \
  38. static_cast<UCHAR>(sizeof(#x)-1), \
  39. FUSIONP_DUMP_TYPE_ ## t, \
  40. static_cast<UCHAR>(FIELD_OFFSET(FUSIONP_DUMP_CURRENT_STRUCT, x)), \
  41. static_cast<UCHAR>(RTL_FIELD_SIZE(FUSIONP_DUMP_CURRENT_STRUCT, x)) \
  42. },
  43. typedef struct _FUSIONP_DUMP_BUILTIN_SYMBOLS_STRUCT
  44. {
  45. // more generally, these UCHARs should be ULONG or SIZE_T
  46. PCSTR Name;
  47. UCHAR NameLength;
  48. UCHAR Size;
  49. UCHAR NumberOfFields;
  50. PCFUSIONP_DUMP_BUILTIN_SYMBOLS_FIELD Fields;
  51. } FUSIONP_DUMP_BUILTIN_SYMBOLS_STRUCT, *PFUSIONP_DUMP_BUILTIN_SYMBOLS_STRUCT;
  52. typedef const FUSIONP_DUMP_BUILTIN_SYMBOLS_STRUCT * PCFUSIONP_DUMP_BUILTIN_SYMBOLS_STRUCT;
  53. typedef int (__cdecl * PFN_FUSIONP_DUMP_PRINTF)(const char * Format, ...);
  54. typedef PCSTR (__stdcall * PFN_FUSIONP_DUMP_FORMATTIME)(LARGE_INTEGER);
  55. typedef struct _FUSIONP_DUMP_CALLBACKS {
  56. PFN_FUSIONP_DUMP_PRINTF Printf;
  57. PFN_FUSIONP_DUMP_FORMATTIME FormatTime;
  58. } FUSIONP_DUMP_CALLBACKS, *PFUSIONP_DUMP_CALLBACKS;
  59. typedef const FUSIONP_DUMP_CALLBACKS * PCFUSIONP_DUMP_CALLBACKS;
  60. BOOL
  61. FusionpDumpStruct(
  62. PCFUSIONP_DUMP_CALLBACKS Callbacks,
  63. PCFUSIONP_DUMP_BUILTIN_SYMBOLS_STRUCT BuiltinTypeInfo,
  64. ULONG64 StructBase,
  65. PCSTR StructFriendlyName, // should be more like "per line prefix"
  66. const ULONG64 * Bases // helps with position independent data, but is it sufficient?
  67. );
  68. #define FUSIONP_DUMP_NATIVE_DEREF(StructType, Struct, Field) ((ULONG64)(((StructType)(ULONG_PTR)Struct)->Field))
  69. ULONG64
  70. FusionpDumpSymbolDrivenDeref(
  71. PCSTR StructType,
  72. ULONG64 StructBase,
  73. PCSTR FieldName
  74. );
  75. #define FUSIONP_DUMP_SYMBOL_DRIVEN_DEREF(StructType, Struct, Field) \
  76. (FusionpDumpSymbolDrivenDeref(#StructType, static_cast<ULONG64>(reinterpret_cast<ULONG_PTR>(Struct)), #Field))
  77. //
  78. // initial test case migrated from sxstest
  79. //
  80. extern const FUSIONP_DUMP_BUILTIN_SYMBOLS_STRUCT StructInfo_ACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION;