3
votes

For the time being, Delphi XE is only available on my box, I don't know wether Delphi 2010/XE2 has introduced some breaking changes.

Please help me to update the following definition:

TVmt = packed record
    SelfPtr           : TClass;
    IntfTable         : Pointer;
    AutoTable         : Pointer;
    InitTable         : PFieldTable;
    TypeInfo          : PTypeInfo;
    FieldTable        : Pointer;
    MethodTable       : Pointer;
    DynamicTable      : Pointer;
    ClassName         : PShortString;
    InstanceSize      : Cardinal;
    Parent            : PClass;
    {$IFDEF DELPHI2009_UP}
    Equals            : Pointer;
    GetHashCode       : Pointer;
    ToString          : Pointer;
    {$ENDIF}
    {$IFDEF DELPHIXE_UP}
    // ???
    {$ENDIF}
    {$IFDEF DELPHIXE2_UP}
    // ???
    {$ENDIF}
    SafeCallException : PSafeCallException;
    AfterConstruction : PAfterConstruction;
    BeforeDestruction : PBeforeDestruction;
    Dispatch          : PDispatch;
    DefaultHandler    : PDefaultHandler;
    NewInstance       : PNewInstance;
    FreeInstance      : PFreeInstance;
    Destroy           : PDestroy;
    {UserDefinedVirtuals: array of procedure;}
  end;

Thanks in advance.


The information I need can be grabed from the unit system.pas. While I check it as Delphi XE version, I discover also that the VMT depend on the CPU (Blame it on me, it obvious / search for the {$IF defined(CPUX64)} directive for further details).

I'm interested in 32 bits Windows platform.

1
See Internal_Data_Formats. Doesn't look as there are any changes.LU RD
@LU RD: Pointer slots of Equals/GetHashCode/ToString are not present. They should be located between the pointer to a pointer to ancestor class <=> Parent (offset -36) and pointer to entry point of SafecallException method <=> SafeCallException (offset -34). It seems that it rather describes a Delphi 2007 VMT.menjaraz
Yes, I see that now. Documentation is not always up to date, but programmers have to be :)LU RD
@LU RD: You are right, that's also why I ask for help. Thank you for removing my doubt.menjaraz

1 Answers

3
votes

A quick review of XE2's System.pas doesn't show any differences in the ordering and content of the VMT. There's an {$IFDEF CPUX64} for different offsets for the vmt* values, but the order and types seem to be the same. There's definitely nothing new in the areas you have marked with ???