On Sat, Nov 8, 2008 at 10:40 AM, Peter Oberndorfer <kumbayo84@arcor.de> wrote:
This page [1] seems to suggest memory returned from HeapAlloc
is marked as not executable.
Other tests (ntdll exception) are using VirtualAlloc()
for dynamically created code.
patch 1
> +/* The following x86 code string converts between the thiscall and stdcall
> + * calling convetions. The thiscall calling convention places the This
> + * pointer in ecx on the x86 platform, and the stdcall calling convention
> + * pushes the This pointer on the stack as the first argument.
> + *
> + * The wrapper's code finishes by jumping to the real function.
> + *
> + * Byte codes are used so that a copy of it can be modified to use
> + * for each method in ITextHost. */
patch 2
> -/* The following x86 code string converts between the thiscall and stdcall
> +/* The following x86 code strings convert between the thiscall and stdcall
> * calling convetions. The thiscall calling convention places the This
Here you introduce comments that you seem to change in the second patch.
Maybe use the right text in the first patch?
Additionally the term code string sounds odd.
Maybe replace that with "The following x86 assembler code..."
or something similar?
> #define ITextServices_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
> #define ITextServices_AddRef(p) (p)->lpVtbl->AddRef(p)
> #define ITextServices_Release(p) (p)->lpVtbl->Release(p)
> -/*** ITextServices methods ***/
> -#define ITextServices_TxSendMessage(p,a,b,c,d) (p)->lpVtbl->TxSendMessage(p,a,b,c,d)
> -#define ITextServices_TxDraw(p,a,b,c,d,e,f,g,h,i,j,k,l) (p)->lpVtbl->TxDraw(p,a,b,c,d,e,f,g,h,i,j,k,l)
Why do you only move some of those #defines part of ITextServices
and not the one part of IUnknown ?
I do not know much about those #defines but this seems odd
Maybe i am missing something but why do you need those thiscall wrappers?
Wouldn't it be possible to use
the DEFINE_THISCALL_WRAPPER and THISCALL macros like in txtserv.c?
Greetings Peter