* Fixed some coding style violation introduced in my previous commit. Thanks Axel!
The recognition code is actually working, I was just using the wrong dvd. I'm now using an iso file created with mkisofs. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27085 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -44,17 +44,16 @@ udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
|
||||
uint8 &partitionDescriptorCount)
|
||||
{
|
||||
TRACE(("udf_recognize: device: = %d, offset = %Ld, length = %Ld, "
|
||||
"blockSize = %ld, [...descriptors, etc...]\n", device, offset,
|
||||
length, blockSize));
|
||||
"blockSize = %ld, ", device, offset, length, blockSize));
|
||||
|
||||
// Check the block size
|
||||
status_t status = get_block_shift(blockSize, blockShift);
|
||||
if (status != B_OK) {
|
||||
TRACE_ERROR(("udf_recognize: Block size must be a positive power of "
|
||||
TRACE_ERROR(("\nudf_recognize: Block size must be a positive power of "
|
||||
"two! (blockSize = %ld)\n", blockSize));
|
||||
return status;
|
||||
}
|
||||
TRACE(("udf_recognize: blockShift: %ld\n", blockShift));
|
||||
TRACE(("blockShift: %ld\n", blockShift));
|
||||
|
||||
// Check for a valid volume recognition sequence
|
||||
status = walk_volume_recognition_sequence(device, offset, blockSize,
|
||||
@@ -92,8 +91,13 @@ udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
|
||||
|
||||
static
|
||||
status_t
|
||||
walk_volume_recognition_sequence(int device, off_t offset, uint32 blockSize, uint32 blockShift)
|
||||
walk_volume_recognition_sequence(int device, off_t offset, uint32 blockSize,
|
||||
uint32 blockShift)
|
||||
{
|
||||
TRACE(("walk_volume_recognition_sequence: device = %d, offset = %Ld, "
|
||||
"blockSize = %ld, blockShift = %d\n", device, offset, blockSize,
|
||||
blockShift));
|
||||
|
||||
// vrs starts at block 16. Each volume structure descriptor (vsd)
|
||||
// should be one block long. We're expecting to find 0 or more iso9660
|
||||
// vsd's followed by some ECMA-167 vsd's.
|
||||
@@ -110,11 +114,11 @@ walk_volume_recognition_sequence(int device, off_t offset, uint32 blockSize, uin
|
||||
bool foundECMA168 = false;
|
||||
bool foundBoot = false;
|
||||
for (uint32 block = 16; true; block++) {
|
||||
TRACE(("walk_volume_recognition_sequence: block %ld: ", block));
|
||||
off_t address = (offset + block) << blockShift;
|
||||
TRACE(("walk_volume_recognition_sequence: block = %ld, "
|
||||
"address = %d, ", block, address));
|
||||
ssize_t bytesRead = read_pos(device, address, chunk.Data(), blockSize);
|
||||
if (bytesRead == (ssize_t)blockSize)
|
||||
{
|
||||
if (bytesRead == (ssize_t)blockSize) {
|
||||
volume_structure_descriptor_header* descriptor
|
||||
= (volume_structure_descriptor_header *)(chunk.Data());
|
||||
if (descriptor->id_matches(kVSDID_ISO)) {
|
||||
|
||||
Reference in New Issue
Block a user