读写引导区的
BOOL GetVolumeInformation(
LPCTSTR lpRootPathName, // root directory
LPTSTR lpVolumeNameBuffer, // volume name buffer
DWORD nVolumeNameSize, // length of name buffer
LPDWORD lpVolumeSerialNumber, // volume serial number
LPDWORD lpMaximumComponentLength, // maximum file name length
LPDWORD lpFileSystemFlags, // file system options
LPTSTR lpFileSystemNameBuffer, // file system name buffer
DWORD nFileSystemNameSize // length of file system name buffer
);
你问驱动器标识,就是lpVolumeNameBuffer把,
在fat16中,BS_VolLab,在引导区中位于偏移43处,长度11。 Volume label. This field matches the 11-byte volume label
recorded in the root directory.
NOTE: FAT file system drivers should make sure that they update
this field when the volume label file in the root directory has its
name changed or created. The setting for this field when there is no
volume label is the string “NO NAME ”.
而在FAT32,BS_VolLab,在引导区中位于偏移71处,长度11。This field has the same definition as it does for FAT12 and FAT16
media. The only difference for FAT32 media is that the field is at a
different offset in the boot sector.