<div dir="ltr">
<div id="result_box" dir="ltr">Hi, Damjan Jovanovic</div>
<div dir="ltr"> </div>
<div dir="ltr">Thank you tired of the answer to my questions.</div>
<div dir="ltr"> </div></div>
<div dir="ltr">I carefully read the wine part of the code and development document, searched in mail lists, these days.</div>
<div dir="ltr">And I got some inspiration from wine plugin API wiki page and wine loader's code.</div>
<div dir="ltr"> </div>
<div dir="ltr">I am considering of an approach.</div>
<div dir="ltr"> </div>
<div dir="ltr">Link preloader and related resource(libwine) with my Linux native App.</div>
<div dir="ltr">Do some modify with wine_init function, and call it before main(). </div>
<div dir="ltr">This can be implemented by a global C++ objects's constructor.</div>
<div dir="ltr">Upper two steps can deal with TEP and FS register.</div>
<div dir="ltr"> </div>
<div dir="ltr">But I there may be another problem.</div>
<div dir="ltr">If there was aready an static global C++ object in my App, </div>
<div dir="ltr">How can I makde it initiatited after wine_init from in object.</div>
<div dir="ltr"> </div>
<div dir="ltr">Do you have some other expostulate of this idea?</div>
<div dir="ltr"> </div>
<div dir="ltr"> </div>
<div dir="ltr">BTW, I skim over mplayer and xine's parts of code.</div>
<div dir="ltr">They don't dealwith TEB and FS register.</div>
<div dir="ltr">They only do sth on LDT and allocat PE header before LoadeLibaray.</div>
<div dir="ltr">Why they can run correctly???</div>
<div dir="ltr"> </div>
<div dir="ltr"> </div>
<div dir="ltr"> </div>
<div><span class="gmail_quote">2007/8/22, Damjan Jovanovic <<a href="mailto:damjan.jov@gmail.com">damjan.jov@gmail.com</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On 8/21/07, trulyliu <<a href="mailto:trulyliu@gmail.com">trulyliu@gmail.com</a>> wrote:<br>><br>
><br>><br>> 2007/8/21, Damjan Jovanovic <<a href="mailto:damjan.jov@gmail.com">damjan.jov@gmail.com</a>>:<br>> > On 8/21/07, trulyliu <<a href="mailto:trulyliu@gmail.com">trulyliu@gmail.com</a>> wrote:
<br>> > ><br>> > ><br>> > > 2007/8/21, Damjan Jovanovic <<a href="mailto:damjan.jov@gmail.com">damjan.jov@gmail.com</a>>:<br>> > > > On 8/21/07, trulyliu <<a href="mailto:trulyliu@gmail.com">
trulyliu@gmail.com</a>> wrote:<br>> > > > > Can I made <a href="http://Arithmetic.dll.so">Arithmetic.dll.so</a> ? And link it against my linux App?<br>> > > ><br>> > > > A library function runs in the context of the process that invokes it.
<br>> > > > A library doesn't have its own TEB/memory layout/exception handling<br>> > > > that works independently of the process that calls it, no matter how<br>> > > > it is compiled. If the wine plugin API is ever made, it will modify
<br>> > > > the process so it has what the library expects when the library<br>> > > > functions are called.<br>> > > ><br>> > > > Does your <a href="http://Arithmetic.dll.so">
Arithmetic.dll.so</a> call any Windows functions? If so, you<br>> > > > need wine and you will always need wine, plugin API or no plugin API,<br>> > > > whether you compile it into a DLL or .dll.so. But if you only use ANCI
<br>> > > > C stuff you can compile it into a .so and use it without wine.<br>> > > ><br>> > > > If you want something that runs seamlessly on every operating system<br>> > > > today, IMHO you should consider Java.
<br>> > > ><br>> > > ><br>> > ><br>> > ><br>> > > Yes, Java may be a good choice for crossing platform.<br>> > ><br>> > > As you said, my Arithmetic.dll
does not call any windows function.<br>> > > It's pure ANSI C library. What's the step of make .dll.so ??<br>> > ><br>> > > Use winegcc or gcc ??<br>> ><br>> > Use gcc and make a .so like this:
<br>> > gcc -c arithmetic.c -fPIC<br>> > gcc arithmetic.o -shared -o arithmetic.so<br>> ><br>> > Then put it in /usr/lib and link to it like so:<br>> > gcc -c application.c<br>> > gcc application.o
-o application -larithmetic<br>> ><br>> > > > > --<br>> > > > > <a href="mailto:trulyliu@gmail.com">trulyliu@gmail.com</a><br>> > > > Damjan<br>> > > --<br>> > >
<a href="mailto:trulyliu@gmail.com">trulyliu@gmail.com</a><br>> > ><br>> ><br>> > Damjan<br>><br>> gcc -c arithmetic.c -fPIC ???<br>> I am sorry. I don't have Arithmetic.dll's source code.
<br>> Can I use LoadLibaray() and GetProcAddress<br>> to get the function which Arithmetic.dll exports.<br><br>No, for the reasons I talked about before. Eg. GetProcAddress() does<br>look up the current directory, which resides in the TEB, which AFAIK
<br>resides in the FS CPU register on Windows. On Linux the FS register<br>contains something else, leading to a crash.<br><br>At the moment, you can only use Windows DLLs from Windows applications<br>or from winelibs, which are Windows applications compiled to be able
<br>to use Linux libraries as well.<br><br>> --<br>> <a href="mailto:trulyliu@gmail.com">trulyliu@gmail.com</a><br>><br><br>Damjan<br></blockquote></div><br><br clear="all"><br>-- <br><a href="mailto:trulyliu@gmail.com">
trulyliu@gmail.com</a><br>