Obtain FAT32 volume data just as it's done for NTFS

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi.

I have problems with obtaining FAT32 volume data. For NTFS there's a
FSCTL_GET_NTFS_VOLUME_DATA control code, and nothing similar for
FAT32. Actually I need only 2 pieces of information:

1) The offset of the starting sector of the volume from the beginning
of the disk;
2) The number of the sectors per cluster, or the number of the bytes
per cluster.

At the first glance you may think it's easy to obtain them using
IOCTL_DISK_GET_PARTITION_INFO control code, but the things are
somewhat complicated. For NTFS volume the starting sector offset can
be obtained easily dividing the starting offset of the partition (in
bytes) by the number of the bytes per sector (the mentioned arguments
are obtained thgrough IOCTL_DISK_GET_PARTITION_INFO and
IOCTL_DISK_GET_DRIVE_GEOMETRY control codes). For FAT32 volumes data
sectors start from partition offset + reserved sectors + n*FAT size,
and it's impossible to get these arguments through any conrol code.
The only obvious way to obtain them is reading sector 0 of the
partition, which contains all the necessary data. Unfortunately I have
problems with reading exactly sector 0 - a legacy filter driver
encrypts/decrypts all read/write operations and it functions
incorrectly just for sector 0 read operation, as a result I get
garbage.

Question: Is there another way to obtain the 2 abovementioned pieces
of volume information?

Thanks in advance
Martin
.



Relevant Pages

  • Re: Pretec CF-cards and FAT!
    ... There are nothing but text at offset 0x1BE. ... At offset 0x0E can be found the sector number where is FAT-table (these ... I took screen captures from sector 0 at both cards. ... The MBR contains the BPB ...
    (microsoft.public.windowsce.platbuilder)
  • Re: bsdlabel offset
    ... I created this disk with sade or sysinstall. ... /boot/boot I would guess offset should be 16block large. ... Comparing the first sector with boot and boot1 differs already ... That sector 0 lies outside of the slice block 0. ...
    (freebsd-questions)
  • Re: bsdlabel offset
    ... I created this disk with sade or sysinstall. ... /boot/boot I would guess offset should be 16block large. ... Comparing the first sector with boot and boot1 differs already ...
    (freebsd-questions)
  • Re: bsdlabel offset
    ... I created this disk with sade or sysinstall. ... /boot/boot I would guess offset should be 16block large. ... Comparing the first sector with boot and boot1 differs already ...
    (freebsd-questions)
  • Obtain FAT32 volume data just as its done for NTFS
    ... I have problems with obtaining FAT32 volume data. ... The offset of the starting sector of the volume from the beginning ... For NTFS volume the starting sector offset can ...
    (microsoft.public.development.device.drivers)