home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_11 / nelson / iobase.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-12  |  826 b   |  27 lines

  1. /* ----------------------------------------------------
  2.  *  Listing 2
  3.  *
  4.  *  iobase.cpp
  5.  *  IOCTL Base class implementation
  6.  * ------------------------------------------------- */
  7.  
  8. #include "iobase.h"
  9.  
  10. IoctlBase::IoctlBase()      {
  11.     _iregs.h.ah = 0x30;   //Get MS-DOS version
  12.     intdosx( &_iregs, &_oregs, &_sregs );
  13.     _dos.ver.major = _oregs.h.al;
  14.     _dos.ver.minor = _oregs.h.ah;
  15.     _dos_error = 0;
  16. }
  17. void IoctlBase::int21_44h( ioctl_cmd code )     {
  18.    /* DOS IOCTL (21h/44h) service call......  */
  19.     _iregs.h.ah = 0x44;   //function number
  20.     _iregs.h.al = code;   //subfunction
  21.     intdosx( &_iregs, &_oregs, &_sregs );
  22.     _dos_error = _oregs.x.cflag ? _oregs.x.ax : 0;
  23.     if( _dos_error )
  24.         IoctlError( _dos_error );
  25. }
  26. /* ----- End of File ------------------------------- */
  27.