Logo Search packages:      
Sourcecode: k9copy version File versions  Download package

bool K3bDevice::Device::readDvdStructure ( unsigned char **  data,
int &  dataLen,
unsigned int  format = 0x0,
unsigned int  layer = 0x0,
unsigned long  adress = 0,
unsigned int  agid = 0x0 
) const

if true is returned dataLen specifies the actual length of *data which needs to be deleted after using.

Definition at line 782 of file k3bdevice_mmc.cpp.

References blockDeviceName().

Referenced by copyrightProtectionSystemType(), diskInfo(), and dvdMediaType().

{
  unsigned char header[4];
  ::memset( header, 0, 4 );

  ScsiCommand cmd( this );
  cmd[0] = MMC_READ_DVD_STRUCTURE;
  cmd[2] = adress>>24;
  cmd[3] = adress>>16;
  cmd[4] = adress>>8;
  cmd[5] = adress;
  cmd[6] = layer;
  cmd[7] = format;
  cmd[10] = (agid<<6);

  cmd[9] = 4;
  if( cmd.transport( TR_DIR_READ, header, 2 ) == 0 ) {
    // again with real length
    dataLen = from2Byte( header ) + 2;

    *data = new unsigned char[dataLen];
    ::memset( *data, 0, dataLen );

    cmd[8] = dataLen>>8;
    cmd[9] = dataLen;
    if( cmd.transport( TR_DIR_READ, *data, dataLen ) == 0 )
      return true;
    else {
      kdDebug() << "(K3bDevice::Device) " << blockDeviceName() << ": READ DVD STRUCTURE with real length failed." << endl;
    }
  }
  else
    kdDebug() << "(K3bDevice::Device) " << blockDeviceName() << ": READ DVD STRUCTURE length det failed" << endl;

  return false;
}


Generated by  Doxygen 1.6.0   Back to index