Code: Select all
/* wov.c */
#include <wtypes.h>
WINUSERAPI BOOL WINAPI GetCursorPos(LPPOINT p)
{
if(p) {
p->x = 100;
p->y = 100;
}
return TRUE;
}
So I took a more aggressive approach and built wine from source, 32 and 64 bit versions, with the original GetCursorPos edited to do the same trick, return always the (100,100) point. I symlinked the resulting .so files to /usr/lib32/wov2.so and /usr/lib/wov2.so, just to check that LD_PRELOAD wasn't being thrown away .And indeed this worked, but it's far from ideal, I looked into the Makefiles and changed my custom library's compilation flags, but I can't get it to work.
So my question is, what's the best way to, with portability in mind, override a single function from a built-in .so like user32, and where's the difference that makes LD_PRELOAD take wov2.so into account but not wov.so?