Index: Shell.c
===================================================================
--- Shell.c	(revision 16122)
+++ Shell.c	(working copy)
@@ -244,9 +244,6 @@
   UINTN                           Size;
   EFI_HANDLE                      ConInHandle;
   EFI_SIMPLE_TEXT_INPUT_PROTOCOL  *OldConIn;
-  UINTN                           ExitDataSize;
-  CHAR16                          *ExitData;
-  SHELL_STATUS                    ExitStatus;
 
   if (PcdGet8(PcdShellSupportLevel) > 3) {
     return (EFI_UNSUPPORTED);
@@ -300,12 +297,6 @@
   // install our console logger.  This will keep a log of the output for back-browsing
   //
   Status = ConsoleLoggerInstall(ShellInfoObject.LogScreenCount, &ShellInfoObject.ConsoleInfo);
-  if(EFI_ERROR (Status)) {
-    ExitStatus = (SHELL_STATUS) (Status & (~MAX_BIT));
-  } else {
-    ExitStatus = SHELL_SUCCESS;
-  }
-	
   if (!EFI_ERROR(Status)) {
     //
     // Enable the cursor to be visible
@@ -419,7 +410,7 @@
     // Display the mapping
     //
     if (PcdGet8(PcdShellSupportLevel) >= 2 && !ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap) {
-      Status = RunCommand(L"map", NULL);
+      Status = RunCommand(L"map");
       ASSERT_EFI_ERROR(Status);
     }
 
@@ -485,11 +476,7 @@
         //
         // process the startup script or launch the called app.
         //
-        Status = DoStartupScript(
-                  ShellInfoObject.ImageDevPath,
-                  ShellInfoObject.FileDevPath,
-                  &ExitStatus
-                  );
+        Status = DoStartupScript(ShellInfoObject.ImageDevPath, ShellInfoObject.FileDevPath);
       }
 
       if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.Exit && !ShellCommandGetExit() && (PcdGet8(PcdShellSupportLevel) >= 3 || PcdGetBool(PcdShellForceConsole)) && !EFI_ERROR(Status) && !ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleIn) {
@@ -523,7 +510,6 @@
           //
           Status = DoShellPrompt();
         } while (!ShellCommandGetExit());
-        ExitStatus = (SHELL_STATUS) ShellCommandGetExitCode();
       }
       if (OldConIn != NULL && ConInHandle != NULL) {
         CloseSimpleTextInOnFile (gST->ConIn);
@@ -595,33 +581,10 @@
     DEBUG_CODE(ShellInfoObject.ConsoleInfo = NULL;);
   }
 
-  if (!EFI_ERROR (Status)) {
-    // If the command exited with an error, we pass this error out in the ExitData
-    // so that it can be retrieved by the EfiShellExecute function (which may
-    // start the shell with gBS->StartImage)
-    if (ExitStatus != SHELL_SUCCESS) {
-      // Allocate a buffer for exit data to pass to gBS->Exit().
-      // This buffer will contain the empty string immediately followed by
-      // the shell's exit status. (The empty string is required by the UEFI spec)
-      ExitDataSize = (sizeof (CHAR16) + sizeof (SHELL_STATUS));
-      ExitData = AllocatePool (ExitDataSize);
-      if (ExitData == NULL) {
-        return EFI_OUT_OF_RESOURCES;
-      }
-      ExitData[0] = '\0';
-      // Use CopyMem to avoid alignment faults
-      CopyMem ((ExitData + 1), &ExitStatus, sizeof (ExitStatus));
-
-      gBS->Exit (ImageHandle, EFI_ABORTED, ExitDataSize, ExitData);
-
-      ASSERT (FALSE);
-      return EFI_SUCCESS;
-    } else {
-      return EFI_SUCCESS;
-    }
-  } else {
-    return Status;
+  if (ShellCommandGetExit()) {
+    return ((EFI_STATUS)ShellCommandGetExitCode());
   }
+  return (Status);
 }
 
 /**
@@ -986,16 +949,13 @@
   @param ImagePath              the path to the image for shell.  first place to look for the startup script
   @param FilePath               the path to the file for shell.  second place to look for the startup script.
 
-  @param[out] ExitStatus      The exit code of the script. Ignored if NULL.
-
   @retval EFI_SUCCESS           the variable is initialized.
 **/
 EFI_STATUS
 EFIAPI
 DoStartupScript(
-  IN  EFI_DEVICE_PATH_PROTOCOL *ImagePath,
-  IN  EFI_DEVICE_PATH_PROTOCOL *FilePath,
-  OUT SHELL_STATUS             *ExitStatus
+  IN EFI_DEVICE_PATH_PROTOCOL *ImagePath,
+  IN EFI_DEVICE_PATH_PROTOCOL *FilePath
   )
 {
   EFI_STATUS                    Status;
@@ -1030,7 +990,7 @@
       StrnCat(FileStringPath, L" ", NewSize/sizeof(CHAR16) - StrLen(FileStringPath) -1);
       StrnCat(FileStringPath, ShellInfoObject.ShellInitSettings.FileOptions, NewSize/sizeof(CHAR16) - StrLen(FileStringPath) -1);
     }
