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)" 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> <55775E64 DOT 2090901 AT gmail DOT com> <5579ED42 DOT 6070309 AT gmail DOT com> <5579FE8D DOT 3080501 AT gmail DOT com> <557B436F DOT 1050101 AT gmx DOT de> <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> <65ad24c7-0888-4526-9395-e262f348a021 AT googlegroups DOT com> <5584B697 DOT 60303 AT gmail DOT com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 */ else 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