home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / msdos / programm / 10494 < prev    next >
Encoding:
Internet Message Format  |  1992-11-10  |  1.5 KB

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