[VFATLIB]
authorPierre Schweitzer <pierre@reactos.org>
Sat, 5 Apr 2014 15:39:09 +0000 (15:39 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 5 Apr 2014 15:39:09 +0000 (15:39 +0000)
--MagicValues;

svn path=/trunk/; revision=62625

reactos/lib/fslib/vfatlib/fat12.c
reactos/lib/fslib/vfatlib/fat16.c
reactos/lib/fslib/vfatlib/fat32.c

index b9f8bad..da0e0ae 100644 (file)
@@ -72,7 +72,7 @@ Fat12WriteBootSector(IN HANDLE FileHandle,
     /* Copy FAT16 BPB to new bootsector */
     memcpy(&NewBootSector->OEMName[0],
            &BootSector->OEMName[0],
-           59); /* FAT16 BPB length (up to (not including) Res2) */
+           FIELD_OFFSET(FAT16_BOOT_SECTOR, Res2) - FIELD_OFFSET(FAT16_BOOT_SECTOR, OEMName)); /* FAT16 BPB length (up to (not including) Res2) */
 
     /* Write the boot sector signature */
     NewBootSector->Signature1 = 0xAA550000;
index 8cd7551..8f4d892 100644 (file)
@@ -72,7 +72,7 @@ Fat16WriteBootSector(IN HANDLE FileHandle,
     /* Copy FAT16 BPB to new bootsector */
     memcpy(&NewBootSector->OEMName[0],
            &BootSector->OEMName[0],
-           59); /* FAT16 BPB length (up to (not including) Res2) */
+           FIELD_OFFSET(FAT16_BOOT_SECTOR, Res2) - FIELD_OFFSET(FAT16_BOOT_SECTOR, OEMName)); /* FAT16 BPB length (up to (not including) Res2) */
 
     /* Write the boot sector signature */
     NewBootSector->Signature1 = 0xAA550000;
index cd1cfaf..17f13e2 100644 (file)
@@ -72,7 +72,7 @@ Fat32WriteBootSector(IN HANDLE FileHandle,
     /* Copy FAT32 BPB to new bootsector */
     memcpy(&NewBootSector->OEMName[0],
            &BootSector->OEMName[0],
-           87); /* FAT32 BPB length (up to (not including) Res2) */
+           FIELD_OFFSET(FAT32_BOOT_SECTOR, Res2) - FIELD_OFFSET(FAT32_BOOT_SECTOR, OEMName)); /* FAT32 BPB length (up to (not including) Res2) */
 
     /* Write the boot sector signature */
     NewBootSector->Signature1 = 0xAA550000;