Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!crdgw1!sagittarius!dixon From: dixon@sagittarius.crd.ge.com (walt dixon) Newsgroups: comp.os.msdos.apps Subject: Re: DOS file handles & mouse drivers Message-ID: <14625@crdgw1.crd.ge.com> Date: 7 Dec 90 22:42:57 GMT References: <1990Dec6.152246.42736@vaxb.acs.unt.edu> Sender: news@crdgw1.crd.ge.com Reply-To: dixon@sagittarius.crd.ge.com (walt dixon) Organization: General Electric Corp. R&D, Schenectady, NY Lines: 42 In <1990Dec6.152246.42736@vaxb.acs.unt.edu> Jhinuk Chowdhury writes >I am required to load a mouse driver (MOUSE.COM) in RAM for many of >my application programs (XtreePro Gold, PCWrite, etc.). In order to >utilize the maximum amount of RAM, I load the MARK utility in memory >first and then the mouse driver with a command like the one below: >C:\UTIL\MOUSE C:\MENUS\XTREE.MNU. Finally, I load the application >program (Xtree, in this case). The last line in my XTREE.BAT batch >file is RELEASE that unloads all TSRs loaded in RAM after MARK. > >I use the same technique to load any program that requires a mouse >driver. The problem is every time this batch file is executed, one >file handle gets tied up. In the previous exmple, we would have one >file handle associated with XTREE.MNU tied up. If a run Xtree.bat >again, more file handle, one for every run and each associated with >Xtree.mnu, will get tied up. I suspect that the problem is not one of losing file handles but one of filling up the system file table. Whenever a file is opened, DOS makes an entry in the System File Table; when the file is closed (or more acurately its reference count goes to 0), DOS deallocates the SFT entry. I suspect that the TSR opens a file (perhaps C:\MOUSE\XTREE.MMU) that is never closed. The first thing I would try is to examine the SFT. The base of the SFT is one of the addresses in the list returned by int 21h ah=52h. The SFT consists of one or more blocks of SFT entries. If there is indeed an SFT entry for an open file, one can either manually remove it from the SFT, or write a program that changes its PSP to that of the program which opened the file (recorded in the PSP), insert the SFT index into an unused Job File Table entry, and issue a close request. Good Luck Walt Dixon {internet: dixon@crd.ge.com } {us mail: ge crd } { po box 8 } { schenectady, ny 12301 } {phone: 518-387-5798 (W) } { 518-875-6203 (H) } Walt Dixon dixon@crd.ge.com