delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2007/03/12/10:15:44

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Glaux" <glaux AT centrum DOT cz>
Newsgroups: comp.os.msdos.djgpp
Subject: How to detect WindowsNT/2k/XP from my DJGPP program?
Date: 12 Mar 2007 08:04:58 -0700
Organization: http://groups.google.com
Lines: 10
Message-ID: <1173711898.186977.177240@n33g2000cwc.googlegroups.com>
NNTP-Posting-Host: 89.176.103.125
Mime-Version: 1.0
X-Trace: posting.google.com 1173711919 6402 127.0.0.1 (12 Mar 2007 15:05:19 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Mon, 12 Mar 2007 15:05:19 +0000 (UTC)
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.13) Gecko/20060414,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: n33g2000cwc.googlegroups.com; posting-host=89.176.103.125;
posting-account=79KgoA0AAADKuOLK3k0Y3qVqk-KGfm77
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,
could you tell me how simply and reliable runtime check if my DJGPP
prog is running under WinNT-XP dos box? I need to exclude some code
from execution under NT.

I used simply checking by getenv("SystemRoot"), where SystemRoot env.
variable is always set on NT systems but getenv is case sensitive so
when I met "SYSTEMROOT" it fails to detect NT and crashed.  I can't
compare every case combination. Other idea?

- Raw text -


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