mirror of https://github.com/acidanthera/audk.git
Use DiskIo->WriteDisk() API to avoid alignment issue.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8445 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
d48e8b0afa
commit
071b7221a5
MdeModulePkg/Universal/Disk/PartitionDxe
|
@ -574,14 +574,20 @@ PartitionRestoreGptTable (
|
|||
PartHdr->PartitionEntryLBA = PEntryLBA;
|
||||
PartitionSetCrc ((EFI_TABLE_HEADER *) PartHdr);
|
||||
|
||||
Status = BlockIo->WriteBlocks (BlockIo, BlockIo->Media->MediaId, PartHdr->MyLBA, BlockSize, PartHdr);
|
||||
Status = DiskIo->WriteDisk (
|
||||
DiskIo,
|
||||
BlockIo->Media->MediaId,
|
||||
MultU64x32 (PartHdr->MyLBA, BlockIo->Media->BlockSize),
|
||||
BlockSize,
|
||||
PartHdr
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Done;
|
||||
}
|
||||
|
||||
Ptr = AllocatePool (PartHeader->NumberOfPartitionEntries * PartHeader->SizeOfPartitionEntry);
|
||||
if (Ptr == NULL) {
|
||||
DEBUG ((EFI_D_ERROR, " Allocate pool effor\n"));
|
||||
DEBUG ((EFI_D_ERROR, " Allocate pool error\n"));
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto Done;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue