TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Mike Bilow
from: Mikael Wahlgren
date: 1996-06-06 01:54:08
subject: Semaphores (16 & 32)

On May 24 21:21 96, Mike Bilow of 1:323/107 wrote:

 MB> quickly as possible, then his approach should be used.  On the 
 MB> other hand, if you are trying to do this as a learning 
 MB> experience, you may as well keep plugging on getting the 
 MB> compiler to thunk.

   I don't see where the problem is.  If he tried to use Borland C, I would
understand it, as you would have to tell the compiler to thunk the
parameters as well there (contrary to CSet and Watcom, that understand that
a function declared as 16-bit need thunked parameters as well).
   I have used 16-bit APIs a lot from 32-bit Watcom programs, and there are
nothing hard about it.  Something like this WILL work:

#define  INCL_DOS
#include 

APIRET16 APIENTRY16 Dos16CreateSem(USHORT excl, PULONG sem, PSZ nm);

void main() {
  ULONG           TermSem;
  UCHAR           TermName[33];

  Dos16CreateSem(1, &TermSem, TermName);
}

You should NOT include any  special .LIB file in the project for this.  All
the thunking entries for 16-bit DosApi are in the OS2386.LIB file, included
by default.

       Mvh / Mikael Wahlgren

--- Msgedsq/2 2.2e
* Origin: OS2You Support BBS +46 31 196406 (2:203/302.5)
SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 517 628 713/888 800/1
@PATH: 203/302 213 200/204 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

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™.