Formatting DVD+RW

Hi,

I’m trying to format a DVD+RW and do not succeed.
My code looks like this:

bool CScsi::FormatDvdPRw(char cDriveLetter)
{
SCSI_PASS_THROUGH_DIRECT sptd;
unsigned char aucParameterList[12];

ZeroMemory(&sptd, sizeof(sptd));
ZeroMemory(&aucParameterList, sizeof(aucParameterList));

// Format list header, byte 0..3
aucParameterList[1] = 0x00; // Unit shall use default options
aucParameterList[3] = 0x08; // LSB Format descriptor length = 8 bytes
// Format descriptor, byte 4..12
aucParameterList[4] = 0xFF; // Number of blocks set to 0xFFFFFFFF
aucParameterList[5] = 0xFF;
aucParameterList[6] = 0xFF;
aucParameterList[7] = 0xFF;
aucParameterList[8] = 0x26; // DVD+RW basic format
// Type dependent parameter, byte 9..11 are left zero

sptd.Length = sizeof(sptd);
sptd.CdbLength = CDB6;
sptd.DataIn = SCSI_IOCTL_DATA_OUT;
sptd.DataTransferLength = sizeof(aucParameterList);
sptd.TimeOutValue = 60;
sptd.DataBuffer = (void*) aucParameterList;

sptd.Cdb[0] = 0x04;         // Code for FORMAT UNIT (6) command
sptd.Cdb[1] = 0x10 | 0x01;  // Parameter list available, format code fixed to 0x01

return SendCommand(cDriveLetter, &sptd);

}

What’s wrong with these settings?

Thanx for attention
Tom

Hi,

meanwhile I found my error! :doh:

the code line:
aucParameterList[8] = 0x26; // DVD+RW basic format
should be:
aucParameterList[8] = 0x26<<2; // DVD+RW basic format

Now the formatting works fine.

But another questions:
Is there a kind of quickformat like with the BLANK command for CD/DVD-RW?
Why does a formatted DVD+RW not report empty status with the READ DISC INFORMATION command?

Thanx in advance
Tom

Probably because this command relies on formatted media to know that it is empty. If you can’t find a milk carton, can you check if it’s empty ?