On Sep 22, 2014, at 3:09 PM, J. E. <[email protected]> wrote:

> Hi
> 
> I am not accessing it from my app, i am fixing a bug in udk2014.
> 

It is hard to tell from your mail as you keep showing code fragments, and not a 
diff or code fragment plus what file it came from. 


> My app is only calling ShellExecute. 
> 
> Try it yourself in helloworld, im sure if you call shellexecute in an efi 
> shell 1.0 it will crash
> 

If we look at the EfiShellEnvironment2 protocol definition we see:

https://svn.code.sf.net/p/edk2/code/trunk/edk2/ShellPkg/Include/Protocol/EfiShellEnvironment2.h
typedef
EFI_STATUS
(EFIAPI *SHELLENV_EXECUTE) (
  IN EFI_HANDLE   *ParentImageHandle,
  IN CHAR16       *CommandLine,
  IN BOOLEAN      DebugOutput
  );

And that would imply that ShellExecute() should be calling with ParentHandle 
and not *ParentHandle in UefiShellLib.c

https://svn.code.sf.net/p/edk2/code/trunk/edk2/ShellPkg/Library/UefiShellLib/UefiShellLib.c
EFI_STATUS
EFIAPI
ShellExecute (
  IN EFI_HANDLE                 *ParentHandle,
  IN CHAR16                     *CommandLine OPTIONAL,
  IN BOOLEAN                    Output OPTIONAL,
  IN CHAR16                     **EnvironmentVariables OPTIONAL,
  OUT EFI_STATUS                *Status OPTIONAL
  )
{
  EFI_STATUS                CmdStatus;
  //
  // Check for UEFI Shell 2.0 protocols
  //
  if (gEfiShellProtocol != NULL) {
    //
    // Call UEFI Shell 2.0 version (not using Output parameter)
    //
    return (gEfiShellProtocol->Execute(ParentHandle,
                                      CommandLine,
                                      EnvironmentVariables,
                                      Status));
  }

  //
  // Check for EFI shell
  //
  if (mEfiShellEnvironment2 != NULL) {
    //
    // Call EFI Shell version.
    // Due to oddity in the EFI shell we want to dereference the ParentHandle 
here
    //
    CmdStatus = (mEfiShellEnvironment2->Execute(*ParentHandle,
                                          CommandLine,
                                          Output));
    //

Thanks,

Andrew Fish

------------------------------------------------------------------------------
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