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.

138 lines
4.3 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 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. FieldTypeByte,
  44. FieldTypeChar,
  45. FieldTypeBoolean,
  46. FieldTypeBool,
  47. FieldTypeULong,
  48. FieldTypeULongUnaligned,
  49. FieldTypeULongFlags,
  50. FieldTypeLong,
  51. FieldTypeLongUnaligned,
  52. FieldTypeUShort,
  53. FieldTypeUShortUnaligned,
  54. FieldTypeUShortFlags,
  55. FieldTypeShort,
  56. FieldTypePointer,
  57. FieldTypeUnicodeString,
  58. FieldTypeAnsiString,
  59. FieldTypeSymbol,
  60. FieldTypeEnum,
  61. FieldTypeByteBitMask,
  62. FieldTypeWordBitMask,
  63. FieldTypeDWordBitMask,
  64. FieldTypeFloat,
  65. FieldTypeDouble,
  66. FieldTypeStruct,
  67. FieldTypeLargeInteger,
  68. FieldTypeFileTime
  69. } FIELD_TYPE_CLASS, *PFIELD_TYPE_CLASS;
  70. typedef struct _FIELD_DESCRIPTOR_ {
  71. FIELD_TYPE_CLASS FieldType; // The type of variable to be printed
  72. LPSTR Name; // The name of the field
  73. //USHORT Offset; // The offset of the field in the structure
  74. LONG Offset; // The offset of the field in the structure
  75. union {
  76. ENUM_VALUE_DESCRIPTOR *pEnumValueDescriptor; // Auxillary information for enumerated types.
  77. } AuxillaryInfo;
  78. } FIELD_DESCRIPTOR;
  79. #define FIELD3(FieldType,StructureName, FieldName) \
  80. {FieldType, #FieldName , FIELD_OFFSET(StructureName,FieldName) ,NULL}
  81. #define FIELD4(FieldType, StructureName, FieldName, AuxInfo) \
  82. {FieldType, #FieldName , FIELD_OFFSET(StructureName,FieldName) ,AuxInfo}
  83. //
  84. // The structs that are displayed by the debugger extensions are further
  85. // described in another array. Each entry in the array contains the name of
  86. // the structure and the associated Field descriptor list.
  87. //
  88. typedef struct _STRUCT_DESCRIPTOR_ {
  89. LPSTR StructName;
  90. ULONG StructSize;
  91. ULONG EnumManifest;
  92. FIELD_DESCRIPTOR *FieldDescriptors;
  93. USHORT MatchMask;
  94. USHORT MatchValue;
  95. } STRUCT_DESCRIPTOR;
  96. #define STRUCT(StructTypeName,FieldDescriptors,MatchMask,MatchValue) \
  97. { #StructTypeName,sizeof(StructTypeName), \
  98. StrEnum_##StructTypeName, \
  99. FieldDescriptors,MatchMask,MatchValue}
  100. //
  101. // The array of structs handled by the debugger extension.
  102. //
  103. extern STRUCT_DESCRIPTOR Structs[];
  104. //
  105. // Support for displaying global variables
  106. //
  107. extern LPSTR GlobalBool[];
  108. extern LPSTR GlobalShort[];
  109. extern LPSTR GlobalLong[];
  110. extern LPSTR GlobalPtrs[];
  111. #endif // _KDEXTLIB_H_
  112.