delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2015/06/22/03:50:49

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type;
bh=EuWQ6KaAZjayQyItL64PeJUHjyND1XJzIw/CQGY4Mec=;
b=RwP2Ai+z8PZzlRSZZrQ5quUdTv/CSsYAnzI25dJhc5nXjC2v3xk6kRefFPxH3mnC/w
wsvONibcmbp8j9YtKPBITZNsvZ21CI5M8crZwLo9upfw2QBC1XBuWQNKiqfMXnfqDqg3
yqf9O+tSCQlv34cgG/P0SNSyBEm1iZSOyveyDxe4tGoBcszulcHLnKQ9vaBtw2qUBQFd
ufbkL13TBV8/kG87lpx018m7d9ss6rzJkRdKH3rQRSmaH0rXeC9r3T5GIywYjilABA5g
prWtLLagDkJpe/hI7yZ3iyLCh5DirfJneF8gttOKNr1DE5pM5/N08eumcJcKCFh4jO5s
xmkg==
MIME-Version: 1.0
X-Received: by 10.42.205.132 with SMTP id fq4mr24527666icb.33.1434959432324;
Mon, 22 Jun 2015 00:50:32 -0700 (PDT)
In-Reply-To: <5587B696.10304@gmail.com>
References: <201506091712 DOT t59HCPci004068 AT delorie DOT com>
<557739E0 DOT 6070608 AT gmail DOT com>
<CAB9Rao93XrKFBpUDnZdjCz+rEXHGOU2RNKdou2oMLJOk802LnA AT mail DOT gmail DOT com>
<55775E64 DOT 2090901 AT gmail DOT com>
<CAB9Rao-Njdr-CB=vqHnb+TVDmXu3eXqsB5CHB7V0kDwBEsM-WQ AT mail DOT gmail DOT com>
<5579ED42 DOT 6070309 AT gmail DOT com>
<CAB9Rao8cvu3hLEf=KsRWn7woXka0F9Aax7uM9Jj5QqCO=1bL8w AT mail DOT gmail DOT com>
<5579FE8D DOT 3080501 AT gmail DOT com>
<557B436F DOT 1050101 AT gmx DOT de>
<fe60143b-fe03-451f-84d4-a7d59a67cefc AT googlegroups DOT com>
<d1f33445-bef3-42d5-a343-55fed9868908 AT googlegroups DOT com>
<779efaf6-8ebf-4f2a-a526-a2773e3909b4 AT googlegroups DOT com>
<4131b54f-b34d-4a84-ada6-3443ed9efce9 AT googlegroups DOT com>
<20150618-004800 DOT 313 DOT 0 AT Your-Name-Here DOT News>
<fda73a64-d86c-400d-a78d-4d11b067d138 AT googlegroups DOT com>
<CAA2C=vCYCjih4r38XZ45TURJPxpKAF40kakFM8iRizDH08QbVQ AT mail DOT gmail DOT com>
<65ad24c7-0888-4526-9395-e262f348a021 AT googlegroups DOT com>
<5584B697 DOT 60303 AT gmail DOT com>
<CAA2C=vDpU5XoXZ=3MNiaE1zY8FEwGm_Cki4bd8mQpBFJ9DZ2Vw AT mail DOT gmail DOT com>
<5587B696 DOT 10304 AT gmail DOT com>
Date: Mon, 22 Jun 2015 10:50:32 +0300
Message-ID: <CAA2C=vCOrPG=5cSvFn89aqy-1BDu=3TGbVbxXovhrMrTH29RiQ@mail.gmail.com>
Subject: Re: Detecting Windows NT in DJGPP
From: "Ozkan Sezer (sezeroz AT gmail DOT com)" <djgpp AT delorie DOT com>
To: djgpp AT delorie DOT com
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 6/22/15, Frank Sapone (emoaddict15 AT gmail DOT com) <djgpp AT delorie DOT com> wrote:
> Hey everyone,
>
> Quake 1 has a rather simple test for detecting if it's being run on
> Windows 9x:
>
>      __dpmi_regs                             r;
>
>      r.x.ax = 0x160a;                /* Get Windows Version */
>      __dpmi_int(0x2f, &r);
>
>      if(r.x.ax || r.h.bh < 4)        /* Not windows or earlier than Win95
> */
>          <code>
>      else
>          <code>
>
> I'd like to detect if the program is running in NTVDM/Win XP/etc.  I
> know you can check for WINDIR as an evironment string, but that could be
> unreliable
> from someone with a bad autoexec.bat.
>
> Is there any other way to detect if it's in an NT environment?
>
> Frank

The allegro library (allegro-4.2.3.1, http://alleg.sourceforge.net/)
has a detect_os() procedure in its src/dos/dsystem.c. Its NT detection
is based on environment variable check, though, along with a call to
_get_dos_version().

--
O.S.

- Raw text -


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