ShellPkg: Fix 'EfiShellExecute' doesn't get command status correctly.

1. Add a new  function 'RunShellCommand' to return command status, thus 'EfiShellExecute' can get the command return status of 'CommandLine'.
2. Refine the code logic of 'EfiShellExecute' to make the new image of shell be loaded only if  'Environment' isn't NULL.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Signed-off-by: Jin Eric <eric.jin@intel.com>
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18664 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Qiu Shumin
2015-10-26 13:28:01 +00:00
committed by shenshushi
parent c2305a4af8
commit 490ce43d92
4 changed files with 125 additions and 40 deletions

View File

@@ -293,6 +293,25 @@ RunCommand(
IN CONST CHAR16 *CmdLine
);
/**
Function will process and run a command line.
This will determine if the command line represents an internal shell
command or dispatch an external application.
@param[in] CmdLine The command line to parse.
@param[out] CommandStatus The status from the command line.
@retval EFI_SUCCESS The command was completed.
@retval EFI_ABORTED The command's operation was aborted.
**/
EFI_STATUS
EFIAPI
RunShellCommand(
IN CONST CHAR16 *CmdLine,
OUT EFI_STATUS *CommandStatus
);
/**
Function determines if the CommandName COULD be a valid command. It does not determine whether
this is a valid command. It only checks for invalid characters.