<div dir="ltr">Hi Zebediah,<div><br></div><div>Thanks for the feedback.</div><div><br></div><div>Not sure how to quote in Gmail but I'll add > for each line I reply to.</div><div><br></div><div>>This debug channel is unused, and should generate a warning.</div><div><br></div><div>I can remove it but I plan on adding stub functions to the dll. CurrentIP is the first function the Microsoft Media Creation tool calls upon, ConstructPartialMsgVW after. Not sure how many others it will try to call. Based on your method, I think ConstructPartialMsgVW takes 3 arguments, but I checked it a few weeks ago so I don't remember if this is the exact number.</div><div><br></div><div>In any case, the debug channel would be used for those arguments. While we're on this subject, is there a method to determine the function return type, argument types and possibly names? I see DWORD and sometimes void is used for undocumented functions, would this be appropriate?</div><div><br></div><div>>No reason to make this a separate function; you can use</div>__ASM_STDCALL_FUNC() to declare it.<div><br></div><div>Thanks, is this correct so far?</div><div><br></div><div>__ASM_STDCALL_FUNC(CurrentIP, 0,<br>    "mov 0(%esp), %eax\n\t"<br>    "ret\n\t" )<br></div><div><br></div><div>>Please try to avoid whitespace errors.</div><div><br></div><div>I see a lot of files have a newline at the end, I'm assuming a newline avoids whitespace errors?</div><div><br></div><div>>Giovanni points out that this also won't compile on anything other than</div>i386. You'll need to use #ifdef guards to handle separate architectures.<div><br></div><div>I see, I'm not really sure what to do for the other architectures or which ones are appropriate in this context. I'm not familiar with arm assembly. I looked at the assembly code in kernelbase/thread.c for reference and this is what I have so far:</div><div><br></div><div>#ifdef __i386__<br>__ASM_STDCALL_FUNC(CurrentIP, 0,<br>    "movl 0(%esp), %eax\n\t"<br>    "ret" )<br>#elif defined(__x86_64__)<br>__ASM_STDCALL_FUNC(CurrentIP, 0,<br>    "movq 0(%rsp), %rax\n\t"<br>    "ret" )<br>#elif defined(__arm__)<br>__ASM_STDCALL_FUNC(CurrentIP, 0,<br>    "mov r13, r0\n\t"<br>    "ret" )<br>#elif defined(__aarch64__)<br>__ASM_STDCALL_FUNC(CurrentIP, 0,<br>    "mov sp, x0\n\t"<br>    "ret" )<br>#else<br>int WINAPI CurrentIP()<br>{<br>    FIXME( "not implemented\n" );<br>    return 0;<br>}<br>#endif<br></div><div><br></div><div>Is this a good start? What parts are incorrect?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 12, 2022 at 11:14 AM Zebediah Figura (she/her) <<a href="mailto:zfigura@codeweavers.com">zfigura@codeweavers.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 1/12/22 10:00, Zebediah Figura (she/her) wrote:<br>
> Hello Mohammed, thanks for the patch! I have a few comments inlined below.<br>
> <br>
> On 1/12/22 05:03, Mohamad Al-Jaf wrote:<br>
>> +#include <stdarg.h><br>
>> +#include <stdint.h><br>
>> +<br>
>> +#include "windef.h"<br>
>> +#include "winbase.h"<br>
>> +<br>
>> +#include "wine/asm.h"<br>
>> +#include "wine/debug.h"<br>
>> +<br>
>> +WINE_DEFAULT_DEBUG_CHANNEL(wdscore);<br>
> <br>
> This debug channel is unused, and should generate a warning.<br>
> <br>
>> +<br>
>> +uint32_t get_ip();<br>
>> +__ASM_GLOBAL_FUNC( get_ip,<br>
>> +    "mov 0(%esp), %eax\n\t"<br>
>> +    "ret\n\t" )<br>
> <br>
> No reason to make this a separate function; you can use <br>
> __ASM_STDCALL_FUNC() to declare it.<br>
<br>
Giovanni points out that this also won't compile on anything other than <br>
i386. You'll need to use #ifdef guards to handle separate architectures.<br>
<br>
> <br>
>> +<br>
>> +<br>
>> +/***********************************************************************<br>
>> + *           CurrentIP (wdscore.@)<br>
>> + */<br>
>> +int WINAPI CurrentIP()<br>
>> +{<br>
>> +    uint32_t ip;<br>
>> +<br>
>> +    ip = get_ip();<br>
>> +    return ip;<br>
>> +}<br>
>> \ No newline at end of file<br>
> <br>
> Please try to avoid whitespace errors.<br>
> <br>
<br>
</blockquote></div>