Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!houxm!whuxl!whuxlm!akgua!gatech!seismo!hao!nbires!oasys!maa From: maa@oasys.UUCP Newsgroups: net.micro.pc Subject: Re: DOS re-entrancy Message-ID: <178@oasys.UUCP> Date: Tue, 11-Mar-86 23:36:04 EST Article-I.D.: oasys.178 Posted: Tue Mar 11 23:36:04 1986 Date-Received: Sat, 15-Mar-86 21:53:23 EST References: <103@nvuxr.UUCP> <137@suneast.uucp> <739@well.UUCP> Organization: NBI,Inc, Boulder CO Lines: 28 > In article <137@suneast.uucp> geoff@suneast.uucp (Geoff Arnold) writes: > > >grab the int21 vector yourself, and set an "indos" flag when a user call > >comes in. > > Better to make "indos" a counter, as DOS does call itself on occasion, > and you'll need to count the number of entries/exits. > -- I've been doing some hacking at MSDOS and there is a VERY useful undocumented function call that does this for you. Function call 34h, "Get DOS_BUSY Pointer", returns in es:bx a pointer to the DOS_BUSY byte. This byte is 0 if MSDOS may be called and >0 if MSDOS is busy. The call to function 34h must be made from the main (non-interrupt) part of the program and the pointer saved for the interrupt service routine to use when it needs to find out if it can make a MSDOS call. Also handy is function 51h, "Get PSP Address", which returns the segment address of the active program's PSP in bx. This is identical to MSDOS 3.x's function 62h. Both function 51h and 62h execute the same code in MSDOS 3.1! WHY DIDN'T MS DOCUMENT FUNCTION 51H INSTEAD OF INVENTING A NEW ONE?? Both of these functions (34h and 51h) work in 2.11 and 3.1. Happy Hacking, Mark