summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-06 10:37:49 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-06 10:37:49 +0000
commit28c73f6ef7fc6cb1803d80761002ec2a7330d833 (patch)
tree66ab216f4494736fa66fee52642177ad968a705a /MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c
parentdf569f61e3806ec8dbeef9c89123f5b223720c07 (diff)
downloadedk2-28c73f6ef7fc6cb1803d80761002ec2a7330d833.tar.gz
edk2-28c73f6ef7fc6cb1803d80761002ec2a7330d833.tar.bz2
edk2-28c73f6ef7fc6cb1803d80761002ec2a7330d833.zip
PciLib:
For PciRead/WriteBuffer(): A fix to handle boundary cases when Size is 0; DevicePathLib: For FileDevicePath(): Change to use AppendDevicePath () in place of AppendDevicePathNode(). PrintLib: For type %p, according to current MWG, it should ignore flag 0, +, space, l, & L Misc: Fix a bug in EBC interpreter for Ia32. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@796 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c')
-rw-r--r--MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c b/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c
index ec4325cf39..ec9b4aa321 100644
--- a/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c
+++ b/MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c
@@ -321,24 +321,26 @@ FileDevicePath (
UINTN Size;
FILEPATH_DEVICE_PATH *FilePath;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_DEVICE_PATH_PROTOCOL *FileDevicePathNode;
+ EFI_DEVICE_PATH_PROTOCOL *FileDevicePath;
DevicePath = NULL;
Size = StrSize (FileName);
- FileDevicePathNode = CreateDeviceNode (
- MEDIA_DEVICE_PATH,
- MEDIA_FILEPATH_DP,
- (UINT16) (Size + SIZE_OF_FILEPATH_DEVICE_PATH)
- );
- if (FileDevicePathNode != NULL) {
- FilePath = (FILEPATH_DEVICE_PATH *) FileDevicePathNode;
+ FileDevicePath = AllocatePool (Size + SIZE_OF_FILEPATH_DEVICE_PATH + EFI_END_DEVICE_PATH_LENGTH);
+ if (FileDevicePath != NULL) {
+ FilePath = (FILEPATH_DEVICE_PATH *) FileDevicePath;
+ FilePath->Header.Type = MEDIA_DEVICE_PATH;
+ FilePath->Header.SubType = MEDIA_FILEPATH_DP;
CopyMem (&FilePath->PathName, FileName, Size);
+ SetDevicePathNodeLength (&FilePath->Header, Size + SIZE_OF_FILEPATH_DEVICE_PATH);
+ SetDevicePathEndNode (NextDevicePathNode (&FilePath->Header));
+
if (Device != NULL) {
DevicePath = DevicePathFromHandle (Device);
}
- DevicePath = AppendDevicePathNode (DevicePath, FileDevicePathNode);
- FreePool (FileDevicePathNode);
+
+ DevicePath = AppendDevicePath (DevicePath, FileDevicePath);
+ FreePool (FileDevicePath);
}
return DevicePath;