/* 
ISWIN3E.C
*/
 
#include <stdlib.h> 
#include <stdio.h> 
#include <string.h> 
#include <dos.h> 
#include <pharlap.h>
 
int win3e(int *pmaj, int *pmin) 
{ 
   SWI_REGS regs;

   memset(&regs, 0, sizeof(regs));
   regs.eax = 0x1600;
   _dx_real_int(0x2f, &regs);
   *pmaj = regs.eax & 0xff;
   *pmin = (regs.eax >> 8) & 0xff;
   return (*pmaj > 1 && *pmaj != 0x80);
} 

main() 
{ 
   int maj, min; 
   if (! win3e(&maj, &min)) 
      printf("Not running under Windows 3.x Enhanced mode\n"); 
   else 
      printf("Running under Windows <<%d.%d>> Enhanced mode\n",  
            maj, min); 
   return 0; 
} 
