[PATCH] wdscore: Implement CurrentIP.

Zebediah Figura zfigura at codeweavers.com
Fri Jan 14 10:46:56 CST 2022


On 1/13/22 23:31, Mohamad Al-Jaf wrote:
>> Adding the debug channel declaration should be deferred until the first
>> patch that uses it.
> 
> I was going to remove it but since the #ifdef guards ends with an unknown
> architecture, it would require the debug channel to display the fixme
> message, no?

Yes, in that case it would belong in this patch.

>> Is there any indication this function should be doing something like
>> this at all?
> 
> I'm testing it out in Windows to get a sense of what it does. Here's my
> code in C++, let me know if it's incorrect:
> 
>      typedef int (*CurrentIP)();
>      HMODULE hDLL = LoadLibraryA("wdscore.dll");
>      CurrentIP ip = (CurrentIP)GetProcAddress(hDLL, "CurrentIP");
>      std::cout << "CurrentIP() = " << ip() << "\n";
>      FreeLibrary(hDLL);
> 
> It returns random numbers, e.g. 10424371, 1249331, 6033459. So doesn't this
> mean it's returning the instruction pointer?
> 
> If so, I don't know how to write a conformance test for it. Would it be
> necessary in this case?

You could probably write a conformance test by manually emitting 
assembly, e.g. on i386 something like

     call CurrentIP
1:  cmp %eax, $1b
     sete %al
     ret

That's a bit of work, though, and it's not clear to me that it's worthwhile.



More information about the wine-devel mailing list