-    Status = RunCommand(FileStringPath, ExitStatus);
+    Status = RunCommand(FileStringPath);
     FreePool(FileStringPath);
     return (Status);
 
@@ -1107,13 +1067,7 @@
   // If we got a file, run it
   //
   if (!EFI_ERROR(Status) && FileHandle != NULL) {
-    Status = RunScriptFile (
-              mStartupScript,
-              FileHandle,
-              L"",
-              ShellInfoObject.NewShellParametersProtocol,
-              ExitStatus
-              );
+    Status = RunScriptFile (mStartupScript, FileHandle, L"", ShellInfoObject.NewShellParametersProtocol);
     ShellInfoObject.NewEfiShellProtocol->CloseFile(FileHandle);
   } else {
     FileStringPath = ShellFindFilePath(mStartupScript);
@@ -1124,13 +1078,7 @@
       Status = EFI_SUCCESS;
       ASSERT(FileHandle == NULL);
     } else {
-      Status = RunScriptFile(
-                FileStringPath,
-                NULL,
-                L"",
-                ShellInfoObject.NewShellParametersProtocol,
-                ExitStatus
-                );
+      Status = RunScriptFile(FileStringPath, NULL, L"", ShellInfoObject.NewShellParametersProtocol);
       FreePool(FileStringPath);
     }
   }
@@ -1195,7 +1143,7 @@
   //
   if (!EFI_ERROR (Status)) {
     CmdLine[BufferSize / sizeof (CHAR16)] = CHAR_NULL;
-    Status = RunCommand(CmdLine, NULL);
+    Status = RunCommand(CmdLine);
     }
 
   //
@@ -1526,9 +1474,6 @@
   @param[in] StdIn          The pointer to the Standard input.
   @param[in] StdOut         The pointer to the Standard output.
 
-  @param[out] ExitStatus      The exit code of the last command in the pipeline.
-                              Ignored if NULL.
-
   @retval EFI_SUCCESS       The split command is executed successfully.
   @retval other             Some error occurs when executing the split command.
 **/
