mirror of https://github.com/acidanthera/audk.git
Apply WriteUnaligned64() to write DevicePath structure.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8027 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
23042a556b
commit
395ed063d9
|
@ -2588,20 +2588,24 @@ DevPathFromTextRelativeOffsetRange (
|
||||||
{
|
{
|
||||||
CHAR16 *StartingOffsetStr;
|
CHAR16 *StartingOffsetStr;
|
||||||
CHAR16 *EndingOffsetStr;
|
CHAR16 *EndingOffsetStr;
|
||||||
MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH
|
MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;
|
||||||
*Offset;
|
UINT64 StartingOffset;
|
||||||
|
UINT64 EndingOffset;
|
||||||
|
|
||||||
StartingOffsetStr = GetNextParamStr (&TextDeviceNode);
|
StartingOffsetStr = GetNextParamStr (&TextDeviceNode);
|
||||||
EndingOffsetStr = GetNextParamStr (&TextDeviceNode);
|
EndingOffsetStr = GetNextParamStr (&TextDeviceNode);
|
||||||
Offset = (MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *)
|
Offset = (MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *) CreateDeviceNode (
|
||||||
CreateDeviceNode (
|
|
||||||
MEDIA_DEVICE_PATH,
|
MEDIA_DEVICE_PATH,
|
||||||
MEDIA_RELATIVE_OFFSET_RANGE_DP,
|
MEDIA_RELATIVE_OFFSET_RANGE_DP,
|
||||||
sizeof (MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH)
|
sizeof (MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH)
|
||||||
);
|
);
|
||||||
|
|
||||||
Strtoi64 (StartingOffsetStr, &Offset->StartingOffset);
|
Strtoi64 (StartingOffsetStr, &StartingOffset);
|
||||||
Strtoi64 (EndingOffsetStr, &Offset->EndingOffset);
|
Strtoi64 (EndingOffsetStr, &EndingOffset);
|
||||||
|
|
||||||
|
WriteUnaligned64 ((VOID *) &Offset->StartingOffset, StartingOffset);
|
||||||
|
WriteUnaligned64 ((VOID *) &Offset->EndingOffset, EndingOffset);
|
||||||
|
|
||||||
|
|
||||||
return (EFI_DEVICE_PATH_PROTOCOL *) Offset;
|
return (EFI_DEVICE_PATH_PROTOCOL *) Offset;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue