Newsgroups: comp.lang.pascal
Path: utzoo!utgpu!watserv1!maytag!watstat.waterloo.edu!dmurdoch
From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch)
Subject: Re: How to detect MS Mouse driver
Message-ID: <1990Nov29.141927.243@maytag.waterloo.edu>
Sender: daemon@maytag.waterloo.edu (Admin)
Organization: University of Waterloo
References: <25098@adm.brl.mil>
Date: Thu, 29 Nov 90 14:19:27 GMT
Lines: 27

In article <25098@adm.brl.mil> C0361@univscvm.csd.scarolina.edu ( Thomas Jenkins) writes:
>According to the MSDOS Extensions guide I have, the best way to detect if the
>MS Mouse driver is present is:
>
>Set AX to zero
>call INT 33h
>if AX <> 0 then driver loaded  BX -> number of mouse buttons
>else not present.

I haven't seen it myself, but have been told by Kim Kokkonen of Turbopower
Software that certain (old) versions of DOS don't initialize the INT 33 vector.
If you call INT 33 on one of these machines, you'll crash right away.

The test that Turbopower uses for the presence of an INT 33 ISR is just to
look at the vector:  if it's not nil, they assume it's valid.

You should also be aware that the AX=0 call is destructive:  if someone has
a TSR mouse menu loaded, and you use this call to detect the mouse, you
won't be able to restore the mouse menu when your program exits.  
Unfortunately, the "Save State" call (AX=16h) isn't implemented in some
old versions of the Microsoft driver, and will crash them.  (This also
from KK; I haven't seen it.  However, Turbopower's software won't try to
save the state first, because it's just too unreliable.)  

Microsoft should be ashamed.

Duncan Murdoch
