Mail Archives: djgpp/1997/12/23/08:30:15
Finn Kettner wrote:
<snip>
> PS. We are only using Windows 3.11, W95 and WinNT, and it is the
> destinction between the three operating systems I'd like to make.
here's something i used some time ago, which (i think) distinguishes
between win 3.1x and win95. i think the way to disinguish nt is that it
returns a unique dos version, but i am not sure.
#include <dpmi.h>
int main(void)
{
_go32_dpmi_registers regs;
memset(®s, 0, sizeof(regs));
regs.x.ax = 0x1600;
_go32_dpmi_simulate_int(0x2F, ®s);
return regs.h.al;
}
batch file:
@echo off
wincheck.exe
if not errorlevel 4 goto WIN3
echo:Windows 95
goto EXIT
:WIN3
if not errorlevel 3 goto OOPS
echo:Windows 3.x
goto EXIT
:OOPS
echo:Windows version less than 3
:EXIT
if you want, you can compile the following asm to a com using nasm (the
resulting executable will be tiny compared to the djgpp version):
BITS 16
ORG 0x100
SECTION .text
start mov ax, 0x1600
int 0x2f
end mov ah,0x4c
int 0x21
details can be found in ralph brown's interrupt list:
int 2f 1600
int 2f 1604
int 21 30
hth.
--
----------------------------------------------------------------------
A. Sinan Unur
Department of Policy Analysis and Management, College of Human Ecology,
Cornell University, Ithaca, NY 14853, USA
mailto:sinan DOT unur AT cornell DOT edu
http://www.people.cornell.edu/pages/asu1/
- Raw text -