On Sat, Nov 8, 2008 at 10:40 AM, Peter Oberndorfer <span dir="ltr">&lt;<a href="mailto:kumbayo84@arcor.de">kumbayo84@arcor.de</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This page [1] seems to suggest memory returned from HeapAlloc<br>
is marked as not executable.<br>
Other tests (ntdll exception) are using VirtualAlloc()<br>
for dynamically created code.<br>
<br>
patch 1<br>
&gt; +/* The following x86 code string converts between the thiscall and stdcall<br>
&gt; + * calling convetions. &nbsp;The thiscall calling convention places the This<br>
&gt; + * pointer in ecx on the x86 platform, and the stdcall calling convention<br>
&gt; + * pushes the This pointer on the stack as the first argument.<br>
&gt; + *<br>
&gt; + * The wrapper&#39;s code finishes by jumping to the real function.<br>
&gt; + *<br>
&gt; + * Byte codes are used so that a copy of it can be modified to use<br>
&gt; + * for each method in ITextHost. */<br>
</blockquote><div><br>Thanks, I forgot to address that issue because I was too busy trying to get it to run correctly.&nbsp; I used HeapAlloc initially because I wasn&#39;t familiar with VirtualAlloc, so thanks for letting me know what to use.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
patch 2<br>
&gt; -/* The following x86 code string converts between the thiscall and stdcall<br>
&gt; +/* The following x86 code strings convert between the thiscall and stdcall<br>
&gt; &nbsp; * calling convetions. &nbsp;The thiscall calling convention places the This<br>
<br>
Here you introduce comments that you seem to change in the second patch.<br>
Maybe use the right text in the first patch?<br>
Additionally the term code string sounds odd.<br>
Maybe replace that with &quot;The following x86 assembler code...&quot;<br>
or something similar?<br>
</blockquote><div><br>All I changed in the comments between the patches was singular to plural word changes.&nbsp; Using the same comments for both patches would make the comment confusing if only one of the patches were accepted.<br>
<br>I could change code string, but probably to &quot;The following x86 byte code...&quot;, since it is just the comments that are assembly.&nbsp; <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
&gt; &nbsp;#define ITextServices_QueryInterface(p,a,b) (p)-&gt;lpVtbl-&gt;QueryInterface(p,a,b)<br>
&gt; &nbsp;#define ITextServices_AddRef(p) (p)-&gt;lpVtbl-&gt;AddRef(p)<br>
&gt; &nbsp;#define ITextServices_Release(p) (p)-&gt;lpVtbl-&gt;Release(p)<br>
&gt; -/*** ITextServices methods ***/<br>
&gt; -#define ITextServices_TxSendMessage(p,a,b,c,d) (p)-&gt;lpVtbl-&gt;TxSendMessage(p,a,b,c,d)<br>
&gt; -#define ITextServices_TxDraw(p,a,b,c,d,e,f,g,h,i,j,k,l) (p)-&gt;lpVtbl-&gt;TxDraw(p,a,b,c,d,e,f,g,h,i,j,k,l)<br>
<br>
Why do you only move some of those #defines part of ITextServices<br>
and not the one part of IUnknown ?<br>
I do not know much about those #defines but this seems odd<br>
</blockquote><div><br>The QueryInterface, AddRef, and Release methods were actually defined using the stdcall calling convention, so it doesn&#39;t have the same problems as the other methods which were defined using the C++ thiscall calling convention. <br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Maybe i am missing something but why do you need those thiscall wrappers?<br>
Wouldn&#39;t it be possible to use<br>
the DEFINE_THISCALL_WRAPPER and THISCALL macros like in txtserv.c?<br>
</blockquote><div><br>I can&#39;t use DEFINE_THISCALL_WRAPPER&nbsp; because it uses __ASM_GLOBAL_FUNC, __ASM_FUNC, and __ASM_NAME, which are defined in include/wine/port.h and include/config.h.&nbsp; These cannot be included in the tests since the tests must be compiled and crosscompiled with the same configuration (and include/config.h is generated by the configure script).&nbsp; Previously I tried to do it that way, but it wasn&#39;t commited I tried to define these macros in the test without making it portable enough to other compilers.<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Greetings Peter<br>
</blockquote></div><br>Thanks for all the helpful comments Peter!<br>