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