function IsValidObject(const Obj: TObject): Boolean; begin try Result := PInteger(Integer(Obj.ClassType)+vmtSelfPtr)^ = Integer(Obj.ClassType); except Result := False; end; end;