delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/15/04:15:11

Xref: news2.mv.net comp.os.msdos.djgpp:5986
From: Thomas Demmer <demmer AT LSTM DOT Ruhr-UNI-Bochum DOT De>
Newsgroups: comp.os.msdos.djgpp
Subject: CD-ROM
Date: Mon, 15 Jul 1996 09:25:51 +0100
Organization: Lehrstuhl fuer Stroemungsmechanik
Lines: 49
Message-ID: <31EA008F.41C6@LSTM.Ruhr-UNI-Bochum.De>
NNTP-Posting-Host: bvb.lstm.ruhr-uni-bochum.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Somebody asked for the code to get the DEVICE name 
of a CD-ROM. I accidentally deleted his mail, so I 
abuse this list:
#include <stdio.h>
#include <stdlib.h>
#include <go32.h>
#include <dpmi.h>
#include <dos.h>


/* This is untested, use at your onw risk */

#define WHATEVER_U_NEED 5  /* should be < 16k */

int main(int argc, char **argv){
    __dpmi_regs r;
    char foo[WHATEVER_U_NEED];
    /* You can typedef a struct for that
    ** instead of a char *, but watch out
    ** for alignment woes.
    */

    r.x.ax = 0x1501;
    /* Tell int 2f to use xfer buffer */
    r.x.es = (__tb >> 4 ) &0xffff;
    r.x.bx =  __tb & 0xf;

    __dpmi_int(0x2f,&r);
    dosmemget(__tb,WHATEVER_U_NEED, &foo);
    return 0 
}


-- 
Ciao
Tom



*************************************************************
* Thomas Demmer                                             *
* Lehrstuhl fuer Stroemungsmechanik                         *
* Ruhr-Uni-Bochum                                           *
* Universitaetsstr. 150                                     *
* D-44780  Bochum                                           *
* Tel: +49 234 700 6434                                     *
* Fax: +49 234 709 4162                                     *
* http://www.lstm.ruhr-uni-bochum.de/~demmer                *
*************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019