www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/29/10:02:55

Date: Sun, 29 Sep 1996 15:28:24 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Tim Gunn <timgunn AT eastwind DOT livewire DOT com DOT au>
Cc: djgpp AT delorie DOT com
Subject: Re: Simple Questions
In-Reply-To: <52lnbf$72n@news.mel.aone.net.au>
Message-Id: <Pine.SUN.3.91.960929151713.20703c-100000@is>
Mime-Version: 1.0

On Sun, 29 Sep 1996, Tim Gunn wrote:

> Firstly can i found out the available drives in djgpp (network, cdrom,
> floppy etc.) 

There is a function called `getmntent' in the DJGPP library; look it up 
in the on-line library docs.  It should be exactly what you are after.

> Secondly how do i test if a program is running under windows?

The usual practice is to test for an environment variable called "windir" 
(in lower-case!).  This is usually sufficient, but somebody can set that 
variable and fool your program.  The real test involves calling Interrupt 
2Fh function 16h; look it up in the Ralf Brown's Interrupt List.

> and how do i find out the version of the DOS/Windows version.

DJGPP library has a functioned called `_get_dos_version'.  AFAIK, you
shouldn't worry about the version of Windows 3.x, but if you do, the above
function of Int 2Fh also returns the Windows 3.x version.  Windows 95
manifests itself as DOS version 7. 

- Raw text -


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