delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/24/03:25:18

Date: Wed, 24 Dec 1997 10:25:14 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Robert Hoehne <robert DOT hoehne AT gmx DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: Determining Operating System
In-Reply-To: <349FDF40.11D42A2B@gmx.net>
Message-ID: <Pine.SUN.3.91.971224102453.16655G-100000@is>
MIME-Version: 1.0

On Tue, 23 Dec 1997, Robert Hoehne wrote:

> void
> _init_win_check()
> {
>   win_version = _get_win_version();
>   _get_dos_version(1);
>   nt_detected = (win_version == 0) && (_osmajor == 0x05) && (_osminor ==
> 0x32)
>   w95_detected = win_version >= 0x0400;
> }

Did this ever work on NT?  I think it won't, because
`_get_dos_version' doesn't set `_osmajor' and `_osminor' to the true
version it computes when called with a non-zero argument (this is
specifically explained in the docs), it only returns that version
number to the caller.

So the test for NT should be rewritten like so:

   nt_detected = _get_dos_version(1) == 0x0532;

- Raw text -


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