home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / c / sysinfo / demo.c next >
Encoding:
C/C++ Source or Header  |  1994-05-18  |  48.2 KB  |  1,488 lines

  1.  
  2.    /**********************************************************************\
  3.    *                                                                      *
  4.    * Author:   Paul Lapsansky                                             *
  5.    * Date:     05/19/94                                                   *
  6.    *                                                                      *
  7.    * File:     demo.c                                                     *
  8.    *                                                                      *
  9.    * Descrpt:  Demonstrates functions found in the SYSTEM INFO LIBRARY.   *
  10.    *                                                                      *
  11.    * Language: Borland C++                                                *
  12.    *                                                                      *
  13.    * Platform: MS-DOS                                                     *
  14.    *                                                                      *
  15.    \**********************************************************************/
  16.  
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <conio.h>
  20. #include <string.h>
  21. #include <alloc.h>
  22. #include "sysinfo.h"
  23.  
  24. #define TOP    127                       // bright white on white
  25. #define BOT    120                       // gray on white
  26. #define TITLE  112                       // black on white
  27. #define LABELS 30                        // yellow on blue
  28. #define INFO   31                        // bright white on blue
  29. #define CHECK  28                        // bright red on blue
  30. #define CLEAR  7                         // white on black
  31.  
  32. void main(void)
  33. {
  34.    int i;                                // counter    
  35.    int x,y;                              // x and y coordinates
  36.    int num;                              // logical drive number
  37.    int code;                             // ascii code
  38.    int model,submodel,rev;               // model information
  39.    int bus;                              // system bus type
  40.    int cpu,npu;                          // processor information
  41.    int DMA3,s8259,realtime,keyint,       // feature byte information
  42.        event,extbios,MCA;
  43.    int addr;                             // I/O port address
  44.    int uart;                             // UART type
  45.    long ext,exta;                        // extended memory
  46.    int ems,emsa;                         // EMS memory
  47.    long xmsa,xmsb;                       // XMS memory
  48.    int vram;                             // video card memory
  49.    int major,minor,drvMaj,drvMin;        // version information              
  50.    int A20,HMA;                          // XMS information
  51.    int handles,segment;                  // EMS information
  52.    int emm;                              // '386 EMM type
  53.    int card;                             // video card type
  54.    int buttons,type,irq;                 // mouse information
  55.    int oem;                              // DOS OEM number
  56.    int drdos;                            // DR-DOS version
  57.    int mode;                             // Windows or CPU mode
  58.    int dblspace,stacker,mscdex;          // installed flags
  59.    int a,b;                              // floppy drive type
  60.    int lastdrive;                        // available drives
  61.    int removable,remote;                 // drive type
  62.    int heads,cyl,sectors;                // hard-drive information
  63.    int version,sub,conn,use,vol,peak;    // NetWare File Server Information
  64.    int year,month,day,hour,min,sec,week; // login date and time
  65.  
  66.    long SecPerClus,FreeClus,BytesPerSec, // misc. drive space information
  67.         TotalClus,ClusSize,FreeSpace,
  68.         TotalSpace;
  69.  
  70.    char *drive,                          // drive letter
  71.         *pcdate,                         // system BIOS date
  72.         *vendor,                         // video card vendor
  73.         *server,                         // server name
  74.         *user;                           // user name
  75.  
  76.    _setcursortype(_NOCURSOR);            // turn off cursor
  77.  
  78.    /**********************************************************************\
  79.    *                          Initialization...                          *
  80.    \**********************************************************************/ 
  81.  
  82.    clrscr();                  
  83.    textattr(TOP); cputs("┌──────────────────────────────────────────────────────────────────────────────");
  84.    textattr(BOT); cputs(" ");
  85.    textattr(TOP); cputs("│");
  86.    textattr(TITLE); cputs("                     ");
  87.    textattr(BOT); cputs(" ");
  88.    textattr(TITLE); cputs("     SYSTEM INFO LIBRARY DEMO                           ");
  89.    textattr(BOT); cputs("│");
  90.    textattr(TOP); cputs("│");
  91.    textattr(TITLE); cputs("                                  Version 1.1                                 ");
  92.    textattr(BOT); cputs("│ ──────────────────────────────────────────────────────────────────────────────┘");
  93.    textattr(LABELS); cputs("                                                                                                                                 ");
  94.    cputs("                                                                                                                                               ");
  95.    cputs("                                                                                                                                               ");
  96.    cputs("                                                                                                                                               ");
  97.    cputs("                                                                                                                                               ");
  98.    cputs("                                                                                                                                               ");
  99.    cputs("                                                                                                                                               ");
  100.    cputs("                                                                                                                                               ");
  101.    cputs("                                                                                                                                               ");
  102.    cputs("                                                                                       ");
  103.    textattr(TOP); cputs("┌──────────────────────────────────────────────────────────────────────────────");
  104.    textattr(TITLE); cputs(" ");
  105.    textattr(TOP); cputs("│");
  106.    textattr(TITLE); cputs("                        Press any key for next screen...                      ");
  107.    textattr(BOT); cputs("│ ──────────────────────────────────────────────────────────────────────────────┘");
  108.    window(1,5,80,21);
  109.  
  110.    /**********************************************************************\
  111.    *                 Display Hardware Information Screen                  *
  112.    \**********************************************************************/ 
  113.  
  114.    textattr(LABELS);     
  115.    gotoxy(37,2);cputs("Computer");
  116.    gotoxy(4,4);cputs("BIOS Category     :");
  117.    gotoxy(4,5);cputs("BIOS I.D.         :");
  118.    gotoxy(4,6);cputs("BIOS Date         :");
  119.    gotoxy(4,7);cputs("Bus Type          :");
  120.    gotoxy(4,9);cputs("Processor         :");
  121.    gotoxy(4,10);cputs("Math Co-processor :");
  122.    gotoxy(4,11);cputs("Processor Speed   :");
  123.    gotoxy(4,12);cputs("Processor Mode    :");
  124.    gotoxy(4,14);cputs("Keyboard Type     :");
  125.    gotoxy(43,7);cputs("DMA Channel 3 used            :");
  126.    gotoxy(43,8);cputs("2nd 8259 installed            :");
  127.    gotoxy(43,9);cputs("Real Time Clock installed     :");
  128.    gotoxy(43,10);cputs("Keyboard Int. (INT 15/AH=4F)  :");
  129.    gotoxy(43,11);cputs("Wait for External Event       :");
  130.    gotoxy(43,12);cputs("Exteneded BIOS allocated      :");
  131.  
  132.    textattr(INFO);                         
  133.  
  134.    getID(&model,&submodel,&rev);         // get model information
  135.    pcdate=biosDate();                    // get BIOS date
  136.  
  137.    gotoxy(24,4);
  138.    switch (model) {                      // display model type
  139.      case 0xFF:
  140.        switch (submodel) {
  141.          case 0x46:
  142.            cputs("Olivetti");
  143.            break;
  144.          default:
  145.            cputs("IBM PC or compatible");
  146.        }
  147.        break;
  148.      case 0xFE:
  149.        switch (submodel) {
  150.          case 0x43:
  151.            cputs("Olivetti");
  152.            break;
  153.          default:
  154.            cputs("IBM PC/XT or compatible");
  155.        }
  156.        break;
  157.      case 0xFD:
  158.        cputs("IBM PCjr");
  159.        break;
  160.      case 0xFC:
  161.        switch (submodel) {
  162.          case 0x02:
  163.            cputs("IBM XT-286");
  164.            break;
  165.          case 0x04:
  166.            cputs("PS/2");
  167.            break;
  168.          case 0x05:
  169.            cputs("PS/2");
  170.            break;
  171.          case 0x06:
  172.            cputs("IBM 7552");
  173.            break;
  174.          case 0x08:
  175.            cputs("Epson");
  176.            break;
  177.          case 0x09:
  178.            cputs("PS/2");
  179.            break;
  180.          case 0x0B:
  181.            cputs("PS/1");
  182.            break;
  183.          case 0x20:
  184.            cputs("Compaq");
  185.            break;
  186.          case 0x30:
  187.            cputs("Epson");
  188.            break;
  189.          case 0x31:
  190.            cputs("Epson");
  191.            break;
  192.          case 0x33:
  193.            cputs("Epson");
  194.            break;
  195.          case 0x42:
  196.            cputs("Olivetti");
  197.            break;
  198.          case 0x45:
  199.            cputs("Olivetti");
  200.            break;
  201.          case 0x48:
  202.            cputs("Olivetti");
  203.            break;
  204.          case 0x4F:
  205.            cputs("Olivetti");
  206.            break;
  207.          case 0x50:
  208.            cputs("Olivetti");
  209.            break;
  210.          case 0x51:
  211.            cputs("Olivetti");
  212.            break;
  213.          case 0x52:
  214.            cputs("Olivetti");
  215.            break;
  216.          case 0x94:
  217.            cputs("Zenith 386");
  218.            break;
  219.          default:
  220.            cputs("IBM AT or compatible");
  221.        }
  222.        break;
  223.      case 0xFB:
  224.        switch (submodel) {
  225.          case 0x4C:
  226.            cputs("Olivetti");
  227.            break;
  228.          default:
  229.            cputs("IBM PC/XT or compatible");
  230.        }
  231.        break;
  232.      case 0xFA:
  233.        switch (submodel) {
  234.          case 0x4E:
  235.            cputs("Olivetti");
  236.            break;
  237.          default:
  238.            cputs("PS/2");
  239.        }
  240.        break;
  241.      case 0xF9:
  242.        cputs("PC Convertible");
  243.        break;
  244.      case 0xF8:
  245.        switch (submodel) {
  246.          case 0x0E:
  247.            cputs("PS/1");
  248.            break;
  249.          case 0x0F:
  250.            cputs("PS/1");
  251.            break;
  252.          case 0x1F:
  253.            cputs("PS/ValuePoint");
  254.            break;
  255.          case 0x30:
  256.            cputs("PS/1");
  257.            break;
  258.          case 0x49:
  259.            cputs("PS/ValuePoint");
  260.            break;
  261.          case 0x4A:
  262.            cputs("PS/ValuePoint");
  263.            break;
  264.          case 0x4B:
  265.            cputs("PS/ValuePoint");
  266.            break;
  267.          case 0x5E:
  268.            cputs("IBM ThinkPad");
  269.            break;
  270.          case 0x61:
  271.            cputs("Olivetti");
  272.            break;
  273.          case 0x62:
  274.            cputs("Olivetti");
  275.            break;
  276.          default:
  277.            cputs("PS/2");
  278.        }
  279.        break;
  280.      case 0xE1:
  281.        cputs("PS/2");
  282.        break;
  283.      case 0x9A:
  284.        cputs("Compaq XT");
  285.        break;
  286.      case 0x30:
  287.        cputs("Sperry PC");
  288.        break;
  289.      case 0x2D:
  290.        cputs("Compaq Deskpro");
  291.        break;
  292.      default:
  293.        cputs("Unknown model!");
  294.    }
  295.  
  296.    gotoxy(24,5);                       
  297.    cprintf("%02X %02X %02X",model,submodel,rev); // display model I.D.
  298.  
  299.    gotoxy(24,6);
  300.    cputs(pcdate);                        // display BIOS date
  301.    
  302.    bus = getBusType();                   // get system bus type
  303.  
  304.    gotoxy(24,7);
  305.    switch (bus) {                        // display bus type
  306.      case 1:
  307.        cputs("ISA/AT/Classic");
  308.        break;
  309.      case 2:
  310.        cputs("MCA");
  311.        break;
  312.      case 3:
  313.        cputs("EISA");
  314.    }
  315.     
  316.    cpu=getCPU();                         // get processor type
  317.   
  318.    gotoxy(24,9);                        
  319.    switch (cpu) {                        // display processor type
  320.      case 1:
  321.        cputs("NEC V20");
  322.        break;
  323.      case 2:
  324.        cputs("8088");
  325.        break;
  326.      case 3:
  327.        cputs("80186");
  328.        break;
  329.      case 4:
  330.        cputs("80286");
  331.        break;
  332.      case 5:
  333.        cputs("80386");
  334.        break;
  335.      case 6:
  336.        cputs("80486");
  337.        break;  
  338.      case 7:
  339.        cputs("PENTIUM");
  340.    }
  341.  
  342.    npu=getNPU();                         // get math-coprocessor type
  343.  
  344.    gotoxy(24,10);                        
  345.    switch (npu) {                        // display math co-processor type
  346.      case 1:
  347.        cputs("8087");
  348.        break;
  349.      case 2:
  350.        cputs("80287");
  351.        break;
  352.      case 3:
  353.        cputs("80387");
  354.        break;
  355.      case 4:   
  356.        cputs("80487");
  357.        break; 
  358.      case 5:
  359.        cputs("Internal");
  360.        break;   
  361.      default:
  362.        cputs("Not installed");
  363.    }
  364.    
  365.    gotoxy(24,11);
  366.    cprintf("%dMhz",getMhz());            // get CPU speed
  367.  
  368.    mode = getCPUmode();                  // get CPU mode
  369.  
  370.    gotoxy(24,12);
  371.    switch (mode) {                       // display CPU mode
  372.      case 1:
  373.        cputs("Real");                   
  374.        break;
  375.      case 2:
  376.        cputs("Protected");
  377.        break;
  378.      case 3:
  379.        cputs("V86");                     
  380.        break;
  381.      default:
  382.        cputs("Not supported");
  383.    }
  384.  
  385.    gotoxy(24,14);                    
  386.    if(chkEnhKeyb())                      // get keyboard type
  387.      cputs("Enhanced Keyboard");
  388.    else
  389.      cputs("Standard Keyboard");
  390.  
  391.                                          // get feature byte information
  392.    if(!getFeatures(&DMA3,&s8259,&realtime,&keyint,&event,&extbios,&MCA)) {
  393.      textattr(CHECK);                       
  394.      gotoxy(75,7);                       
  395.      if(DMA3)                            // display if DMA3 used
  396.        cputs("yes");
  397.      else
  398.        cputs("no");
  399.      gotoxy(75,8);
  400.      if(s8259)                           // display if a slave 8259 available
  401.        cputs("yes");
  402.      else
  403.        cputs("no");
  404.      gotoxy(75,9);                      
  405.      if(realtime)                        // display if a realtime clock is avail
  406.        cputs("yes");
  407.      else
  408.        cputs("no");
  409.      gotoxy(75,10);
  410.      if(keyint)                          // display if keyboard intercept avail
  411.        cputs("yes");
  412.      else
  413.        cputs("no");
  414.      gotoxy(75,11);                     
  415.      if(event)                          // display if external event available
  416.        cputs("yes");
  417.      else
  418.        cputs("no");
  419.      gotoxy(75,12);                     
  420.      if(extbios)                        // display if extended BIOS available
  421.        cputs("yes");
  422.      else
  423.        cputs("no");
  424.    }
  425.  
  426.    getch();                             // wait for keystroke
  427.    textattr(CLEAR);                          
  428.    clrscr();                            // clear screen
  429.    
  430.    /**********************************************************************\
  431.    *                       Display I/O Ports Screen                       *
  432.    \**********************************************************************/ 
  433.  
  434.    textattr(LABELS);
  435.    clrscr();    
  436.    gotoxy(37,2);cputs("I/O Ports");
  437.    gotoxy(23,4);cputs("    Label      Address     UART");
  438.    gotoxy(23,5);cputs("─────────────────────────────────────");
  439.                        
  440.    textattr(INFO);
  441.  
  442.    y = 6;
  443.    for(i=1; i<=4; i++) {                // display COM ports
  444.      addr = getCOMaddr(&i);
  445.      if(addr) {
  446.        gotoxy(23,y);
  447.        cprintf("    COM%d         %Xh",i,addr);
  448.        uart = getUART(&addr);           // get UART type
  449.        switch (uart) {
  450.          case 0:
  451.            cputs("      ----");
  452.            break;
  453.          case 1:
  454.            cputs("      8250");
  455.            break;
  456.          case 2:
  457.            cputs("     16450");
  458.            break;
  459.          case 3:
  460.            cputs("    16C1450");
  461.            break;
  462.          case 4:
  463.            cputs("     16550");
  464.            break;
  465.          case 5:
  466.            cputs("    16550AF");
  467.            break;
  468.          case 6:
  469.            cputs("    16C1550");
  470.            break;
  471.          case 7:
  472.            cputs("     16552");
  473.            break;
  474.          case 8:
  475.            cputs("     82510");
  476.        }
  477.        y++;
  478.      }
  479.    }
  480.  
  481.    for(i=1; i<=4; i++) {                // display LPT ports
  482.      addr = getLPTaddr(&i);
  483.      if(addr) {
  484.        gotoxy(23,y);
  485.        cprintf("    LPT%d         %Xh      ----",i,addr);
  486.        y++;
  487.      }
  488.    }
  489.  
  490.    getch();                             // wait for keystroke
  491.    textattr(CLEAR);                        
  492.    clrscr();                            // clear screen
  493.  
  494.    /**********************************************************************\
  495.    *                       Display Memory Screen                          *
  496.    \**********************************************************************/ 
  497.  
  498.    textattr(LABELS);
  499.    clrscr();   
  500.    gotoxy(38,2);cputs("Memory");
  501.    gotoxy(4,4);cputs("Total Conventional Memory :");
  502.    gotoxy(4,5);cputs("Free Conventional Memory  :");
  503.    gotoxy(4,7);cputs("Total Extended Memory     :");
  504.    gotoxy(4,8);cputs("Free Extended Memory      :");
  505.    gotoxy(4,10);cputs("Available XMS Memory      :");
  506.    gotoxy(4,11);cputs("Largest XMS Memory Block  :");
  507.    gotoxy(4,12);cputs("XMS Version               :");
  508.    gotoxy(4,13);cputs("XMS Driver Version        :");
  509.    gotoxy(4,14);cputs("A20 Address Line          :");
  510.    gotoxy(4,15);cputs("High Memory Area          :");
  511.    gotoxy(4,17);cputs("'386 Extended Memory Manager :");
  512.    gotoxy(46,4);cputs("Total EMS Memory    :");
  513.    gotoxy(46,5);cputs("Free EMS Memory     :");
  514.    gotoxy(46,6);cputs("EMS Version         :");
  515.    gotoxy(46,7);cputs("EMS Address Page    :");
  516.    gotoxy(46,8);cputs("Handles in Use      :");
  517.    gotoxy(46,10);cputs("DPMI Installed      :");
  518.    gotoxy(46,11);cputs("DPMI Version        :");
  519.    gotoxy(46,13);cputs("VCPI Installed      :");
  520.    gotoxy(46,14);cputs("VCPI Version        :");
  521.  
  522.    textattr(INFO);                        
  523.  
  524.    gotoxy(32,4);                        
  525.    cprintf("%dK",getRAM());             // display total conventional memory
  526.  
  527.    gotoxy(32,5);                        
  528.    cprintf("%luK",farcoreleft()/1024);  // display free conventional memory
  529.  
  530.    if(cpu > 3) {                        // check for '286 or higher
  531.      gotoxy(32,7);              
  532.      ext=getExt();                      // get total extended memory
  533.      cprintf("%ldK",ext);               // display total extended memory
  534.      gotoxy(32,8);                  
  535.      exta=getAvailExt();                // get available extended memory
  536.      cprintf("%ldK",exta);              // display available extended memory
  537.      if(chkXMS()) {                     // check for XMS driver 
  538.        if(!getXMSa(&xmsa,&xmsb)) {      // get XMS memory
  539.          gotoxy(32,10);                     
  540.          cprintf("%ldK",xmsa);          // display available XMS memory
  541.          gotoxy(32,11);
  542.          cprintf("%ldK",xmsb);          // display largest XMS block
  543.        }
  544.    
  545.        if(!getXMSv(&major,&minor,&drvMaj,&drvMin)) {  // get XMS version
  546.          gotoxy(32,12);
  547.          cprintf("%d.%02d",major,minor);   // display XMS version
  548.          gotoxy(32,13);
  549.          cprintf("%d.%02d",drvMaj,drvMin); // display XMS driver version
  550.        }
  551.  
  552.        if(!getXMSi(&HMA,&A20)) {        // get XMS information
  553.          textattr(CHECK);                  
  554.          gotoxy(32,14);
  555.          if(A20)                        // display if A20 enabled
  556.            cputs("Enabled");
  557.          else
  558.            cputs("Not Enabled");
  559.          gotoxy(32,15);
  560.          if(HMA)                        // display if HMA available
  561.            cputs("Available");
  562.          else
  563.            cputs("Not Available");
  564.          textattr(INFO);                  
  565.        }
  566.      }
  567.    }
  568.  
  569.    if(chkEMS()) {                       // check for EMS memory
  570.      if(!getEMS(&ems,&emsa)) {          // get EMS memory
  571.        gotoxy(68,4);
  572.        cprintf("%dK",ems*16);           // display total EMS memory
  573.        gotoxy(68,5);
  574.        cprintf("%dK",emsa*16);          // display available EMS memory
  575.      }
  576.  
  577.      if(!getEMSv(&major,&minor)) {      // get EMS driver version
  578.        gotoxy(68,6);
  579.        cprintf("%d.%02d",major,minor);  // display EMS driver version
  580.      }
  581.  
  582.      if(!getEMSi(&handles,&segment)) {  // get EMS information
  583.        gotoxy(68,7);
  584.        cprintf("%X",segment);           // display EMS page frame address
  585.        gotoxy(68,8);
  586.        cprintf("%d",handles);           // display handles used
  587.      }
  588.    }
  589.    else {
  590.      gotoxy(68,4);
  591.      cputs("0K");                     // display total EMS memory
  592.      gotoxy(68,5);
  593.      cputs("0K");                     // display available EMS memory
  594.    }
  595.  
  596.    if(cpu > 3) {                        // check for '286 or higher
  597.      if(chkDPMI()) {                    // check for DPMI driver
  598.        textattr(CHECK);                    
  599.        gotoxy(68,10);
  600.        cputs("yes");
  601.        textattr(INFO);                    
  602.        if(!getDPMIv(&major,&minor)) {   // get DPMI version
  603.          gotoxy(68,11);
  604.          cprintf("%d.%02d",major,minor);// display DPMI version
  605.        }
  606.      }
  607.      else {
  608.        textattr(CHECK);                    
  609.        gotoxy(68,10);
  610.        cputs("no");
  611.        textattr(INFO);                    
  612.      }
  613.    }
  614.    else {
  615.      textattr(CHECK);                    
  616.      gotoxy(68,10);
  617.      cputs("no");
  618.      textattr(INFO);                    
  619.    }
  620.  
  621.    emm = 0;                           // default to EMM not installed
  622.    if(cpu > 4 && chkXMS()) {          // check for '386 or higher and XMS
  623.      emm=getEMM();                    // get '386 Extended Memory Manager type
  624.      gotoxy(35,17);
  625.      switch (emm) {
  626.        case 1:
  627.          cputs("Quadtel QMAPS or Hewlett-Packard HPMM.SYS");
  628.          break;
  629.        case 2:
  630.          cputs("Microsoft EMM386.EXE");
  631.          break;
  632.        case 3:
  633.          cputs("Microsoft Windows 3.x WIN386.EXE");
  634.          break;
  635.        case 4:
  636.          cputs("DR-DOS 6.0 EMM386.SYS");
  637.          break;
  638.        case 5:
  639.          cputs("Qualitas 386MAX");
  640.          break;
  641.        case 6:
  642.          cputs("V Communication's Memory Commander");
  643.          break;
  644.        case 7:
  645.          cputs("Quarterdeck QEMM-386");
  646.          break;
  647.        case 8:
  648.          cputs("Helix Netroom RM386");
  649.          break;
  650.        default:
  651.          cputs("Unknown or 386 Memory Manager not installed!");
  652.      }
  653.    }
  654.  
  655.    if(emm > 0) {                        // check for extended memory manager
  656.      if(chkVCPI()) {                    // check for VCPI driver
  657.        textattr(CHECK);                    
  658.        gotoxy(68,13);
  659.        cputs("yes");
  660.        textattr(INFO);                    
  661.        getVCPIv(&major,&minor);         // get VCPI version
  662.        gotoxy(68,14);
  663.        cprintf("%d.%02d",major,minor);  // display VCPI version
  664.      }
  665.      else {
  666.        textattr(CHECK);                    
  667.        gotoxy(68,13);
  668.        cputs("no");
  669.        textattr(INFO);                    
  670.      }
  671.    }
  672.    else {
  673.      textattr(CHECK);                      
  674.      gotoxy(68,13);
  675.      cputs("no");
  676.      textattr(INFO);                      
  677.    }
  678.  
  679.    getch();                             // wait for keystroke
  680.    textattr(CLEAR);                        
  681.    clrscr();                            // clear screen
  682.  
  683.    /**********************************************************************\
  684.    *                   Display Video Information Screen                   *
  685.    \**********************************************************************/ 
  686.  
  687.    textattr(LABELS);
  688.    clrscr();    
  689.    gotoxy(38,2);cputs("Video");
  690.    gotoxy(17,6);cputs("Video Adapter Type     :");
  691.    gotoxy(17,7);cputs("Display Type           :");
  692.    gotoxy(17,10);cputs("VESA Support Installed :");
  693.    gotoxy(17,11);cputs("VESA Version           :");
  694.    gotoxy(17,12);cputs("Video Memory           :");
  695.  
  696.    textattr(INFO);                        
  697.  
  698.    gotoxy(42,6);
  699.  
  700.    card=getVideo();                     // get video card type
  701.  
  702.    switch (card) {
  703.      case 1:
  704.        cputs("MDA - Monochrome Display Adapter");
  705.        break;
  706.      case 2:
  707.        cputs("HGA - Hercules Graphics Adapter");
  708.        break;
  709.      case 3:
  710.        cputs("CGA - Color Graphics Adapter");
  711.        break;
  712.      case 4:
  713.        cputs("EGA - Enhanced Graphics Adapter");
  714.        break;
  715.      case 5:
  716.        cputs("MCGA - Multi-Color Graphics Array");
  717.        break;
  718.      case 6:
  719.        cputs("VGA - Video Graphics Array");
  720.        break;
  721.      case 7:
  722.        cputs("XGA - Extended Graphics Adapter");
  723.    }
  724.  
  725.    if(card > 4) {                       // check for EGA or higher
  726.      gotoxy(42,7);
  727.      if(getCRT())
  728.        cputs("Monochrome");
  729.      else
  730.        cputs("Color");
  731.    }
  732.  
  733.    if(card >= 6) {                      // check for VGA
  734.      if(getVESA(&major,&minor,&vram)) { // check for VESA support
  735.        textattr(CHECK);                    
  736.        gotoxy(42,10);
  737.        cputs("yes");
  738.        textattr(INFO);                    
  739.        gotoxy(42,11);
  740.        cprintf("%d.%d",major,minor);    // display VESA version
  741.        if(major >= 1 && minor > 0) {    // check for VESA 1.1 or higher
  742.          gotoxy(42,12);
  743.          cprintf("%dK",vram);           // display Video RAM
  744.        }  
  745.      }
  746.      else {
  747.        textattr(CHECK);                    
  748.        gotoxy(42,10);
  749.        cputs("no");
  750.        textattr(INFO);                    
  751.      }
  752.    }
  753.    else {
  754.      textattr(CHECK);                      
  755.      gotoxy(42,10);
  756.      cputs("no");
  757.      textattr(INFO);                      
  758.    }
  759.  
  760.    getch();                             // wait for keystroke
  761.    textattr(CLEAR);                        
  762.    clrscr();                            // clear screen
  763.  
  764.    /**********************************************************************\
  765.    *                    Display DOS Information Screen                    *
  766.    \**********************************************************************/ 
  767.  
  768.    textattr(LABELS);
  769.    clrscr();   
  770.    gotoxy(40,2);cputs("DOS");
  771.    gotoxy(4,4);cputs("DOS Version    :");
  772.    gotoxy(4,5);cputs("DOS OEM Number :");
  773.    gotoxy(4,6);cputs("DOS Loaded     :");
  774.    gotoxy(50,3);cputs("ANSI.SYS installed     :");
  775.    gotoxy(50,4);cputs("APPEND.EXE installed   :");
  776.    gotoxy(50,5);cputs("ASSIGN.COM installed   :");
  777.    gotoxy(50,6);cputs("DISPLAY.SYS installed  :");
  778.    gotoxy(50,7);cputs("DOSKEY.COM installed   :");
  779.    gotoxy(50,8);cputs("DRIVER.SYS installed   :");
  780.    gotoxy(50,9);cputs("EGA.SYS installed      :");
  781.    gotoxy(50,10);cputs("GRAFTABL.COM installed :");
  782.    gotoxy(50,11);cputs("GRAPHICS.COM installed :");
  783.    gotoxy(50,12);cputs("KEYB.COM installed     :");
  784.    gotoxy(50,13);cputs("NLSFUNC.EXE installed  :");
  785.    gotoxy(50,14);cputs("PRINT.COM installed    :");
  786.    gotoxy(50,15);cputs("SHARE.EXE installed    :");
  787.    gotoxy(50,16);cputs("SHELLB.COM installed   :");
  788.    gotoxy(50,17);cputs("XMS2EMS.SYS installed  :");
  789.  
  790.    textattr(INFO);                        
  791.  
  792.    getDosV(&major,&minor);              // get DOS version
  793.    oem=getDosOem();                     // get DOS OEM number
  794.    drdos=getDrDosV();                   // get DR-DOS type
  795.  
  796.    gotoxy(21,4);
  797.    cprintf("%d.%02d",major,minor);      // display DOS version
  798.  
  799.    gotoxy(26,4);
  800.    if(major==6 && !oem)                 // check for IBM DOS 6.1
  801.      cputs("(IBM DOS 6.1)");
  802.  
  803.    if(drdos) {                          // check for DR-DOS
  804.      switch (drdos) {
  805.        case 0x01:
  806.          cputs("(Multi-User DR-DOS)");
  807.          break;
  808.        case 0x60:
  809.          cputs("(DOS Plus)");
  810.          break;
  811.        case 0x63:
  812.          cputs("(DR-DOS 3.41)");
  813.          break;
  814.        case 0x64:
  815.          cputs("(DR-DOS 3.42)");
  816.          break;
  817.        case 0x65:
  818.          cputs("(DR-DOS 5.0)");
  819.          break;
  820.        case 0x67:
  821.          cputs("(DR-DOS 6.0)");
  822.          break;
  823.        case 0x70:
  824.          cputs("(PalmDOS)");
  825.          break;
  826.        case 0x71:
  827.          cputs("(DR-DOS 6.0)");
  828.          break;
  829.        case 0x72:
  830.          cputs("(Novell DOS 7.0)");
  831.      }
  832.    }
  833.  
  834.    if(get4DosV(&major,&minor))          // check for 4DOS
  835.      cprintf("(4DOS %d.%02d)",major,minor);
  836.  
  837.    gotoxy(21,5);
  838.    cprintf("%02Xh",oem);                // display OEM number
  839.    if(!drdos) {
  840.      gotoxy(26,5);
  841.      switch (oem) {
  842.        case 0x00:
  843.          cputs("(PC-DOS)");
  844.          break;
  845.        case 0x01:
  846.          cputs("(Compaq DOS)");
  847.          break;
  848.        case 0x04:
  849.          cputs("(AT&T DOS)");
  850.          break;
  851.        case 0x05:
  852.          cputs("(Zenith DOS)");
  853.          break;
  854.        case 0x06:
  855.          cputs("(Hewlett-Packard DOS)");
  856.          break;
  857.        case 0x0D:
  858.          cputs("(Packard-Bell DOS)");
  859.          break;
  860.        case 0x16:
  861.          cputs("(DEC DOS)");
  862.          break;
  863.        case 0x23:
  864.          cputs("(Olivetti DOS)");
  865.          break;
  866.        case 0x29:
  867.          cputs("(Toshiba DOS)");
  868.          break;
  869.        case 0x4D:
  870.          cputs("(Hewlett-Packard DOS)");
  871.          break;
  872.        case 0xFF:
  873.          cputs("(MS-DOS)");
  874.      }
  875.    }
  876.  
  877.    textattr(CHECK);                        
  878.    gotoxy(21,6);
  879.    if(major > 4 || drdos > 0x65) {      // check for DOS 5.0+ or DR-DOS 6.0+
  880.      if(chkDosHigh())                   // see if DOS is loaded in high memory
  881.        cputs("High");
  882.      else
  883.        cputs("Low");
  884.    }
  885.    else
  886.      cputs("Low");
  887.  
  888.    gotoxy(75,3);
  889.    if(chkAnsi())                        // check for ANSI.SYS
  890.      cputs("yes");
  891.    else
  892.      cputs("no");
  893.    gotoxy(75,4);
  894.    if(chkAppend())                      // check for APPEND.EXE
  895.      cputs("yes");
  896.    else
  897.      cputs("no");
  898.    gotoxy(75,5);
  899.    if(chkAssign())                      // check for ASSIGN.COM
  900.      cputs("yes");
  901.    else
  902.      cputs("no");
  903.    gotoxy(75,6);
  904.    if(chkDisplay())                     // check for DISPLAY.SYS
  905.      cputs("yes");
  906.    else
  907.      cputs("no");
  908.    gotoxy(75,7);
  909.    if(chkDoskey())                      // check for DOSKEY.COM
  910.      cputs("yes");
  911.    else
  912.      cputs("no");
  913.    gotoxy(75,8);
  914.    if(chkDriver())                      // check for DRIVER.SYS
  915.      cputs("yes");
  916.    else
  917.      cputs("no");
  918.    gotoxy(75,9);
  919.    if(chkEGA())                         // check for EGA.SYS
  920.      cputs("yes");
  921.    else
  922.      cputs("no");
  923.    gotoxy(75,10);
  924.    if(chkGraftabl())                    // check for GRAFTBL.COM
  925.      cputs("yes");
  926.    else
  927.      cputs("no");
  928.    gotoxy(75,11);
  929.    if(chkGraphics())                    // check for GRAPHICS.COM
  930.      cputs("yes");
  931.    else 
  932.      cputs("no");
  933.    gotoxy(75,12);
  934.    if(chkKeyb())                        // check for KEYB.COM
  935.      cputs("yes");
  936.    else
  937.      cputs("no");
  938.    gotoxy(75,13);
  939.    if(chkNlsfunc())                     // check for NLSFUNC.EXE
  940.      cputs("yes");
  941.    else
  942.      cputs("no");
  943.    gotoxy(75,14);
  944.    if(chkPrint())                       // check for PRINT.COM
  945.      cputs("yes");
  946.    else
  947.      cputs("no");
  948.    gotoxy(75,15);
  949.    if(chkShare())                       // check for SHARE.EXE
  950.      cputs("yes");
  951.    else
  952.      cputs("no");
  953.    gotoxy(75,16);
  954.    if(chkShellb())                      // check for SHELLB.COM
  955.      cputs("yes");
  956.    else
  957.      cputs("no");
  958.    gotoxy(75,17);
  959.    if(chkXMA2EMS())                     // check for XMA2EMS.SYS
  960.      cputs("yes");
  961.    else
  962.      cputs("no");
  963.  
  964.    textattr(INFO);                        
  965.  
  966.    getch();                             // wait for keystroke
  967.    textattr(CLEAR);                        
  968.    clrscr();                            // clear screen
  969.  
  970.    /**********************************************************************\
  971.    *                   Display Mouse Information Screen                   *
  972.    \**********************************************************************/ 
  973.  
  974.    textattr(LABELS);
  975.    clrscr();   
  976.    gotoxy(39,2);cputs("Mouse");
  977.    gotoxy(25,6);cputs("Mouse Installed   :");
  978.    gotoxy(25,7);cputs("Mouse Type        :");
  979.    gotoxy(25,8);cputs("Driver Version    :");
  980.    gotoxy(25,9);cputs("Number of Buttons :");
  981.    gotoxy(25,10);cputs("Mouse IRQ         :");
  982.  
  983.    textattr(INFO);                        
  984.  
  985.    buttons=chkMouse();                  // check for mouse and get buttons
  986.  
  987.    if(buttons) {
  988.      textattr(CHECK);                      
  989.      gotoxy(45,6);
  990.      cputs("yes");
  991.      textattr(INFO);                      
  992.      gotoxy(45,7);
  993.      getMouseI(&type,&irq);             // get mouse information
  994.      switch (type) {                    // display mouse type
  995.        case 1:
  996.          cputs("Bus Mouse");
  997.          break;
  998.        case 2:
  999.          cputs("Serial Mouse");
  1000.          break;
  1001.        case 3:
  1002.          cputs("Inport Mouse");
  1003.          break;
  1004.        case 4:
  1005.          cputs("PS/2 Mouse");
  1006.          break;
  1007.        case 5:
  1008.          cputs("Hewlett-Packard Mouse");
  1009.          break;
  1010.      }
  1011.      getMouseV(&major,&minor);          // get mouse driver version
  1012.      gotoxy(45,8);
  1013.      cprintf("%d.%02d",major,minor);    // display mouse driver version
  1014.      gotoxy(45,9);
  1015.      cprintf("%d",buttons);             // display number of buttons
  1016.      gotoxy(45,10);
  1017.      if(type==4)                        // display mouse IRQ
  1018.        cputs("PS/2 Port");
  1019.      else
  1020.        cprintf("%d",irq);
  1021.    }
  1022.    else {
  1023.      textattr(CHECK);                      
  1024.      gotoxy(45,6);
  1025.      cputs("no");
  1026.      textattr(INFO);                      
  1027.    }
  1028.  
  1029.    getch();                             // wait for keystroke
  1030.    textattr(CLEAR);                        
  1031.    clrscr();                            // clear screen
  1032.  
  1033.    /**********************************************************************\
  1034.    *                  Display Shell Information Screen                    *
  1035.    \**********************************************************************/ 
  1036.  
  1037.    textattr(LABELS);
  1038.    clrscr();    
  1039.    gotoxy(28,2);cputs("TSR's, Drivers and Shells");
  1040.    gotoxy(4,4);cputs("Windows Resident   :");
  1041.    gotoxy(4,5);cputs("Windows Version    :");
  1042.    gotoxy(4,6);cputs("Windows Mode       :");
  1043.    gotoxy(4,8);cputs("DESQview Resident  :");
  1044.    gotoxy(4,9);cputs("DESQview Version   :");
  1045.    gotoxy(4,11);cputs("DOS Shell Resident :");
  1046.    gotoxy(4,12);cputs("CPTask Resident    :");
  1047.    gotoxy(4,13);cputs("Taskmax Resident   :");
  1048.    gotoxy(48,4);cputs("SMARTDrive Installed   :");
  1049.    gotoxy(48,5);cputs("PC-Cache Installed     :");
  1050.    gotoxy(48,6);cputs("PC-Kwik Installed      :");
  1051.    gotoxy(48,7);cputs("Ncache Installed       :");
  1052.    gotoxy(48,8);cputs("Hyperdisk Installed    :");
  1053.    gotoxy(48,10);cputs("DoubleSpace Installed  :");
  1054.    gotoxy(48,11);cputs("SpaceManager Installed :");
  1055.    gotoxy(48,12);cputs("Stacker Installed      :");
  1056.    gotoxy(48,14);cputs("MSCDEX Installed       :");
  1057.    gotoxy(48,15);cputs("MSCDEX Version         :");
  1058.  
  1059.    textattr(CHECK);                        
  1060.  
  1061.    gotoxy(25,4);
  1062.    if(getWinV(&major,&minor,&mode)) {   // check for Windows
  1063.      cputs("yes");
  1064.      textattr(INFO);                      
  1065.      gotoxy(25,5); 
  1066.      cprintf("%d.%02d",major,minor);    // display Windows version
  1067.      gotoxy(25,6);
  1068.      if(mode)                           // display Windows mode
  1069.        cputs("Enhanced");
  1070.      else
  1071.        cputs("Standard");
  1072.      textattr(CHECK);                      
  1073.    }
  1074.    else 
  1075.      cputs("no"); 
  1076.  
  1077.    gotoxy(25,8);
  1078.    if(getDESQv(&major,&minor)) {        // check for DESQview
  1079.      cputs("yes");
  1080.      textattr(INFO);                      
  1081.      gotoxy(25,9);
  1082.      cprintf("%d.%02d",major,minor);    // display DESQview version
  1083.      textattr(CHECK);                      
  1084.    }
  1085.    else 
  1086.      cputs("no"); 
  1087.  
  1088.    gotoxy(25,11);
  1089.    if(DosShell())                       // check for Microsoft DOS Shell
  1090.      cputs("yes");
  1091.    else
  1092.      cputs("no");
  1093.  
  1094.    gotoxy(25,12);
  1095.    if(CPTask())                         // check for PCTools CPTask
  1096.      cputs("yes");
  1097.    else
  1098.      cputs("no");
  1099.  
  1100.    gotoxy(25,13);
  1101.    if(TaskMax())                        // check for DR-DOS TaskMax
  1102.      cputs("yes");
  1103.    else
  1104.      cputs("no");
  1105.  
  1106.    gotoxy(73,4);
  1107.    if(SmartDrv())                       // check for Microsoft SmartDrv
  1108.      cputs("yes");
  1109.    else
  1110.      cputs("no");
  1111.  
  1112.    gotoxy(73,5);
  1113.    if(PcCache())                        // check for PCTools PC-Cache
  1114.      cputs("yes");
  1115.    else
  1116.      cputs("no");
  1117.  
  1118.    gotoxy(73,6);
  1119.    if(PcKwik())                         // check for PC-Kwik
  1120.      cputs("yes");
  1121.    else
  1122.      cputs("no");
  1123.  
  1124.    gotoxy(73,7);
  1125.    if(Ncache())                         // check for Norton Ncache
  1126.      cputs("yes");
  1127.    else
  1128.      cputs("no");
  1129.  
  1130.    gotoxy(73,8);
  1131.    if(HyperDisk())                      // check for HyperDisk 
  1132.      cputs("yes");
  1133.    else
  1134.      cputs("no");
  1135.  
  1136.    dblspace=DblSpace();                 // check for DoubleSpace
  1137.    gotoxy(73,10);                       
  1138.    if(dblspace)                         
  1139.      cputs("yes");
  1140.    else
  1141.      cputs("no");
  1142.  
  1143.    gotoxy(73,11);
  1144.    if(Spaceman())                       // check for Spacemanager
  1145.      cputs("yes");
  1146.    else
  1147.      cputs("no");
  1148.  
  1149.    stacker=Stacker();                   // check for Stacker
  1150.    gotoxy(73,12);
  1151.    if(stacker)
  1152.      cputs("yes");                      
  1153.    else
  1154.      cputs("no");
  1155.  
  1156.    mscdex=MSCDEX(&major,&minor);        // check for CD-ROM extension
  1157.    gotoxy(73,14);
  1158.    if(mscdex) {                         
  1159.      cputs("yes");
  1160.      textattr(INFO);                      
  1161.      gotoxy(73,15);
  1162.      cprintf("%d.%02d",major,minor);    // display MSCDEX version
  1163.    }
  1164.    else
  1165.      cputs("no");
  1166.  
  1167.    getch();                             // wait for keystroke
  1168.    textattr(CLEAR);                        
  1169.    clrscr();                            // clear screen
  1170.  
  1171.    /**********************************************************************\
  1172.    *                  Display Drives Information Screen                   *
  1173.    \**********************************************************************/ 
  1174.    
  1175.    textattr(LABELS);      
  1176.    clrscr();   
  1177.    gotoxy(38,2);cputs("Drives");
  1178.    gotoxy(3,3);cputs("Drive     Type                                     Free Space    Total Space");
  1179.    gotoxy(3,4);cputs("─────     ───────────────────────────────────────  ──────────    ───────────");
  1180.  
  1181.    textattr(INFO);                        
  1182.  
  1183.    x=5;
  1184.    y=5;
  1185.  
  1186.    gotoxy(x,y);
  1187.    cputs("                          ");
  1188.  
  1189.    if(!getFlopType(&a,&b)) {            // get floppy drive type
  1190.      gotoxy(x,y);
  1191.      switch (a) {
  1192.        case 0:
  1193.          break;                 
  1194.        case 1:
  1195.          cputs("A:");
  1196.          gotoxy(x+8,y);
  1197.          cputs("Floppy Drive, 5¼ 360K DD");
  1198.          y++;
  1199.          break;
  1200.        case 2:
  1201.          cputs("A:");
  1202.          gotoxy(x+8,y);
  1203.          cputs("Floppy Drive, 5¼ 1.2M HD");
  1204.          y++;
  1205.          break;
  1206.        case 3:
  1207.          cputs("A:");
  1208.          gotoxy(x+8,y);
  1209.          cputs("Floppy Drive, 3½ 720K DD");
  1210.          y++;
  1211.          break;
  1212.        case 4:
  1213.          cputs("A:");
  1214.          gotoxy(x+8,y);
  1215.          cputs("Floppy Drive, 3½ 1.44M HD");
  1216.          y++;
  1217.          break;
  1218.        case 5:
  1219.          cputs("A:");
  1220.          gotoxy(x+8,y);
  1221.          cputs("Floppy Drive, 3½ 2.88M ED");
  1222.          y++;
  1223.        default:
  1224.          cputs("A:");
  1225.          gotoxy(x+8,y);
  1226.          cputs("Unknown Floppy Drive Type");
  1227.          y++;
  1228.      }
  1229.      gotoxy(x,y);
  1230.      switch (b) {
  1231.        case 0:
  1232.          break;
  1233.        case 1:
  1234.          cputs("B:");
  1235.          gotoxy(x+8,y);
  1236.          cputs("Floppy Drive, 5¼ 360K DD");
  1237.          y++;
  1238.          break;
  1239.        case 2:
  1240.          cputs("B:");
  1241.          gotoxy(x+8,y);
  1242.          cputs("Floppy Drive, 5¼ 1.2M HD");
  1243.          y++;
  1244.          break;
  1245.        case 3:
  1246.          cputs("B:");
  1247.          gotoxy(x+8,y);
  1248.          cputs("Floppy Drive, 3½ 720K DD");
  1249.          y++;
  1250.          break;
  1251.        case 4:
  1252.          cputs("B:");
  1253.          gotoxy(x+8,y);
  1254.          cputs("Floppy Drive, 3½ 1.44M HD");
  1255.          y++;
  1256.          break;
  1257.        case 5:
  1258.          cputs("B:");
  1259.          gotoxy(x+8,y);
  1260.          cputs("Floppy Drive, 3½ 2.88M ED");
  1261.          y++;
  1262.        default:
  1263.          cputs("B:");
  1264.          gotoxy(x+8,y);
  1265.          cputs("Unknown Floppy Drive Type");
  1266.          y++;
  1267.      }
  1268.    }
  1269.  
  1270.    num = 3;                                      // starting drive
  1271.    lastdrive = getAvailDrvs();                   // get lastdrive
  1272.  
  1273. drvinfo:
  1274.    
  1275.    while (num<=lastdrive && num<=26 && y<=21) {     
  1276.      code = num + 64;
  1277.      sprintf(drive,"%c",code);
  1278.      if(isCDROM(drive)) {                        // check for CD-ROM drive
  1279.        gotoxy(x,y);
  1280.        cprintf("%c:",code);
  1281.        gotoxy(x+8,y);
  1282.        cputs("CD-ROM Drive");
  1283.        y++;
  1284.        num++;
  1285.        continue;
  1286.        }
  1287.      if(dblspace) {                              // check for DblSpace drive
  1288.        if(isDblSpace(drive)) {
  1289.          gotoxy(x,y);
  1290.          cprintf("%c:",code);
  1291.          gotoxy(x+8,y);
  1292.          cputs("DblSpace Drive");
  1293.          if(!getDrvSpace(drive,&SecPerClus,&FreeClus,&BytesPerSec,&TotalClus)) {
  1294.            ClusSize=BytesPerSec * SecPerClus;          // calc. cluster size
  1295.            FreeSpace=(FreeClus * ClusSize) / 1024000;  // calc. available space
  1296.            TotalSpace=TotalClus * ClusSize / 1024000;  // calc. total space
  1297.            gotoxy(x+51,y);
  1298.            cprintf("%5ldM",FreeSpace);             // display available space
  1299.            gotoxy(x+66,y);
  1300.            cprintf("%5ldM",TotalSpace);            // display total space
  1301.          }
  1302.          y++;
  1303.          num++;
  1304.          continue;
  1305.        }
  1306.      }
  1307.      if(stacker) {                               // check for Stacker drive
  1308.        if(isStacker(drive)) {
  1309.          gotoxy(x,y);
  1310.          cprintf("%c:",code);
  1311.          gotoxy(x+8,y);
  1312.          cputs("Stacker Drive");
  1313.          if(!getDrvSpace(drive,&SecPerClus,&FreeClus,&BytesPerSec,&TotalClus)) {
  1314.            ClusSize=BytesPerSec * SecPerClus;          // calc. cluster size
  1315.            FreeSpace=(FreeClus * ClusSize) / 1024000;  // calc. available space
  1316.            TotalSpace=TotalClus * ClusSize / 1024000;  // calc. total space
  1317.            gotoxy(x+51,y);
  1318.            cprintf("%5ldM",FreeSpace);             // display available space
  1319.            gotoxy(x+66,y);
  1320.            cprintf("%5ldM",TotalSpace);            // display total space
  1321.          }  
  1322.          y++;
  1323.          num++;
  1324.          continue;
  1325.        }
  1326.      }
  1327.      if(!chkRemovable(drive,&removable)) {       // check for fixed disk
  1328.        if(removable) {
  1329.          gotoxy(x,y);
  1330.          cprintf("%c:",code);
  1331.          gotoxy(x+8,y);
  1332.          cputs("Fixed Disk");
  1333.          if(!getDrvSpace(drive,&SecPerClus,&FreeClus,&BytesPerSec,&TotalClus)) {
  1334.            ClusSize=BytesPerSec * SecPerClus;          // calc. cluster size
  1335.            FreeSpace=(FreeClus * ClusSize) / 1024000;  // calc. available space
  1336.            TotalSpace=TotalClus * ClusSize / 1024000;  // calc. total space
  1337.            gotoxy(x+51,y);
  1338.            cprintf("%5ldM",FreeSpace);             // display available space
  1339.            gotoxy(x+66,y);
  1340.            cprintf("%5ldM",TotalSpace);            // display total space
  1341.          }
  1342.          if(!getDrvInfo(drive,&cyl,&heads,§ors)) { // get fixed disk info
  1343.            y++;
  1344.            gotoxy(x+10,y);
  1345.            cprintf("%d Heads, %d Cylinders, %d Sec/Track",heads,cyl,sectors);
  1346.          }
  1347.          y++;
  1348.          num++;
  1349.          continue;
  1350.        }
  1351.      else
  1352.        gotoxy(x,y);
  1353.        cprintf("%c:",code);
  1354.        gotoxy(x+8,y);
  1355.        cputs("Removable");
  1356.        y++;
  1357.        num++;
  1358.        continue;
  1359.      }
  1360.      if(!chkRemote(drive,&remote)) {             // check for network drive
  1361.        if(remote) {
  1362.          gotoxy(x,y);
  1363.          cprintf("%c:",code);
  1364.          gotoxy(x+8,y);
  1365.          cputs("Remote Drive");
  1366.          if(!getDrvSpace(drive,&SecPerClus,&FreeClus,&BytesPerSec,&TotalClus)) {
  1367.            ClusSize=BytesPerSec * SecPerClus;          // calc. cluster size
  1368.            FreeSpace=(FreeClus * ClusSize) / 1024000;  // calc. available space
  1369.            TotalSpace=TotalClus * ClusSize / 1024000;  // calc. total space
  1370.            gotoxy(x+51,y);
  1371.            cprintf("%5ldM",FreeSpace);             // display available space
  1372.            gotoxy(x+66,y);
  1373.            cprintf("%5ldM",TotalSpace);            // display total space
  1374.          }
  1375.          y++;
  1376.        }
  1377.      }
  1378.      num++;
  1379.    }
  1380.    
  1381.    getch();                                 // wait for keystroke
  1382.  
  1383.    if(num<=lastdrive && num<=26) {          // see if a second page is needed
  1384.      y = 5;                                 // reset y-axis
  1385.      textattr(LABELS);      
  1386.      clrscr();   
  1387.      gotoxy(38,2);cputs("Drives");
  1388.      gotoxy(3,3);cputs("Drive     Type                                     Free Space    Total Space");
  1389.      gotoxy(3,4);cputs("─────     ───────────────────────────────────────  ──────────    ───────────");
  1390.      textattr(INFO);                          
  1391.      goto drvinfo;                          // display remaining drive info
  1392.    }
  1393.  
  1394.    textattr(CLEAR);                        
  1395.    clrscr();                            // clear screen
  1396.  
  1397.    /**********************************************************************\
  1398.    *                  Display Network Information Screen                  *
  1399.    \**********************************************************************/ 
  1400.  
  1401.    textattr(LABELS);
  1402.    clrscr();   
  1403.    gotoxy(38,2);cputs("Network");
  1404.    gotoxy(4,4);cputs("IPX Installed      :");
  1405.    gotoxy(4,6);cputs("Netbios Installed  :");
  1406.    gotoxy(4,8);cputs("Shell Installed    :");
  1407.    gotoxy(4,9);cputs("Shell Version      :");
  1408.    gotoxy(4,10);cputs("Shell Located in   :");
  1409.    gotoxy(4,12);cputs("Server Name        :");
  1410.    gotoxy(4,13);cputs("Netware Version    :");
  1411.    gotoxy(4,15);cputs("User Name          :");
  1412.    gotoxy(4,16);cputs("Login Date & Time  :");
  1413.    gotoxy(41,4);cputs("Number of Connections Supported :");
  1414.    gotoxy(41,5);cputs("Number of Connections in Use    :");
  1415.    gotoxy(41,6);cputs("Peak Connections Used           :");
  1416.    gotoxy(41,7);cputs("Maximum Connected Volumes       :");
  1417.  
  1418.    textattr(CHECK);                        
  1419.  
  1420.    gotoxy(25,4);
  1421.    if(chkIPX())                         // check for IPX
  1422.      cputs("yes");
  1423.    else
  1424.      cputs("no");
  1425.   
  1426.    gotoxy(25,6);
  1427.    if(Netbios())                        // check for Netbios
  1428.      cputs("yes");
  1429.    else
  1430.      cputs("no");
  1431.  
  1432.    gotoxy(25,8);
  1433.    if(NetShell(&major,&minor,&rev,&type)) {   // check for NetShell
  1434.      cputs("yes");
  1435.      textattr(INFO);                            
  1436.      gotoxy(25,9);
  1437.      cprintf("%d.%02d.%02d",major,minor,rev); // display NetShell Version
  1438.      gotoxy(25,10);
  1439.      switch (type) {                          // display memory type
  1440.        case 0:
  1441.          cputs("Conventional Memory");
  1442.          break;
  1443.        case 1:
  1444.          cputs("Expanded Memory");
  1445.          break;
  1446.        case 2:
  1447.          cputs("Extended Memory");
  1448.      }
  1449.      server=getNetName(&version,&sub,&conn,&use,&vol,&peak); // get server info
  1450.      gotoxy(25,12);
  1451.      cputs(server);                     // display server name
  1452.      gotoxy(25,13);
  1453.      cprintf("%d.%02d",version,sub);    // display NetWare version
  1454.      gotoxy(75,4);
  1455.      cprintf("%d",conn);                // display number of connections
  1456.      gotoxy(75,5);
  1457.      cprintf("%d",use);                 // display connections in use
  1458.      gotoxy(75,6);
  1459.      cprintf("%d",peak);                // display peak connections used
  1460.      gotoxy(75,7);
  1461.      cprintf("%d",vol);                 // display number of volumes supported
  1462.      user=getUserName();                // get user name
  1463.      gotoxy(25,15);
  1464.      cputs(user);                       // display user name
  1465.      if(!getLoginTime(&year,&month,&day,&hour,&min,&sec,&week)) {
  1466.        gotoxy(25,16);
  1467.        cprintf("%02d-%02d-%d at %02d:%02d:%02d",month,day,year,hour,min,sec);
  1468.      }
  1469.    }
  1470.    else 
  1471.      cputs("no");
  1472.    
  1473.    getch();                             // wait for keystroke
  1474.  
  1475.    /**********************************************************************\
  1476.    *                                Exit                                  *
  1477.    \**********************************************************************/ 
  1478.  
  1479.    window(1,1,80,25);                   // reset screen coordinates
  1480.    textattr(CLEAR);                        
  1481.    clrscr();                            // clear screen
  1482.    printf("Demo complete.\n");
  1483.    _setcursortype(_NORMALCURSOR);       // restore cursor
  1484.    exit(0);
  1485.  
  1486. }
  1487.  
  1488.