Linking wine * libraries with Linux applications ?!

Alexander Efremov vilgus at
Fri Oct 21 06:03:39 CDT 2005

Hello Troy,

Thursday, October 20, 2005, 10:49:18 PM, you wrote:

> OK, then you will need to use the longjmp method.
I do not know what is "longjmp" method :-(

> You should have an arrangement that looks something like this:

>         1. Your DLL that wants to call the Win32 API links to a ""
>             with an entry point "start_wine_lib_for_dll".
          I do not have a DLL which wants to use the Win32 APIs. I have a
          Linux dynamic library (*.so) which wants to use the Win32

>         2. "" is a winelib app.
>             "start_wine_lib_for_dll" would contain
>             a "setjmp" followed by a call to wine_init, passing a dummied up argv
>             that tells wine to start "".
              What is "setjmp" - an assembler directive ? Is
              <> a standard WineLib application or I have
              to create it myself ?

>         3. WinMain in "" does a longjmp back to
>             "start_wine_lib_for_dll"
          :-( What is "longjmp" exactly and how it should look like ?
          Unfortunatelly I'm not familiar with the assembler too much, and
          I know little about Wine :-(

>         3.1 Before calling Win32 entry points (other than those in the Win32 kernel) you
>             will need to call LoadLibrary on the library they are in. This will ensure
>             that Wine has initialised anything in the library that needs to be
>             initialised.
              Is LoadLibrary a Wine feature or Windows feature ?

>         4. From this point on you should be able to call the Win32 API as much as
>             you like, even from files compiled with plain old gcc or g++.
              This means that I link that magic <> +
              other Win32 libraries which I need (like -lavifil32) to
              my Linux executable (or Linux dynamic library *.so) and
              everything will work out of box ? But what is the key
              point in this approach ? I do not use any functions in
              <> - just link it to my Linux application
              and it will work ?!

>         5. You may need to set up an exception frame that does something like
>             calling "exit" after printing a message about there being an
>             unhandled exception.

Thank you very much.

Best regards,
 Alexander                            mailto:aefremov at

More information about the wine-devel mailing list