home *** CD-ROM | disk | FTP | other *** search
/ Shareware Supreme Volume 6 #1 / swsii.zip / swsii / 215 / DDJ9210.ZIP / DPMI.ASC < prev    next >
Text File  |  1992-08-26  |  1KB  |  82 lines

  1. _DPMI MEETS C++_
  2. by Frederick Hewett
  3.  
  4. Example 1
  5.  
  6. class DPMIhost {
  7. public:
  8.        DPMIhost(void);
  9.        DPMIerr getStatus(void);
  10.        boolean enterProtectedMode(uChar bitness);
  11.        void getVersion(uChar *major, uChar *minor);
  12.        uChar getSelectorDelta(void);
  13. }
  14.  
  15.  
  16.  
  17.  
  18. Example 2
  19.  
  20. class Block {
  21. public:
  22.       Block(uLong size);
  23.       ~Block(void);
  24.       boolean setSize(uLong);
  25.       uLong blockHandle(void);
  26.       uLong blockSize(void);
  27.       uLong blockBase(void);
  28. protected:
  29.       uLong handle;
  30.       uLong base;
  31.       uLong size;
  32. }
  33.  
  34.  
  35.  
  36.  
  37. Example 3
  38.  
  39. class AbstractSegment 
  40. {
  41. public:
  42.      virtual uLong segmentSize(void);
  43.      virtual uLong segmentBase(void);
  44.      virtual booelan queryProp(SegmentProp_t);
  45.      virtual operator+(SegmentProp_t)=0;
  46.      virtual operator-(SegmentProp_t)=0;
  47.      virtual boolean resize(uShort)=0;
  48.      virtual boolean move(uLong)=0;
  49.      void far *ptrTo(void);
  50. protected:
  51.      selector_t selector;
  52. }
  53.  
  54.  
  55.  
  56.  
  57. Example 4
  58.  
  59. typedef enum SegmentProperty {
  60.       present,
  61.       executable,
  62.       readable,
  63.       writable,
  64.       big,
  65.       expandDown
  66. } SegmentProp_t;  
  67.  
  68.  
  69.  
  70.  
  71. Example 5
  72.  
  73. if (myDataSeg + executable)
  74. {
  75. // operation succeeded
  76. }
  77. else
  78. {
  79. // operation failed
  80. }
  81.  
  82.