X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ShellPkg%2FApplication%2FShell%2FShellProtocol.c;h=b0303962ff6939cb3771452973b6c537360aba74;hb=a308e0588b3ad87b94611391e9e7a04a8eb05ebf;hp=11f5d481f9b0f19e61eb240859eeed5490dd6252;hpb=4b6b543e77f3237c63e691f35d0bb259ddc287b4;p=mirror_edk2.git diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c index 11f5d481f9..b0303962ff 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.c +++ b/ShellPkg/Application/Shell/ShellProtocol.c @@ -1401,8 +1401,6 @@ EfiShellEnablePageBreak ( is NULL, then the current shell environment is used. @param[out] StartImageStatus Returned status from gBS->StartImage. - @param[out] ExitDataSize ExitDataSize as returned from gBS->StartImage - @param[out] ExitData ExitData as returned from gBS->StartImage @retval EFI_SUCCESS The command executed successfully. The status code returned by the command is pointed to by StatusCode. @@ -1417,9 +1415,7 @@ InternalShellExecuteDevicePath( IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST CHAR16 *CommandLine OPTIONAL, IN CONST CHAR16 **Environment OPTIONAL, - OUT EFI_STATUS *StartImageStatus OPTIONAL, - OUT UINTN *ExitDataSize OPTIONAL, - OUT CHAR16 **ExitData OPTIONAL + OUT EFI_STATUS *StartImageStatus OPTIONAL ) { EFI_STATUS Status; @@ -1429,21 +1425,11 @@ InternalShellExecuteDevicePath( EFI_LOADED_IMAGE_PROTOCOL *LoadedImage; LIST_ENTRY OrigEnvs; EFI_SHELL_PARAMETERS_PROTOCOL ShellParamsProtocol; - UINTN InternalExitDataSize; - UINTN *ExitDataSizePtr; CHAR16 *ImagePath; UINTN Index; CHAR16 *Walker; CHAR16 *NewCmdLine; - // ExitDataSize is not OPTIONAL for gBS->BootServices, provide somewhere for - // it to be dumped if the caller doesn't want it. - if (ExitData == NULL) { - ExitDataSizePtr = &InternalExitDataSize; - } else { - ExitDataSizePtr = ExitDataSize; - } - if (ParentImageHandle == NULL) { return (EFI_INVALID_PARAMETER); } @@ -1547,13 +1533,13 @@ InternalShellExecuteDevicePath( ///@todo initialize and install ShellInterface protocol on the new image for compatibility if - PcdGetBool(PcdShellSupportOldProtocols) // - // now start the image, passing up exit data if the caller requested it + // now start the image and if the caller wanted the return code pass it to them... // if (!EFI_ERROR(Status)) { StartStatus = gBS->StartImage( NewHandle, - ExitDataSizePtr, - ExitData + 0, + NULL ); if (StartImageStatus != NULL) { *StartImageStatus = StartStatus; @@ -1642,8 +1628,6 @@ EfiShellExecute( CHAR16 *Temp; EFI_DEVICE_PATH_PROTOCOL *DevPath; UINTN Size; - UINTN ExitDataSize; - CHAR16 *ExitData; if ((PcdGet8(PcdShellSupportLevel) < 1)) { return (EFI_UNSUPPORTED); @@ -1671,32 +1655,7 @@ EfiShellExecute( DevPath, Temp, (CONST CHAR16**)Environment, - StatusCode, - &ExitDataSize, - &ExitData); - - if (Status == EFI_ABORTED) { - // If the command exited with an error, the shell should put the exit - // status in ExitData, preceded by a null-terminated string. - ASSERT (ExitDataSize == StrSize (ExitData) + sizeof (SHELL_STATUS)); - - if (StatusCode != NULL) { - // Skip the null-terminated string - ExitData += StrLen (ExitData) + 1; - - // Use CopyMem to avoid alignment faults - CopyMem (StatusCode, ExitData, sizeof (SHELL_STATUS)); - - // Convert from SHELL_STATUS to EFI_STATUS - // EFI_STATUSes have top bit set when they are errors. - // (See UEFI Spec Appendix D) - if (*StatusCode != SHELL_SUCCESS) { - *StatusCode = (EFI_STATUS) *StatusCode | MAX_BIT; - } - } - FreePool (ExitData); - Status = EFI_SUCCESS; - } + StatusCode); // // de-allocate and return