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.

150 lines
4.6 KiB

  1. //
  2. // _RTTIBaseClassDescriptor
  3. //
  4. // TypeDescriptor is declared in ehdata.h
  5. //
  6. #if defined(_M_IA64) || defined(VERSP_P7) /*IFSTRIP=IGN*/
  7. #pragma pack(push, rttidata, 4)
  8. #endif
  9. #ifndef WANT_NO_TYPES
  10. typedef const struct _s_RTTIBaseClassDescriptor {
  11. #if defined(_M_IA64) && !defined(VERSP_P7)
  12. __int32 pTypeDescriptor; // Image relative offset of TypeDescriptor
  13. #else
  14. TypeDescriptor *pTypeDescriptor;
  15. #endif
  16. DWORD numContainedBases;
  17. PMD where;
  18. DWORD attributes;
  19. } _RTTIBaseClassDescriptor;
  20. #endif // WANT_NO_TYPES
  21. #define BCD_NOTVISIBLE 0x00000001
  22. #define BCD_AMBIGUOUS 0x00000002
  23. #define BCD_PRIVORPROTINCOMPOBJ 0x00000004
  24. #define BCD_PRIVORPROTBASE 0x00000008
  25. #define BCD_VBOFCONTOBJ 0x00000010
  26. #define BCD_NONPOLYMORPHIC 0x00000020
  27. #define BCD_PTD(bcd) ((bcd).pTypeDescriptor)
  28. #define BCD_NUMCONTBASES(bcd) ((bcd).numContainedBases)
  29. #define BCD_WHERE(bcd) ((bcd).where)
  30. #define BCD_ATTRIBUTES(bcd) ((bcd).attributes)
  31. #if defined(_M_IA64)
  32. #define BCD_PTD_IB(bcd,ib) ((TypeDescriptor*)((ib) + (bcd).pTypeDescriptor))
  33. #endif
  34. //
  35. // _RTTIBaseClassArray
  36. //
  37. #pragma warning(disable:4200) // get rid of obnoxious nonstandard extension warning
  38. #ifndef WANT_NO_TYPES
  39. typedef const struct _s_RTTIBaseClassArray {
  40. #if defined(_M_IA64) && !defined(VERSP_P7)
  41. __int32 arrayOfBaseClassDescriptors[]; // Image relative offset of _RTTIBaseClassDescriptor
  42. #else
  43. _RTTIBaseClassDescriptor *arrayOfBaseClassDescriptors[];
  44. #endif
  45. } _RTTIBaseClassArray;
  46. #endif // WANT_NO_TYPES
  47. #pragma warning(default:4200)
  48. //
  49. // _RTTIClassHierarchyDescriptor
  50. //
  51. #ifndef WANT_NO_TYPES
  52. typedef const struct _s_RTTIClassHierarchyDescriptor {
  53. DWORD signature;
  54. DWORD attributes;
  55. DWORD numBaseClasses;
  56. #if defined(_M_IA64) && !defined(VERSP_P7)
  57. __int32 pBaseClassArray; // Image relative offset of _RTTIBaseClassArray
  58. #else
  59. _RTTIBaseClassArray *pBaseClassArray;
  60. #endif
  61. } _RTTIClassHierarchyDescriptor;
  62. #endif // WANT_NO_TYPES
  63. #define CHD_MULTINH 0x00000001
  64. #define CHD_VIRTINH 0x00000002
  65. #define CHD_AMBIGUOUS 0x00000004
  66. #define CHD_SIGNATURE(chd) ((chd).signature)
  67. #define CHD_ATTRIBUTES(chd) ((chd).attributes)
  68. #define CHD_NUMBASES(chd) ((chd).numBaseClasses)
  69. #define CHD_PBCA(chd) ((chd).pBaseClassArray)
  70. #define CHD_PBCD(bcd) (bcd)
  71. #if defined(_M_IA64)
  72. #define CHD_PBCA_IB(chd,ib) ((_RTTIBaseClassArray*)((ib) + (chd).pBaseClassArray))
  73. #define CHD_PBCD_IB(bcd,ib) ((_RTTIBaseClassDescriptor*)((ib) + bcd))
  74. #endif
  75. //
  76. // _RTTICompleteObjectLocator
  77. //
  78. #ifndef WANT_NO_TYPES
  79. typedef const struct _s_RTTICompleteObjectLocator {
  80. DWORD signature;
  81. DWORD offset;
  82. DWORD cdOffset;
  83. #if defined(_M_IA64) && !defined(VERSP_P7)
  84. __int32 pTypeDescriptor; // Image relative offset of TypeDescriptor
  85. __int32 pClassDescriptor; // Image relative offset of _RTTIClassHierarchyDescriptor
  86. #else
  87. TypeDescriptor *pTypeDescriptor;
  88. _RTTIClassHierarchyDescriptor *pClassDescriptor;
  89. #endif
  90. } _RTTICompleteObjectLocator;
  91. #endif // WANT_NO_TYPES
  92. #define COL_SIGNATURE(col) ((col).signature)
  93. #define COL_OFFSET(col) ((col).offset)
  94. #define COL_CDOFFSET(col) ((col).cdOffset)
  95. #define COL_PTD(col) ((col).pTypeDescriptor)
  96. #define COL_PCHD(col) ((col).pClassDescriptor)
  97. #if defined(_M_IA64)
  98. #define COL_PTD_IB(col,ib) ((TypeDescriptor*)((ib) + (col).pTypeDescriptor))
  99. #define COL_PCHD_IB(col,ib) ((_RTTIClassHierarchyDescriptor*)((ib) + (col).pClassDescriptor))
  100. #endif
  101. #ifdef BUILDING_TYPESRC_C
  102. //
  103. // Type of the result of __RTtypeid and internal applications of typeid().
  104. // This also introduces the tag "type_info" as an incomplete type.
  105. //
  106. typedef const class type_info &__RTtypeidReturnType;
  107. //
  108. // Declaration of CRT entrypoints, as seen by the compiler. Types are
  109. // simplified so as to avoid type matching hassles.
  110. //
  111. #ifndef THROWSPEC
  112. #if _MSC_VER >= 1300
  113. #define THROWSPEC(_ex) throw _ex
  114. #else
  115. #define THROWSPEC(_ex)
  116. #endif
  117. #endif
  118. // Perform a dynamic_cast on obj. of polymorphic type
  119. extern "C" PVOID __cdecl __RTDynamicCast (
  120. PVOID, // ptr to vfptr
  121. LONG, // offset of vftable
  122. PVOID, // src type
  123. PVOID, // target type
  124. BOOL) THROWSPEC((...)); // isReference
  125. // Perform 'typeid' on obj. of polymorphic type
  126. extern "C" PVOID __cdecl __RTtypeid (PVOID) THROWSPEC((...)); // ptr to vfptr
  127. // Perform a dynamic_cast from obj. of polymorphic type to void*
  128. extern "C" PVOID __cdecl __RTCastToVoid (PVOID) THROWSPEC((...)); // ptr to vfptr
  129. #endif
  130. #if defined(_M_IA64) || defined(VERSP_P7) /*IFSTRIP=IGN*/
  131. #pragma pack(pop, rttidata)
  132. #endif