I don’t know whether you can read CDROM sectors using this method. This
method is most useful reading Floppy disks. I am using ASPI interface to
read CDROMs. There is a sample, wnaspi32, in Windows 95 DDK.
-----Original Message-----
From: nataraj r s [mailto:xxxxx@rediffmail.com]
Posted At: 16 September 2002 13:10
Posted To: ntdev
Conversation: [ntdev] RE: query
Subject: [ntdev] RE: query
Hi,
I got your mail ,gone through website. and i wrote code to open a
cd rom and read the contents but It returns value(i’e acess is
denied) why
is it So? and i am sending part of code it should work on
windows98 platform.
hDevice = CreateFile ( “\\.\vwin32”, 0, 0, NULL, 0, 0, NULL
);
if ( (hDevice == INVALID_HANDLE_VALUE) )
{
MessageBox (“Cannot Open File \n”);
return;
}
DIOC_REGISTERS reg = {0};
DISKIO dio;
dio.dwStartSector = 1;
dio.wSectors = 2;
dio.dwBuffer = (DWORD)buffer;
reg.reg_EAX = 0x7305; // Ext_ABSDiskReadWrite
reg.reg_EBX = (DWORD)&dio;
reg.reg_ECX = -1;
reg.reg_EDX = 1; // Int 21h, fn 7305h drive numbers are
1-based
reg.reg_ESI = 0x0;
reg.reg_Flags = 1 ;
fResult =
DeviceIoControl(hDevice,VWIN32_DIOC_DOS_DRIVEINFO,
®, sizeof(reg),
®, sizeof(reg), &cb, 0);
// Determine if the DeviceIoControl call and the read
succeeded.
fResult = fResult && !(reg.reg_Flags & 1 );
if ( fResult == 0 )
{
CString error;
error.Format(“Reading Failed %i”, reg.reg_EAX);
AfxMessageBox (error);
}
else{
CString error;
error.Format("ReadingSuccess " );
AfxMessageBox (error);
}
You are currently subscribed to ntdev as: xxxxx@avantisworld.com
To unsubscribe send a blank email to %%email.unsub%%