@@ -1537,8 +1482,7 @@
 RunSplitCommand(
   IN CONST CHAR16             *CmdLine,
   IN       SHELL_FILE_HANDLE  *StdIn,
-  IN       SHELL_FILE_HANDLE  *StdOut,
-  OUT      SHELL_STATUS       *ExitStatus
+  IN       SHELL_FILE_HANDLE  *StdOut
   )
 {
   EFI_STATUS        Status;
@@ -1592,7 +1536,7 @@
   ASSERT(Split->SplitStdOut != NULL);
   InsertHeadList(&ShellInfoObject.SplitList.Link, &Split->Link);
 
-  Status = RunCommand(OurCommandLine, NULL);
+  Status = RunCommand(OurCommandLine);
 
   //
   // move the output from the first to the in to the second.
@@ -1607,7 +1551,7 @@
   ShellInfoObject.NewEfiShellProtocol->SetFilePosition(ConvertShellHandleToEfiFileProtocol(Split->SplitStdIn), 0);
 
   if (!EFI_ERROR(Status)) {
-    Status = RunCommand(NextCommandLine, ExitStatus);
+    Status = RunCommand(NextCommandLine);
   }
 
   //
@@ -1901,9 +1845,7 @@
 /**
   Process a split based operation.
 
-  @param[in] CmdLine      Pointer to the command line to process
-  @param[out] ExitStatus  The exit status of the command. Ignored if NULL.
-                          Invalid if this function returns an error.
+  @param[in] CmdLine    pointer to the command line to process
 
   @retval EFI_SUCCESS   The operation was successful
   @return               an error occured.
@@ -1911,8 +1853,7 @@
 EFI_STATUS
 EFIAPI
 ProcessNewSplitCommandLine(
-  IN CONST CHAR16       *CmdLine,
-  OUT      SHELL_STATUS *ExitStatus
+  IN CONST CHAR16 *CmdLine
   )
 {
   SPLIT_LIST                *Split;
@@ -1933,14 +1874,9 @@
   }
 
   if (Split == NULL) {
-    Status = RunSplitCommand(CmdLine, NULL, NULL, ExitStatus);
+    Status = RunSplitCommand(CmdLine, NULL, NULL);
   } else {
-    Status = RunSplitCommand(
-              CmdLine,
-              Split->SplitStdIn,
-              Split->SplitStdOut,
-              ExitStatus
-              );
+    Status = RunSplitCommand(CmdLine, Split->SplitStdIn, Split->SplitStdOut);
   }
   if (EFI_ERROR(Status)) {
     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_INVALID_SPLIT), ShellInfoObject.HiiHandle, CmdLine);
@@ -2120,8 +2056,6 @@
   @param[in] FirstParameter   the first parameter on the command line
   @param[in] ParamProtocol    the shell parameters protocol pointer
 
-  @param[out] ExitStatus      The exit code of the command. Ignored if NULL.
-
   @retval EFI_SUCCESS     The command was completed.
   @retval EFI_ABORTED     The command's operation was aborted.
 **/
@@ -2130,8 +2064,7 @@
 RunInternalCommand(
   IN CONST CHAR16                   *CmdLine,
   IN       CHAR16                   *FirstParameter,
-  IN EFI_SHELL_PARAMETERS_PROTOCOL  *ParamProtocol,
-  OUT      SHELL_STATUS             *ExitStatus OPTIONAL
+  IN EFI_SHELL_PARAMETERS_PROTOCOL  *ParamProtocol
 )
 {
   EFI_STATUS                Status;
@@ -2158,9 +2091,6 @@
       if (LastError) {
         SetLastError(CommandReturnedStatus);
       }
-      if (ExitStatus != NULL) {
-        *ExitStatus = CommandReturnedStatus;
-      }
 
       //
       // Pass thru the exitcode from the app.
@@ -2215,9 +2145,6 @@
   @param[in] FirstParameter   the first parameter on the command line
   @param[in] ParamProtocol    the shell parameters protocol pointer
 
-  @param[out] ExitStatus      The exit code of the command or file.
-                              Ignored if NULL.
-
   @retval EFI_SUCCESS     The command was completed.
   @retval EFI_ABORTED     The command's operation was aborted.
 **/
@@ -2227,8 +2154,7 @@
   IN       SHELL_OPERATION_TYPES    Type,
   IN CONST CHAR16                   *CmdLine,
   IN       CHAR16                   *FirstParameter,
-  IN EFI_SHELL_PARAMETERS_PROTOCOL  *ParamProtocol,
-  OUT      SHELL_STATUS             *ExitStatus
+  IN EFI_SHELL_PARAMETERS_PROTOCOL  *ParamProtocol
 )
 {
   EFI_STATUS                Status;
@@ -2244,12 +2170,7 @@
 
   switch (Type) {
     case   Internal_Command:
-      Status = RunInternalCommand(
-                CmdLine,
-                FirstParameter,
-                ParamProtocol,
-                &CalleeExitStatus
-                );
+      Status = RunInternalCommand(CmdLine, FirstParameter, ParamProtocol);
       break;
     case   Script_File_Name:
     case   Efi_Application:
@@ -2284,13 +2205,7 @@
       }
       switch (Type) {
         case   Script_File_Name:
-          Status = RunScriptFile (
-                    CommandWithPath,
-                    NULL,
-                    CmdLine,
-                    ParamProtocol,
-                    &CalleeExitStatus
-                    );
+          Status = RunScriptFile (CommandWithPath, NULL, CmdLine, ParamProtocol);
           break;
         case   Efi_Application:
           //
@@ -2310,9 +2225,7 @@
             DevPath,
             CmdLine,
             NULL,
-            &StartStatus,
-            NULL,
-            NULL
+            &StartStatus
            );
 
           SHELL_FREE_NON_NULL(DevPath);
@@ -2345,10 +2258,6 @@
 
   SHELL_FREE_NON_NULL(CommandWithPath);
 
-  if (ExitStatus != NULL) {
-    *ExitStatus = CalleeExitStatus;
-  }
-
   return (Status);
 }
 
@@ -2360,9 +2269,6 @@
   @param[in] FirstParameter   the first parameter on the command line.
   @param[in] ParamProtocol    the shell parameters protocol pointer
 
-  @param[out] ExitStatus      The exit code of the command or file.
-                              Ignored if NULL.
-
   @retval EFI_SUCCESS     The command was completed.
   @retval EFI_ABORTED     The command's operation was aborted.
 **/
@@ -2369,11 +2275,10 @@
 EFI_STATUS
 EFIAPI
 SetupAndRunCommandOrFile(
-  IN   SHELL_OPERATION_TYPES          Type,
-  IN   CHAR16                         *CmdLine,
-  IN   CHAR16                         *FirstParameter,
-  IN   EFI_SHELL_PARAMETERS_PROTOCOL  *ParamProtocol,
-  OUT  SHELL_STATUS                   *ExitStatus
+  IN SHELL_OPERATION_TYPES          Type,
+  IN CHAR16                         *CmdLine,
+  IN CHAR16                         *FirstParameter,
+  IN EFI_SHELL_PARAMETERS_PROTOCOL  *ParamProtocol
 )
 {
   EFI_STATUS                Status;
@@ -2392,13 +2297,7 @@
   // Now run the command, script, or application
   //
   if (!EFI_ERROR(Status)) {
-    Status = RunCommandOrFile(
-              Type,
-              CmdLine,
-              FirstParameter,
-              ParamProtocol,
-              ExitStatus
-              );
+    Status = RunCommandOrFile(Type, CmdLine, FirstParameter, ParamProtocol);
   }
 
   //
@@ -2423,7 +2322,6 @@
   command or dispatch an external application.
 
   @param[in] CmdLine      The command line to parse.
-  @param[out] ExitStatus  The exit code of the command. Ignored if NULL.
 
   @retval EFI_SUCCESS     The command was completed.
   @retval EFI_ABORTED     The command's operation was aborted.
@@ -2431,8 +2329,7 @@
 EFI_STATUS
 EFIAPI
 RunCommand(
-  IN CONST CHAR16         *CmdLine,
-  OUT      SHELL_STATUS   *ExitStatus
+  IN CONST CHAR16   *CmdLine
   )
 {
   EFI_STATUS                Status;
@@ -2492,7 +2389,7 @@
   // We dont do normal processing with a split command line (output from one command input to another)
   //
   if (ContainsSplit(CleanOriginal)) {
-    Status = ProcessNewSplitCommandLine(CleanOriginal, ExitStatus);
+    Status = ProcessNewSplitCommandLine(CleanOriginal);
     SHELL_FREE_NON_NULL(CleanOriginal);
     return (Status);
   } 
@@ -2518,13 +2415,7 @@
     case   Internal_Command:
     case   Script_File_Name:
     case   Efi_Application:
-      Status = SetupAndRunCommandOrFile(
-                Type,
-                CleanOriginal,
-                FirstParameter,
-                ShellInfoObject.NewShellParametersProtocol,
-                ExitStatus
-                );
+      Status = SetupAndRunCommandOrFile(Type, CleanOriginal, FirstParameter, ShellInfoObject.NewShellParametersProtocol);
       break;
     default:
       //
@@ -2579,16 +2470,13 @@
   @param[in] Handle             The handle to the already opened file.
   @param[in] Name               The name of the script file.
 
-  @param[out] ExitStatus      The exit code of the script. Ignored if NULL.
-
   @retval EFI_SUCCESS           the script completed sucessfully
 **/
 EFI_STATUS
 EFIAPI
 RunScriptFileHandle (
-  IN  SHELL_FILE_HANDLE  Handle,
-  IN  CONST CHAR16       *Name,
-  OUT SHELL_STATUS       *ExitStatus
+  IN SHELL_FILE_HANDLE  Handle,
+  IN CONST CHAR16       *Name
   )
 {
   EFI_STATUS          Status;
@@ -2604,11 +2492,8 @@
   CONST CHAR16        *CurDir;
   UINTN               LineCount;
   CHAR16              LeString[50];
-  SHELL_STATUS        CalleeExitStatus;
 
   ASSERT(!ShellCommandGetScriptExit());
-  
-  CalleeExitStatus = SHELL_SUCCESS;
 
   PreScriptEchoState = ShellCommandGetEchoState();
 
@@ -2792,7 +2677,7 @@
             //
             PreCommandEchoState = ShellCommandGetEchoState();
             ShellCommandSetEchoState(FALSE);
-            Status = RunCommand(CommandLine3+1, NULL);
+            Status = RunCommand(CommandLine3+1);
 
             //
             // If command was "@echo -off" or "@echo -on" then don't restore echo state
@@ -2814,7 +2699,7 @@
               }
               ShellPrintEx(-1, -1, L"%s\r\n", CommandLine2);
             }
-            Status = RunCommand(CommandLine3, NULL);
+            Status = RunCommand(CommandLine3);
           }
         }
 
@@ -2822,8 +2707,7 @@
           //
           // ShellCommandGetExitCode() always returns a UINT64
           //
-          CalleeExitStatus = (SHELL_STATUS) ShellCommandGetExitCode();
-          UnicodeSPrint(LeString, sizeof(LeString), L"0x%Lx", CalleeExitStatus);
+          UnicodeSPrint(LeString, sizeof(LeString), L"0x%Lx", ShellCommandGetExitCode());
           DEBUG_CODE(InternalEfiShellSetEnv(L"debuglasterror", LeString, TRUE););
           InternalEfiShellSetEnv(L"lasterror", LeString, TRUE);
 
@@ -2835,11 +2719,9 @@
           break;
         }
         if (EFI_ERROR(Status)) {
-          CalleeExitStatus = (SHELL_STATUS) Status;
           break;
         }
         if (ShellCommandGetExit()) {
-          CalleeExitStatus = (SHELL_STATUS) ShellCommandGetExitCode();
           break;
         }
       }
@@ -2871,11 +2753,6 @@
   if (ShellCommandGetCurrentScriptFile()==NULL) {
     ShellCommandSetEchoState(PreScriptEchoState);
   }
-
-  if (ExitStatus != NULL) {
-    *ExitStatus = CalleeExitStatus;
-  }
-
   return (EFI_SUCCESS);
 }
 
