delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/01/03:48:58

From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Detect NT from within NT DOS emulation?
Date: Sat, 01 Jan 2000 08:09:50 +0200
Organization: NetVision Israel
Lines: 12
Message-ID: <386D9A2E.FBE77C3C@is.elta.co.il>
References: <19991231133513 DOT 30797 DOT qmail AT hotmail DOT com>
NNTP-Posting-Host: ras1-p22.rvt.netvision.net.il
Mime-Version: 1.0
X-Trace: news.netvision.net.il 946707063 2919 62.0.172.24 (1 Jan 2000 06:11:03 GMT)
X-Complaints-To: abuse AT netvision DOT net DOT il
NNTP-Posting-Date: 1 Jan 2000 06:11:03 GMT
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en,ru,hebrew
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Damian Yerrick wrote:
> 
> Is there a reliable way to detect that a DJGPP program is running
> under Microsoft Windows NT?

Call the library function _get_dos_version with a non-zero argument.  If
it returns version 5.50 (0532 in hex), you are on NT.

If you want this test to be portable, look at the source of
_get_dos_version (its source file is src/libc/dos/dos/getdos_v.c in
djlsr202.zip), see what function of Int 21h it issues when called with a
non-zero argument, and do the same in your program.

- Raw text -


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