]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c
fixed license header / copyright date on all files.
[mirror_edk2.git] / ShellPkg / Library / UefiShellCEntryLib / UefiShellCEntryLib.c
index ce41166573eb6adad0168e8cc34ff40a07145b99..6160df576a10aada5104db504ed235d3e3ccebb2 100644 (file)
@@ -1,44 +1,41 @@
 /** @file\r
-  Provides application point extension for "C" style main funciton \r
+  Provides application point extension for "C" style main funciton\r
 \r
-Copyright (c) 2009, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
+  Copyright (c) 2009-2010, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
 \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 **/\r
 \r
 #include <Base.h>\r
 \r
 #include <Protocol/SimpleFileSystem.h>\r
+#include <Protocol/LoadedImage.h>\r
 #include <Protocol/EfiShellInterface.h>\r
 #include <Protocol/EfiShellParameters.h>\r
 \r
+#include <Library/ShellCEntryLib.h>\r
 #include <Library/DebugLib.h>\r
 \r
-INTN\r
-EFIAPI \r
-ShellAppMain (\r
-  IN INTN Argc, \r
-  IN CHAR16 **Argv\r
-  );\r
-\r
 /**\r
-  UEFI entry point for an application that will in turn call a C \r
-  style ShellAppMain function.\r
+  UEFI entry point for an application that will in turn call the\r
+  ShellAppMain function which has parameters similar to a standard C\r
+  main function.\r
+\r
+  An application that uses UefiShellCEntryLib must have a ShellAppMain\r
+  function as prototyped in Include/Library/ShellCEntryLib.h.\r
 \r
-  This application must have a function defined as follows:\r
+  @param  ImageHandle  The image handle of the UEFI Application.\r
+  @param  SystemTable  A pointer to the EFI System Table.\r
+\r
+  @retval  EFI_SUCCESS               The application exited normally.\r
+  @retval  Other                     An error occurred.\r
 \r
-  INTN\r
-  EFIAPI\r
-  ShellAppMain (\r
-    IN INTN Argc, \r
-    IN CHAR16 **Argv\r
-    );\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -47,7 +44,7 @@ ShellCEntryLib (
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
-  INT32                         ReturnFromMain;\r
+  INTN                           ReturnFromMain;\r
   EFI_SHELL_PARAMETERS_PROTOCOL *EfiShellParametersProtocol;\r
   EFI_SHELL_INTERFACE           *EfiShellInterface;\r
   EFI_STATUS                    Status;\r
@@ -56,7 +53,7 @@ ShellCEntryLib (
   EfiShellParametersProtocol = NULL;\r
   EfiShellInterface = NULL;\r
 \r
-  Status = SystemTable->BootServices->OpenProtocol(ImageHandle, \r
+  Status = SystemTable->BootServices->OpenProtocol(ImageHandle,\r
                              &gEfiShellParametersProtocolGuid,\r
                              (VOID **)&EfiShellParametersProtocol,\r
                              ImageHandle,\r
@@ -75,7 +72,7 @@ ShellCEntryLib (
     //\r
     // try to get shell 1.0 interface instead.\r
     //\r
-    Status = SystemTable->BootServices->OpenProtocol(ImageHandle, \r
+    Status = SystemTable->BootServices->OpenProtocol(ImageHandle,\r
                                &gEfiShellInterfaceGuid,\r
                                (VOID **)&EfiShellInterface,\r
                                ImageHandle,\r
@@ -85,7 +82,7 @@ ShellCEntryLib (
     if (!EFI_ERROR(Status)) {\r
       //\r
       // use shell 1.0 interface\r
-      // \r
+      //\r
       ReturnFromMain = ShellAppMain (\r
                          EfiShellInterface->Argc,\r
                          EfiShellInterface->Argv\r