Newsgroups: comp.sys.ibm.pc
Path: utzoo!telly!druid!darcy
From: darcy@druid.uucp (D'Arcy J.M. Cain)
Subject: Re: Retrieving the value of FILES=???
Reply-To: darcy@druid.UUCP (D'Arcy J.M. Cain)
Organization: D'Arcy Cain Consulting, West Hill, Ontario
Date: Fri, 15 Jun 90 13:31:28 GMT
Message-ID: <1990Jun15.133128.17259@druid.uucp>
Keywords: Global File Handle Table
References: <605@digigw.digital.co.jp> <4057@jato.Jpl.Nasa.Gov>

In article <4057@jato.Jpl.Nasa.Gov> kaleb@mars.UUCP (Kaleb Keithley) writes:
> [Discussion about finding the files/process in DOS]
>How about: (in psuedo-code)
>    fopen ("/CONFIG.SYS", "r");
>    fscanf (..., "FILES=", ...);
>    fscanf (...,  value, ...);
>    fclose (...);
>
And if the table has been changed using int 67h it doesn't tell you the
correct value.  What you need is a TSR that you run at startup which
does the following at initialisation.

Determines the value for max files using following:
    From command line if given
    From FILES= in config.sys if available
    Normal default otherwise.

Use int 67h to set up this value - this makes sure value is known.

It then sets up a hook to int 67h to check for special value in BX (say
-1) and returns current value if it is that special value.  Otherwise
it calls the original int 67h and keeps track of the new value.  Then
your programs can call int 67h with -1 to get the current value.

No wonder they call it Messy-DOS.  :-)


-- 
D'Arcy J.M. Cain (darcy@druid)     |   Government:
D'Arcy Cain Consulting             |   Organized crime with an attitude
West Hill, Ontario, Canada         |
(416) 281-6094                     |
