NTSTATUS
-InstallMBRBootCodeToDisk(PWSTR SrcPath,
- PWSTR RootPath)
+InstallMbrBootCodeToDisk (PWSTR SrcPath,
+ PWSTR RootPath)
{
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock;
}
/* Copy partition table from old MBR to new */
- memcpy((NewBootSector + 446), (OrigBootSector + 446), 4*16 /* Length of partition table */);
+ RtlCopyMemory ((NewBootSector + 446),
+ (OrigBootSector + 446),
+ 4*16 /* Length of partition table */);
/* Free the original boot sector */
RtlFreeHeap(ProcessHeap, 0, OrigBootSector);
return(Status);
}
- /* Adjust bootsector (copy a part of the FAT BPB) */
- memcpy((NewBootSector + 11), (OrigBootSector + 11), 51 /*fat BPB length*/);
+ /* Adjust bootsector (copy a part of the FAT16 BPB) */
+ memcpy((NewBootSector + 3),
+ (OrigBootSector + 3),
+ 59); /* FAT16 BPB length*/
/* Free the original boot sector */
RtlFreeHeap(ProcessHeap, 0, OrigBootSector);