home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / b / bc3.zip / DPMIHOST.H < prev    next >
C/C++ Source or Header  |  1992-02-13  |  1KB  |  73 lines

  1. //
  2. // (c) Copyright 1992, Qualitas, Inc.  All Rights Reserved
  3. //
  4. // dpmihost.h - definition for DPMIhost class
  5. //
  6.  
  7. #include "dpmi.h"
  8. #include "dpmierr.h"
  9.  
  10. //
  11. // The DPMIhost class abstracts the detection of a DPMI host, and provides
  12. // methods that access host parameters and make the initial entry to 
  13. // protected mode.  
  14. //
  15. // Example:
  16. //
  17. //    #include "dpmihost.h"
  18. //
  19. //    void main(void)
  20. //    {
  21. //        DPMIhost dpmi;
  22. //
  23. //        if (dpmi.getStatus() == DPMIok)
  24. //        {
  25. //            dpmi.enterProtectedMode();
  26. //
  27. //
  28. //            . . . 
  29. //
  30. //
  31. //        }
  32. //        else
  33. //            cout << "DPMI host not present\n";
  34. //
  35. //    }
  36. //
  37. //
  38. class DPMIhost
  39. {
  40. public:
  41.     
  42.     DPMIhost(void);            // Constructor
  43.  
  44.                     // Use this member to verify detection
  45.                     // and validity of DPMI host in system
  46.     DPMIerr    getStatus() {return status;};
  47.  
  48.                     // This member is only for INITIAL
  49.                     // switch into protected mode
  50.     boolean    enterProtectedMode(uChar bitness=16);
  51.  
  52.                     // Retrieves version info
  53.     void    getVersion(uChar *major, uChar *minor)
  54.         { *major=majorVersion;
  55.           *minor=minorVersion;
  56.         };
  57.     uChar    getProcessor(void)    // Returns processor code x=2,3,4
  58.         { return processor;};    //   as in 80x86
  59.  
  60.     uChar    getSelectorDelta(void)    // Returns delta between consecutive
  61.         { return selectorDelta;};//selectors
  62.  
  63. protected:
  64.     uChar     majorVersion;
  65.     uChar     minorVersion;
  66.     uShort     flags;
  67.     uChar     processor;
  68.     uChar     selectorDelta;
  69.     uShort    nPrivateDataParas;
  70.     void    (far* entryAddress)();
  71.     DPMIerr    status;
  72. };
  73.