home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / dos / compat / d_getdrv.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-09  |  496 b   |  23 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. /*
  3.  * D_GETDRV.C.
  4.  *
  5.  * Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
  6.  *
  7.  * This file is distributed WITHOUT ANY WARRANTY; without even the implied
  8.  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9.  *
  10.  */
  11.  
  12. #include <dos.h>
  13. #include <dpmi.h>
  14.  
  15. void _dos_getdrive(unsigned int *p_drive)
  16. {
  17.   __dpmi_regs r;
  18.  
  19.   r.h.ah = 0x19;
  20.   __dpmi_int(0x21, &r);
  21.   *p_drive = (unsigned int)r.h.al + 1;
  22. }
  23.