[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: Call 16 bit API from Winelib?
From:       Eric Pouech <Eric.Pouech () wanadoo ! fr>
Date:       1999-11-28 19:35:16
[Download RAW message or body]

lawson_whitney@juno.com wrote:
> 
> On Sun, 28 Nov 1999, Eric Pouech wrote:
> 
> >
> > if the prototype is known at compilation time, why don't you use Wine
> thunks ?
> For what I'm doing now, WOWCallBackEx16 works now I know where to find
> it, but just for future reference, could you point me to a place in the
> code that does this?  If it's any work for you, don't bother.  I'll meet
> up with it eventually. :-)
well, you just have to look at all the wine builtin 32 bit DLLs that have
to call their 16 bit proc.
here's a (yet unsent) extension to <wine>/DEVELOPERS-HINTS file that explain
that (a little)

<doc>
If you're building a 16 & 32 bit DLLs pair, then from the 32 bit code
you might need to call 16 bit routine. The way to do it to add in the
code, fragments like:
/* ### Start build ### */
extern WORD CALLBACK <PREFIX>_CallTo16_word_wwlll(FARPROC16,WORD,WORD,LONG,LONG,LONG);
/* ### stop build ### */
Where <PREFIX>_ is an internal prefix for your module. The first
parameter is always of type FARPROC16. Then, you can get the regular
list of parameters. The _word_wwlll indicates the type of return (long
or word) and the size of the parameters (here l=>long, w=>word; which
maps to WORD,WORD,LONG,LONG,LONG.
You can put several functions between the Start/Stop build pair.

You can also read tools/build.txt for more details on this.

Then, add to ./dlls/<MyDll>/Makefile.in to the macro GLUE the list of
.c files containing the /* ### Start build ### */ directives.

See dlls/winmm/ for an example of this.
</doc>

(tools/build - with the correct arguments - will generate a .glue.c file
for each of your C file containing the ### start build ### marker. those
file will contain the correct code to call the 16 bit proc)

I haven't tried yet to use tools/build to add this to a WineLib program, but
I don't see any reason why this shouldn't work. (you may need some Makefile
modification for this but doable IMO)

A+
-- 
---------------
Eric Pouech (http://perso.wanadoo.fr/eric.pouech/)
"The future will be better tomorrow", Vice President Dan Quayle


=========================================================================

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic