[USETUP]
[reactos.git] / reactos / base / setup / usetup / bootsup.c
index 59b58a8..8ed151c 100644 (file)
@@ -626,7 +626,6 @@ UpdateFreeLoaderIni(
     return STATUS_SUCCESS;
 }
 
-static
 BOOLEAN
 IsThereAValidBootSector(PWSTR RootPath)
 {
@@ -695,9 +694,8 @@ IsThereAValidBootSector(PWSTR RootPath)
     return (Instruction != 0x00000000);
 }
 
-static
 NTSTATUS
-SaveCurrentBootSector(
+SaveBootSector(
     PWSTR RootPath,
     PWSTR DstPath,
     ULONG Length)
@@ -1210,7 +1208,7 @@ InstallMbrBootCodeToDisk(
                         NULL,
                         &IoStatusBlock,
                         OrigBootSector,
-                        SECTORSIZE,
+                        sizeof(PARTITION_SECTOR),
                         &FileOffset,
                         NULL);
     NtClose(FileHandle);
@@ -1270,9 +1268,9 @@ InstallMbrBootCodeToDisk(
     }
 
     /* Copy partition table from old MBR to new */
-    RtlCopyMemory (&NewBootSector->Signature,
-                   &OrigBootSector->Signature,
-                   sizeof(PARTITION_SECTOR) - offsetof(PARTITION_SECTOR, Signature) /* Length of partition table */);
+    RtlCopyMemory(&NewBootSector->Signature,
+                  &OrigBootSector->Signature,
+                  sizeof(PARTITION_SECTOR) - offsetof(PARTITION_SECTOR, Signature) /* Length of partition table */);
 
     /* Free the original boot sector */
     RtlFreeHeap(ProcessHeap, 0, OrigBootSector);
@@ -1306,7 +1304,7 @@ InstallMbrBootCodeToDisk(
                          NULL,
                          &IoStatusBlock,
                          NewBootSector,
-                         SECTORSIZE,
+                         sizeof(PARTITION_SECTOR),
                          &FileOffset,
                          NULL);
     NtClose(FileHandle);
@@ -1584,8 +1582,6 @@ InstallFat16BootCodeToDisk(
            FIELD_OFFSET(FAT_BOOTSECTOR, BootCodeAndData) -
            FIELD_OFFSET(FAT_BOOTSECTOR, OemName));
 
-    NewBootSector->HiddenSectors = PartitionList->CurrentDisk->SectorsPerTrack;
-
     /* Free the original boot sector */
     RtlFreeHeap(ProcessHeap, 0, OrigBootSector);
 
@@ -1742,8 +1738,6 @@ InstallFat32BootCodeToDisk(
            FIELD_OFFSET(FAT32_BOOTSECTOR, BootCodeAndData) -
            FIELD_OFFSET(FAT32_BOOTSECTOR, OemName));
 
-    NewBootSector->HiddenSectors = PartitionList->CurrentDisk->SectorsPerTrack;
-
     /* Get the location of the backup boot sector */
     BackupBootSector = OrigBootSector->BackupBootSector;
 
@@ -2262,7 +2256,7 @@ InstallFatBootcodeToPartition(
     /* FAT or FAT32 partition */
     DPRINT("System path: '%wZ'\n", SystemRootPath);
 
-    /* Copy FreeLoader to the boot partition */
+    /* Copy FreeLoader to the system partition */
     wcscpy(SrcPath, SourceRootPath->Buffer);
     wcscat(SrcPath, L"\\loader\\freeldr.sys");
     wcscpy(DstPath, SystemRootPath->Buffer);
@@ -2447,10 +2441,10 @@ InstallFatBootcodeToPartition(
                 wcscat(DstPath, BootSectorFileName);
 
                 DPRINT1("Save bootsector: %S ==> %S\n", SystemRootPath->Buffer, DstPath);
-                Status = SaveCurrentBootSector(SystemRootPath->Buffer, DstPath, SECTORSIZE);
+                Status = SaveBootSector(SystemRootPath->Buffer, DstPath, SECTORSIZE);
                 if (!NT_SUCCESS(Status))
                 {
-                    DPRINT1("SaveCurrentBootSector() failed (Status %lx)\n", Status);
+                    DPRINT1("SaveBootSector() failed (Status %lx)\n", Status);
                     return Status;
                 }
             }
@@ -2520,7 +2514,7 @@ InstallExt2BootcodeToPartition(
     /* EXT2 partition */
     DPRINT("System path: '%wZ'\n", SystemRootPath);
 
-    /* Copy FreeLoader to the boot partition */
+    /* Copy FreeLoader to the system partition */
     wcscpy(SrcPath, SourceRootPath->Buffer);
     wcscat(SrcPath, L"\\loader\\freeldr.sys");
     wcscpy(DstPath, SystemRootPath->Buffer);
@@ -2582,10 +2576,10 @@ InstallExt2BootcodeToPartition(
             wcscat(DstPath, L"\\bootsect.old");
 
             DPRINT1("Save bootsector: %S ==> %S\n", SystemRootPath->Buffer, DstPath);
-            Status = SaveCurrentBootSector(SystemRootPath->Buffer, DstPath, sizeof(EXT2_BOOTSECTOR));
+            Status = SaveBootSector(SystemRootPath->Buffer, DstPath, sizeof(EXT2_BOOTSECTOR));
             if (!NT_SUCCESS(Status))
             {
-                DPRINT1("SaveCurrentBootSector() failed (Status %lx)\n", Status);
+                DPRINT1("SaveBootSector() failed (Status %lx)\n", Status);
                 return Status;
             }
         }
@@ -2657,7 +2651,7 @@ InstallVBRToPartition(
             break;
 
         default:
-            DPRINT1("PartitionType 0x%02x unknown!\n", PartitionType);
+            DPRINT1("PartitionType 0x%02X unknown!\n", PartitionType);
             break;
     }