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.

142 lines
4.4 KiB

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