Build and override a simple winelib DLL

Matijn Woudt tijnema at gmail.com
Fri Apr 5 13:31:56 CDT 2013


On Fri, Apr 5, 2013 at 6:34 PM, Maxime Sednaoui <maximeseddev at gmail.com>wrote:

> Hi,
>
> First, I already asked for the same thing at the forum where  I've been
> told to post here for my question
> Link here : http://forum.winehq.org/viewtopic.php?f=8&t=18675
>
> 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 override the Windows DLL.
> Basically, I created mylib_main.c and mylib.spec to build the Winelib DLL
> with the command:
> winegcc -mwindows -o mylib.dll.so mylib_main.c -I${WINE_ROOT}/include
> -shared mylib.spec
> winebuild -w --def -o libmylib.def --export mylib.spec
>
> Now I have mylib.dll.so and I want to override mylib.dll
> What should I do ? I removed the Windows library but then 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 or add a DllMain
> in my library. I don't understand how to proceed.
>
> Is this because of the way I build my library ? Or maybe I forget a step
> to link it properly ?
>
>
Hi,

I'm not an expert on this, but anyway: the docs say:
"If you have problems then set the WINEDEBUG=+module environment variable
before running wine to see what is actually happening."

So I would suggest to try that first.
Second, it might be that your dll is loaded, but that it crashes inside?
Have you got a trace of the crash? Or have you ran winedbg/wine with gdb to
analyze the crash?

Regards,

Matijn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20130405/a16fd90d/attachment.html>


More information about the wine-devel mailing list