- We have to unpack the BIOS block before actually reading it.

- Now we correctly read 512 bytes per sector instead of 0.
- We are almost there!


svn path=/trunk/; revision=34665
This commit is contained in:
ReactOS Portable Systems Group 2008-07-22 07:12:05 +00:00
parent 0e52616f5f
commit c61f672499

View file

@ -412,6 +412,7 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
WCHAR LocalBuffer[16]; WCHAR LocalBuffer[16];
UNICODE_STRING SymbolicLinkName, DriveString, GuidString, DeviceName; UNICODE_STRING SymbolicLinkName, DriveString, GuidString, DeviceName;
PPACKED_BOOT_SECTOR BootSector; PPACKED_BOOT_SECTOR BootSector;
BIOS_PARAMETER_BLOCK BiosBlock;
ULONG BytesPerSector, SectorsPerTrack, Heads, BytesRead; ULONG BytesPerSector, SectorsPerTrack, Heads, BytesRead;
PVOID BaseAddress; PVOID BaseAddress;
LARGE_INTEGER CurrentOffset; LARGE_INTEGER CurrentOffset;
@ -668,9 +669,10 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
// Get the data // Get the data
// //
BootSector = (PPACKED_BOOT_SECTOR)BaseAddress; BootSector = (PPACKED_BOOT_SECTOR)BaseAddress;
BytesPerSector = BootSector->PackedBpb.BytesPerSector[0]; FatUnpackBios(&BiosBlock, &BootSector->PackedBpb);
SectorsPerTrack = BootSector->PackedBpb.SectorsPerTrack[0]; BytesPerSector = BiosBlock.BytesPerSector;
Heads = BootSector->PackedBpb.Heads[0]; SectorsPerTrack = BiosBlock.SectorsPerTrack;
Heads = BiosBlock.Heads;
// //
// Save it // Save it