@@ -2887,18 +2764,15 @@
   @param[in] CmdLine            the command line to run.
   @param[in] ParamProtocol      the shell parameters protocol pointer
 
-  @param[out] ExitStatus      The exit code of the script. Ignored if NULL.
-
   @retval EFI_SUCCESS           the script completed sucessfully
 **/
 EFI_STATUS
 EFIAPI
 RunScriptFile (
-  IN  CONST CHAR16                   *ScriptPath,
-  IN  SHELL_FILE_HANDLE              Handle OPTIONAL,
-  IN  CONST CHAR16                   *CmdLine,
-  IN  EFI_SHELL_PARAMETERS_PROTOCOL  *ParamProtocol,
-  OUT SHELL_STATUS                   *ExitStatus
+  IN CONST CHAR16                   *ScriptPath,
+  IN SHELL_FILE_HANDLE              Handle OPTIONAL,
+  IN CONST CHAR16                   *CmdLine,
+  IN EFI_SHELL_PARAMETERS_PROTOCOL  *ParamProtocol
   )
 {
   EFI_STATUS          Status;
@@ -2925,7 +2799,7 @@
         //
         // run it
         //
-        Status = RunScriptFileHandle(FileHandle, ScriptPath, ExitStatus);
+        Status = RunScriptFileHandle(FileHandle, ScriptPath);
 
         //
         // now close the file
@@ -2933,7 +2807,7 @@
         ShellCloseFile(&FileHandle);
       }
     } else {
-      Status = RunScriptFileHandle(Handle, ScriptPath, ExitStatus);
+      Status = RunScriptFileHandle(Handle, ScriptPath);
     }
   }
 
Index: Shell.h
===================================================================
--- Shell.h	(revision 16122)
+++ Shell.h	(working copy)
@@ -231,8 +231,6 @@
 
   @param[in] ImagePath          The path to the image for shell.  The first place to look for the startup script.
   @param[in] FilePath           The path to the file for shell.  The second place to look for the startup script.
-  @param[out] ExitStatus        The exit code of the script. Ignored if NULL.
-                                Invalid when this function returns an error.
 
   @retval EFI_SUCCESS           The variable is initialized.
 **/
