Mail Archives: djgpp/1999/03/01/09:28:20

Message-ID: <>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Detecting win95: the hard way
Date: Mon, 1 Mar 1999 12:57:57 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1460.8)
Reply-To: djgpp AT delorie DOT com

I need a way to detect when a djgpp program (Allegro) is being run
under win95. At the moment I do this using the documented detection
function, int 0x2F with ax=0x1600. The problem is that in the 
properties for the win95 dosbox, there is an option to specifically
stop this function from working, ie. to make win95 lie and pretend
it isn't there. For some reason, it seems that significant numbers
of people have this option enabled, with the result that Allegro
mis-diagnoses the current environment, uses the wrong version of
the timer module, and everything falls to pieces.

The easy fix would be to just tell people not to set such a silly
option, but it seems like a surprising number of people are affected
by this problem, so it would be nice to solve it more automatically.
So, does anyone have any bright ideas about how to detect win95
even when it is running in this weird stealth mode? I thought about
checking for the "windir" environment variable, but that goes away
along with the int 0x2F support. I tried checking the vendor name 
using __dpmi_get_capabilities(), but of course this is a DPMI 1.0 
function and not implemented by Windows.

Surely there must be _something_ that I can look for? Some obscure
feature of the DPMI implementation, or some other interrupt service
that works differently to on other platforms? Any ideas would be
very much appreciated...

	Shawn Hargreaves.

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019