TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Gary Chambers
date: 1994-07-16 17:03:22
subject: DosOpen Problems

Hello All!  I'm having a bit of trouble using DosOpen to open my CD-ROM
drive for access (specifically to eject the disc).  Here is what I have:

/****  Cut here  ****/

#define INCL_DOS
#include 
#include 
#include 

VOID main(VOID)
{
    HFILE CDHandle;
    ULONG action;
    APIRET rc;
    ULONG ParmLenInOut, DataLenInOut;

    rc = DosOpen("E:",
                 &CDHandle,
                 &action,
                 0,
                 FILE_READONLY,
                 OPEN_ACTION_OPEN_IF_EXISTS,
                 OPEN_FLAGS_DASD,
                 0);

   if (rc != 0)
   {
      printf("DosOpen failed (rc = %ld)\n", rc);
      exit(EXIT_FAILURE);
   }

   rc = DosDevIOCtl(CDHandle,
                    0x80,
                    0x44,
                    NULL,
                    0,
                    &ParmLenInOut,
                    NULL,
                    0,
                    &DataLenInOut);

   if (rc != 0)
   {
        printf("DosDevIOCtl failed (rc = %ld)\n", rc);
        exit(EXIT_FAILURE);
   }

   DosClose(CDHandle);
}

/****  Cut here  ****/ 

GeeCee/2 
---

* Origin: Mystic Seaport Inn OiS/2 - ZyXEL 16.8 - (804)497-2530 (1:275/37)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 413 430
SEEN-BY: 711/807 808 809 934 942 712/353 623 713/888 800/1
@PATH: 275/37 85 1 3615/50 229/2 12/2442 711/409 54/54 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.