windows - Build and override a simple Winelib DLL -
i have windows executable load library , want create winelib dll overide windows dll. it's been 2 days search , try won't work ! please me !
basically create mydll.c , mydll.spec build winelib dll command:
winegcc -m32 -shared -o mydll.dll mydll.c mydll.spec
now have mydll.dll.so , want override mydll.dll (both @ same place) should ? try rename mydll.dll got page fault when function called ! tried configure override winecfg or set environment variables winedllpath. don't understand how proceed.
how load library in windows executable
hinstance dllhandle; char str[255]; typedef int(*tfp)(char * const); dllhandle = loadlibrary("mylib.dll"); tfp fp = (tfp)getprocaddress(dllhandle, "myfunc"); fp(str); freelibrary(dllhandle);
mydll.spec
@ stdcall myfunc(str)
mydll.c
#include <windef.h> int winapi myfunc(char * str) { strcpy(str, "myfunc winelib dll"); return 0; }
use winedebug=+module debug dll loading problems.
i don't belive wine searches native .dll.so files outside of single folder, wrong though. code in dlls/ntdll/loader.c if want check (grep load_builtin_dll).
Comments
Post a Comment