Sergey,

No, it is not a bug. The code you copied is reading the handle to use in the 
performance code. If CoreLoadImageCommon above it was successful, then 
*ImageHandle will already have the correct value. If CoreLoadImageCommon 
failed, NULL will be used (Handle was set to NULL just above the if). We don't 
want this function to use *ImageHandle in the performance code in case of 
failure, since it is not to be modified in that case, and we don't know what 
value the caller left there.

Deric Cole
Sr. Customer Engineer
Phoenix Technologies Ltd.

From: Sergey Isakov [mailto:[email protected]]
Sent: Wednesday, October 08, 2014 3:01 AM
To: [email protected]
Subject: [edk2] CoreLoadImage output bug?

Dear sirs,
In the module /MdeModulePkg/Core/Dxe/Image/Image.c  I see the procedure
------
EFI_STATUS
EFIAPI
CoreLoadImage (
  IN BOOLEAN                    BootPolicy,
  IN EFI_HANDLE                 ParentImageHandle,
  IN EFI_DEVICE_PATH_PROTOCOL   *FilePath,
  IN VOID                       *SourceBuffer   OPTIONAL,
  IN UINTN                      SourceSize,
  OUT EFI_HANDLE                *ImageHandle
  )

------
It means ImageHandle will be output parameter?
But the procedure ended with
---------
  if (!EFI_ERROR (Status)) {
    //
    // ImageHandle will be valid only Status is success.
    //
    Handle = *ImageHandle;
  }

  PERF_START (Handle, "LoadImage:", NULL, Tick);
  PERF_END (Handle, "LoadImage:", NULL, 0);

  return Status;
}

---------
Should it be reversed?
*ImageHandle = Handle;

Sergey


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to