I have a Windows executable that load a really simple DLL (it is a test) and I want to create a Winelib DLL that will overide the Windows DLL. It's been 2 days that I search and try but it won't work ! Please help me !
Basically I create mydll.c and mydll.spec to build the Winelib DLL with the command:
Code: Select all
winegcc -m32 -shared -o mydll.dll mydll.c mydll.spec
What should I do ? I try to rename mydll.dll but I got a Page Fault when the function is called ! I also tried to configure the override with winecfg or set environment variables like WINEDLLPATH. I don't understand how to proceed.
----------------------------------------
How I load the library in my Windows executable
Code: Select all
HINSTANCE DllHandle;
char str[255];
typedef int(*tfp)(char * const);
DllHandle = LoadLibrary("mylib.dll");
tfp fp = (tfp)GetProcAddress(DllHandle, "myfunc");
fp(str);
FreeLibrary(DllHandle);
Code: Select all
@ stdcall myfunc(str)
Code: Select all
#include <windef.h>
int WINAPI myfunc(char * str)
{
strcpy(str, "myfunc from the Winelib DLL");
return 0;
}