Author Topic: support for __thiscall  (Read 840 times)

TimoVJL

  • Member
  • ***
  • Posts: 488
support for __thiscall
« on: November 03, 2018, 02:24:50 AM »
M$ use _thiscall in richedit ITextHost with 32-bit.
Is it possible to support that too ?

In x86 in some level, it's possible to fake M$ __thiscall using __fastcall, but that needs fake headers too.
I already test it with C.
May the source be with you

johnsa

  • Member
  • ****
  • Posts: 796
    • Uasm
Re: support for __thiscall
« Reply #1 on: November 03, 2018, 04:51:50 AM »
Hi,

Yes it would be possible to implement, but it's quite a big job.

It might be easier to approach it temporarily as one would for COM, as it's a C++ specific convention.

So create a custom INVOKE macro and pass the this ptr in ecx before using a regular invoke with the balance of the arguments which are pushed right to left as per regular stdcall.