TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Charles Gaefke
from: Jonathan de Boyne Pollard
date: 1999-11-12 12:12:28
subject: Watcom C++ 11.0 and thunking

Thanks for your 1998 posting on the powersoft news server, by the way.  I
spent ages trying to find out why some assembly language code that I wrote to
thunk from 32-bit to 16-bit wasn't working.  Then I turned up your posting
where you noted that

        #define INCL_VIO
        #include 

        char vm_wherey(void)
        {
            USHORT row, col;
            VioGetCurPos(&row, &col, 0);
            return (char)(row + 1);
        }

when compiled as a 32-bit application crashes.  VioGetCurPos() was the exact
call that I was having trouble with.  Knowing that it didn't work using
Watcom's own libraries steered me towards the conclusion that my assembly
language code was in fact correct (which explained why I couldn't find any
mistakes in it despite hours of patient tracing through it with a debugger
(-:) and that it was a linker problem.  WATFIX has now fixed the problem (but, 
alas, not the linker itself) and my DLL now works.  There are a small bunch of 
happy VIOCMD users who would probably like to thank you as well.  (-:

Ironically, I had actually already noticed the lack of the "ALIAS" flag on
some of the 16:16 import fixups (which is what WATFIX fixes, of course).  I
should have pursued that line of investigation further.

 ¯ JdeBP ®

--- FleetStreet 1.22 NR
* Origin: JdeBP's point, using Squish (2:257/609.3)

SOURCE: echoes via The OS/2 BBS

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.