@@ -239,9 +237,8 @@
 EFI_STATUS
 EFIAPI
 DoStartupScript(
-  IN  EFI_DEVICE_PATH_PROTOCOL *ImagePath,
-  IN  EFI_DEVICE_PATH_PROTOCOL *FilePath,
-  OUT SHELL_STATUS             *ExitStatus
+  IN EFI_DEVICE_PATH_PROTOCOL *ImagePath,
+  IN EFI_DEVICE_PATH_PROTOCOL *FilePath
   );
 
 /**
@@ -286,8 +283,7 @@
 
   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] ExitStatus  The exit status of the command. Ignored if NULL.
+  @param[in] CmdLine  the command line to parse
 
   @retval EFI_SUCCESS     the command was completed
   @retval EFI_ABORTED     the command's operation was aborted
@@ -295,8 +291,7 @@
 EFI_STATUS
 EFIAPI
 RunCommand(
-  IN  CONST CHAR16         *CmdLine,
-  OUT       SHELL_STATUS   *ExitStatus
+  IN CONST CHAR16   *CmdLine
   );
 
 /**
@@ -320,17 +315,13 @@
   @param[in] Handle             The handle to the already opened file.
   @param[in] Name               The name of the script file.
 
-  @param[out] ExitStatus      The exit code of the script. Ignored if NULL.
-                              Invalid when this function returns an error.
-
   @retval EFI_SUCCESS           the script completed sucessfully
 **/
 EFI_STATUS
 EFIAPI
 RunScriptFileHandle (
-  IN  SHELL_FILE_HANDLE  Handle,
-  IN  CONST CHAR16       *Name,
-  OUT SHELL_STATUS       *ExitStatus
+  IN SHELL_FILE_HANDLE  Handle,
+  IN CONST CHAR16       *Name
   );
 
 /**
@@ -341,20 +332,17 @@
   @param[in] CmdLine            the command line to run.
   @param[in] ParamProtocol      the shell parameters protocol pointer
 
-  @param[out] ExitStatus      The exit code of the script. Ignored if NULL.
-                              Invalid when this function returns an error.
-
   @retval EFI_SUCCESS           the script completed sucessfully
 **/
 EFI_STATUS
 EFIAPI
 RunScriptFile (
-  IN  CONST CHAR16                   *ScriptPath,
-  IN  SHELL_FILE_HANDLE              Handle OPTIONAL,
-  IN  CONST CHAR16                   *CmdLine,
-  IN  EFI_SHELL_PARAMETERS_PROTOCOL  *ParamProtocol,
-  OUT SHELL_STATUS                   *ExitStatus
+  IN CONST CHAR16                   *ScriptPath,
+  IN SHELL_FILE_HANDLE              Handle OPTIONAL,
+  IN CONST CHAR16                   *CmdLine,
+  IN EFI_SHELL_PARAMETERS_PROTOCOL  *ParamProtocol
   );
 
+
 #endif //_SHELL_INTERNAL_HEADER_
 
Index: ShellProtocol.c
===================================================================
--- ShellProtocol.c	(revision 16122)
+++ ShellProtocol.c	(working copy)
@@ -1401,8 +1401,6 @@
                                 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 @@
   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,19 +1425,9 @@
   EFI_LOADED_IMAGE_PROTOCOL     *LoadedImage;
   LIST_ENTRY                    OrigEnvs;
   EFI_SHELL_PARAMETERS_PROTOCOL ShellParamsProtocol;
-  UINTN                         InternalExitDataSize;
-  UINTN                         *ExitDataSizePtr;
   CHAR16                        *ImagePath;
   UINTN                         Index;
 
-  // 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);
   }
@@ -1534,13 +1520,13 @@
     ///@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;
@@ -1627,8 +1613,6 @@
   CHAR16                    *Temp;
   EFI_DEVICE_PATH_PROTOCOL  *DevPath;
   UINTN                     Size;
-  UINTN                     ExitDataSize;
-  CHAR16                    *ExitData;
 
   if ((PcdGet8(PcdShellSupportLevel) < 1)) {
     return (EFI_UNSUPPORTED);
@@ -1656,33 +1640,8 @@
     DevPath,
     Temp,
     (CONST CHAR16**)Environment,
-    StatusCode,
-    &ExitDataSize,
-    &ExitData);
+    StatusCode);
 
-    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;
-    }
-
   //
   // de-allocate and return
   //
Index: ShellProtocol.h
===================================================================
--- ShellProtocol.h	(revision 16122)
+++ ShellProtocol.h	(working copy)
@@ -445,8 +445,6 @@
                                 environment variable name and y is the value. If this
                                 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.
@@ -461,9 +459,7 @@
   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
   );
 
 /**
