ShellPkg/tftp: Convert from NULL class library to Dynamic Command
[mirror_edk2.git] / ShellPkg / DynamicCommand / TftpDynamicCommand / TftpApp.c
CommitLineData
09610023
RN
1/** @file\r
2 Entrypoint of "tftp" shell standalone application.\r
3\r
4 Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved. <BR>\r
5 Copyright (c) 2015, ARM Ltd. All rights reserved.<BR>\r
6\r
7 This program and the accompanying materials\r
8 are licensed and made available under the terms and conditions of the BSD License\r
9 which accompanies this distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
15**/\r
16#include "Tftp.h"\r
17\r
18//\r
19// String token ID of help message text.\r
20// Shell supports to find help message in the resource section of an application image if\r
21// .MAN file is not found. This global variable is added to make build tool recognizes\r
22// that the help string is consumed by user and then build tool will add the string into\r
23// the resource section. Thus the application can use '-?' option to show help message in\r
24// Shell.\r
25//\r
26GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId = STRING_TOKEN (STR_GET_HELP_TFTP);\r
27\r
28/**\r
29 Entry point of Tftp standalone application.\r
30\r
31 @param ImageHandle The image handle of the process.\r
32 @param SystemTable The EFI System Table pointer.\r
33\r
34 @retval EFI_SUCCESS Tftp command is executed sucessfully.\r
35 @retval EFI_ABORTED HII package was failed to initialize.\r
36 @retval others Other errors when executing tftp command.\r
37**/\r
38EFI_STATUS\r
39EFIAPI\r
40TftpAppInitialize (\r
41 IN EFI_HANDLE ImageHandle,\r
42 IN EFI_SYSTEM_TABLE *SystemTable\r
43 )\r
44{\r
45 EFI_STATUS Status;\r
46 mTftpHiiHandle = InitializeHiiPackage (ImageHandle);\r
47 if (mTftpHiiHandle == NULL) {\r
48 return EFI_ABORTED;\r
49 }\r
50\r
51 Status = (EFI_STATUS)RunTftp (ImageHandle, SystemTable);\r
52 HiiRemovePackages (mTftpHiiHandle);\r
53 return Status;\r
54}\r