home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!decwrl!csus.edu!netcom.com!netcomsv!cruzio!aki
- From: aki@cruzio.santa-cruz.ca.us
- Newsgroups: comp.os.msdos.programmer
- Subject: Re: Detecting Windows ?
- Message-ID: <4619@cruzio.santa-cruz.ca.us>
- Date: 10 Nov 92 21:24:59 GMT
- Article-I.D.: cruzio.4619
- References: <HPV.92Nov10162244@kelvin.uio.no>
- Sender: aki@cruzio.santa-cruz.ca.us
- Reply-To: aki@cruzio.santa-cruz.ca.us
- Lines: 33
-
- In article <HPV.92Nov10162244@kelvin.uio.no>, hpv@kelvin.uio.no (Hans Peter Verne) writes:
- >
- > I'm writing this for a friend who doesn't have access to the net, poor soul.
- > Please reply by mail, I'll post a follow-up (if I get any replies...).
- >
- > Does anyone know a reliable way to determine if windows (tm) is running,
- > and under which mode, from a standard dos program ?
- >
- > I've tried the int2F,1600 function, but to no awail.
- >
- > Greetings,
- > Hans Peter ( hpv@ulrik.uio.no )
-
-
- Here is one:
-
- is_windows_installed()
- { // says yeah if Windows or SHELL installed
- struct REGPACK rp; // Turbo-C
- if (peek(0, 0x2F*4)==0) return 0; // no vector check
- rp.r_ax=0x1600;
- intr (0x2F, &rp); // Look for enhanced mode
- if (((rp.r_ax&0xFF)==0x80) || ((rp.r_ax&0xFF)==0)) {
- rp.r_ax=0x4680; intr (0x2F, &rp); // Look for /R/S or Shell
- if (rp.r_ax!=0) return 0; // !=0 is faster than (rp.r_ax)
- }
- return 1; // Win's here
- }
-
- Aki.
- --
- / Phone: 408-662 9664 Fax: 662 9676 | "Aki" pronounced: Ah-Key. I know \
- \ 125 Searidge Ct #D, Aptos, CA 95003 | what I'm doing most of the time. /
-