2 Main file for NULL named library for install1 shell command functions.
4 Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include "UefiDpLib.h"
17 STATIC CONST CHAR16 mFileName
[] = L
"ShellCommands";
18 EFI_HANDLE gDpHiiHandle
= NULL
;
22 0xeb832fd9, 0x9089, 0x4898, { 0x83, 0xc9, 0x41, 0x61, 0x8f, 0x5c, 0x48, 0xb9 } \
25 EFI_GUID gDpHiiGuid
= DP_HII_GUID
;
28 Function to get the filename with help context if HII will not be used.
30 @return The filename with help text in it.
34 UefiDpLibGetManFileName (
42 Constructor for the Shell Level 1 Commands library.
44 Install the handlers for level 1 UEFI Shell 2.0 commands.
46 @param ImageHandle the image handle of the process
47 @param SystemTable the EFI System Table pointer
49 @retval EFI_SUCCESS the shell command handlers were installed sucessfully
50 @retval EFI_UNSUPPORTED the shell level required was not found.
54 UefiDpLibConstructor (
55 IN EFI_HANDLE ImageHandle
,
56 IN EFI_SYSTEM_TABLE
*SystemTable
60 // check our bit of the profiles mask
62 if ((PcdGet8(PcdShellProfileMask
) & BIT2
) == 0) {
67 // 3rd parameter 'HII strings array' must be name of .uni strings file followed by 'Strings', e.g. mycommands.uni must be
68 // specified as 'mycommandsStrings' because the build Autogen process defines this as a string array for the strings in your
69 // .uni file. Examine your Build folder under your package's DEBUG folder and you will find it defined in a xxxStrDefs.h file.
71 gDpHiiHandle
= HiiAddPackages (&gDpHiiGuid
, gImageHandle
, UefiDpLibStrings
, NULL
);
72 if (gDpHiiHandle
== NULL
) {
73 return (EFI_DEVICE_ERROR
);
77 // install our shell command handlers that are always installed
79 ShellCommandRegisterCommandName(L
"dp", ShellCommandRunDp
, UefiDpLibGetManFileName
, 0, L
"", FALSE
, gDpHiiHandle
, STRING_TOKEN(STR_GET_HELP_DP
));
85 Destructor for the library. free any resources.
87 @param ImageHandle The image handle of the process.
88 @param SystemTable The EFI System Table pointer.
93 IN EFI_HANDLE ImageHandle
,
94 IN EFI_SYSTEM_TABLE
*SystemTable
97 if (gDpHiiHandle
!= NULL
) {
98 HiiRemovePackages(gDpHiiHandle
);
100 return (EFI_SUCCESS
);