if (gDxeCoreLoadedImage->FilePath == NULL) {\r
if (CompareGuid (&NameGuid, gDxeCoreFileName)) {\r
//\r
- // Because mFvDevicePath has been initialized when discoveried \r
- // EFI_FV_FILETYPE_DRIVER file. So only need to update the name \r
- // guid of device path.\r
+ // Maybe One specail Fv cantains only one DXE_CORE module, so its device path must\r
+ // be initialized completely.\r
//\r
- CopyGuid (&mFvDevicePath.File.NameGuid, &NameGuid);\r
+ EfiInitializeFwVolDevicepathNode (&mFvDevicePath.File, &NameGuid);\r
+ mFvDevicePath.End.Type = EFI_END_ENTIRE_DEVICE_PATH;\r
+ mFvDevicePath.End.SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;\r
+ SetDevicePathNodeLength (&mFvDevicePath.End, sizeof (EFI_DEVICE_PATH_PROTOCOL));\r
\r
gDxeCoreLoadedImage->FilePath = CoreDuplicateDevicePath (\r
(EFI_DEVICE_PATH_PROTOCOL *)&mFvDevicePath\r