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

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=message-id:date:from:user-agent:mime-version:to:subject:references
:in-reply-to:content-type:content-transfer-encoding;
bh=QASO5lRCBnIXBB5TP1bO9haWDipgoUum4P4+8iJsUXg=;
b=CrmOGYLsXFdtDqP83fL8qFSOXs51iZz7FFcP7pqTlVbp3s+3kiKZT9YjXcw1054fiG
o7NaxEFSFFIzpjNcMAbO0zAe09vz+uhVgI2az3XYnqi0QK4kDiv1/hW9i0DlXb90t8gd
BIvM7BYETyZGsgPd6KdKbQ0722nf7q0lDzdB1cP/vNO35wqGsLaipvPmNWTIRlckG9vc
rnuQh0uWfQ8Z2kBTK+zYngoQY24YruDOQawSEi2zN5STUA8vZMiG3qh4saneK5fhUm8T
A5e2748eXuLqoHhk7Rd/KSJcZhEUKtgv4VmQHKfMShXQXO7yPHYrbg4tt9HWrVD+Wvz8
edCA==
X-Received: by 10.107.7.76 with SMTP id 73mr13493672ioh.81.1434957465141;
Mon, 22 Jun 2015 00:17:45 -0700 (PDT)
Message-ID: <5587B696.10304@gmail.com>
Date: Mon, 22 Jun 2015 03:17:42 -0400
From: "Frank Sapone (emoaddict15 AT gmail DOT com)" <djgpp AT delorie DOT com>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Detecting Windows NT in DJGPP
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>
In-Reply-To: <CAA2C=vDpU5XoXZ=3MNiaE1zY8FEwGm_Cki4bd8mQpBFJ9DZ2Vw@mail.gmail.com>
Reply-To: djgpp AT delorie DOT com

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


- Raw text -


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