Linking wine *dll.so libraries with Linux applications ?!

Alexander Efremov vilgus at gmail.com
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 "startwinelib.so"
>             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
          APIs.

>         2. "startwinelib.so" 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 "startwinelib.so".
              What is "setjmp" - an assembler directive ? Is
              <startwinelib.so> a standard WineLib application or I have
              to create it myself ?

>         3. WinMain in "startwinelib.so" 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 <startwinelib.so> +
              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
              <startwinelib.so> - 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 mpi-sb.mpg.de




More information about the wine-devel mailing list