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.

139 lines
3.9 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. rdr2kd.h
  5. Abstract:
  6. Redirector Kernel Debugger extension
  7. Author:
  8. Balan Sethu Raman (SethuR) 11-May-1994
  9. Revision History:
  10. 11-Nov-1994 SethuR Created
  11. --*/
  12. #ifndef _KDEXTLIB_H_
  13. #define _KDEXTLIB_H_
  14. #include <windef.h>
  15. //
  16. // The help strings printed out
  17. //
  18. extern LPSTR Extensions[];
  19. //
  20. // The FIELD_DESCRIPTOR data structure is used to describe the field in a structure sufficiently
  21. // for displaying information during debugging. The three pieces of information that are required
  22. // are 1) the name of the field, 2) the offset in the corresponding structure and 3) a type descriptor.
  23. // The type descriptor covers most primitive types.
  24. //
  25. // The task of generating these descriptors by augmenting the front end, but that will have to
  26. // wait till we play around with these extensions and modify the data structures to meet most
  27. // of the requirements.
  28. //
  29. // There are some types that can benefit from some auxillary information in the descriptors. A
  30. // case in point is the "enum" defeinition. Merely printing out a numerical value for an enum
  31. // type will invariably force the person using these extensions to refer to the corresponding
  32. // include file. In order to avoid this we will accept an additional array for enum types that
  33. // contains a textual description of the numerical value.
  34. //
  35. // There are certain conventions that have been adopted to ease the definition of the macros
  36. // as well as facilitate the automation of the generation of these descriptors.
  37. // These are as follows ....
  38. //
  39. // 1) All ENUM_VALUE_DESCRIPTOR definitions are named EnumValueDescrsOf_ENUMTYPENAME, where
  40. // ENUMTYPENAME defines the corresponding enumerated type.
  41. //
  42. typedef struct _ENUM_VALUE_DESCRIPTOR {
  43. ULONG EnumValue;
  44. LPSTR EnumName;
  45. } ENUM_VALUE_DESCRIPTOR;
  46. typedef enum _FIELD_TYPE_CLASS {
  47. FieldTypeByte,
  48. FieldTypeChar,
  49. FieldTypeBoolean,
  50. FieldTypeBool,
  51. FieldTypeULong,
  52. FieldTypeLong,
  53. FieldTypeUShort,
  54. FieldTypeShort,
  55. FieldTypePointer,
  56. FieldTypeULongULong,
  57. FieldTypeListEntry,
  58. FieldTypeIpAddr,
  59. FieldTypeMacAddr,
  60. FieldTypeNBName,
  61. FieldTypeUnicodeString,
  62. FieldTypeAnsiString,
  63. FieldTypeSymbol,
  64. FieldTypeEnum,
  65. FieldTypeByteBitMask,
  66. FieldTypeWordBitMask,
  67. FieldTypeDWordBitMask,
  68. FieldTypeFloat,
  69. FieldTypeDouble,
  70. FieldTypeStruct,
  71. FieldTypeLargeInteger,
  72. FieldTypeFileTime
  73. } FIELD_TYPE_CLASS, *PFIELD_TYPE_CLASS;
  74. typedef struct _FIELD_DESCRIPTOR_ {
  75. FIELD_TYPE_CLASS FieldType; // The type of variable to be printed
  76. LPSTR Name; // The name of the field
  77. USHORT Offset; // The offset of the field in the structure
  78. union {
  79. ENUM_VALUE_DESCRIPTOR *pEnumValueDescriptor; // Auxillary information for enumerated types.
  80. } AuxillaryInfo;
  81. } FIELD_DESCRIPTOR;
  82. #define FIELD3(FieldType,StructureName, FieldName) \
  83. {FieldType, #FieldName , FIELD_OFFSET(StructureName,FieldName) ,NULL}
  84. #define FIELD4(FieldType, StructureName, FieldName, AuxInfo) \
  85. {FieldType, #FieldName , FIELD_OFFSET(StructureName,FieldName) ,AuxInfo}
  86. //
  87. // The structs that are displayed by the debugger extensions are further
  88. // described in another array. Each entry in the array contains the name of
  89. // the structure and the associated Field descriptor list.
  90. //
  91. typedef struct _STRUCT_DESCRITOR_ {
  92. LPSTR StructName;
  93. ULONG StructSize;
  94. FIELD_DESCRIPTOR *FieldDescriptors;
  95. } STRUCT_DESCRIPTOR;
  96. #define STRUCT(StructTypeName,FieldDescriptors) \
  97. { #StructTypeName,sizeof(StructTypeName),FieldDescriptors}
  98. //
  99. // The array of structs handled by the debugger extension.
  100. //
  101. extern STRUCT_DESCRIPTOR Structs[];
  102. //
  103. // Support for displaying global variables
  104. //
  105. extern LPSTR GlobalBool[];
  106. extern LPSTR GlobalShort[];
  107. extern LPSTR GlobalLong[];
  108. extern LPSTR GlobalPtrs[];
  109. #endif // _KDEXTLIB_H_
  110.