TianoCore EDK2 master
Loading...
Searching...
No Matches
DpDynamicCommand.c
Go to the documentation of this file.
1
9#include "Dp.h"
11
26EFIAPI
29 IN EFI_SYSTEM_TABLE *SystemTable,
30 IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters,
32 )
33{
34 gEfiShellParametersProtocol = ShellParameters;
35 gEfiShellProtocol = Shell;
36 return RunDp (gImageHandle, SystemTable);
37}
38
49CHAR16 *
50EFIAPI
53 IN CONST CHAR8 *Language
54 )
55{
56 return HiiGetString (mDpHiiHandle, STRING_TOKEN (STR_GET_HELP_DP), Language);
57}
58
59EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL mDpDynamicCommand = {
60 L"dp",
63};
64
78EFIAPI
80 IN EFI_HANDLE ImageHandle,
81 IN EFI_SYSTEM_TABLE *SystemTable
82 )
83{
84 EFI_STATUS Status;
85
86 mDpHiiHandle = InitializeHiiPackage (ImageHandle);
87 if (mDpHiiHandle == NULL) {
88 return EFI_ABORTED;
89 }
90
91 Status = gBS->InstallProtocolInterface (
92 &ImageHandle,
93 &gEfiShellDynamicCommandProtocolGuid,
95 &mDpDynamicCommand
96 );
97 ASSERT_EFI_ERROR (Status);
98 return Status;
99}
100
110EFIAPI
112 IN EFI_HANDLE ImageHandle
113 )
114{
115 EFI_STATUS Status;
116
117 Status = gBS->UninstallProtocolInterface (
118 ImageHandle,
119 &gEfiShellDynamicCommandProtocolGuid,
120 &mDpDynamicCommand
121 );
122 if (EFI_ERROR (Status)) {
123 return Status;
124 }
125
127 return EFI_SUCCESS;
128}
SHELL_STATUS RunDp(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: Dp.c:670
EFI_HII_HANDLE mDpHiiHandle
Definition: Dp.c:39
SHELL_STATUS EFIAPI DpCommandHandler(IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This, IN EFI_SYSTEM_TABLE *SystemTable, IN EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters, IN EFI_SHELL_PROTOCOL *Shell)
EFI_STATUS EFIAPI DpUnload(IN EFI_HANDLE ImageHandle)
EFI_STATUS EFIAPI DpCommandInitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
CHAR16 *EFIAPI DpCommandGetHelp(IN EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL *This, IN CONST CHAR8 *Language)
EFI_STRING EFIAPI HiiGetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
Definition: HiiString.c:211
VOID EFIAPI HiiRemovePackages(IN EFI_HII_HANDLE HiiHandle)
Definition: HiiLib.c:253
STATIC EFI_HII_HANDLE InitializeHiiPackage(EFI_HANDLE ImageHandle)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
SHELL_STATUS
Definition: Shell.h:21
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_HANDLE gImageHandle
EFI_BOOT_SERVICES * gBS
#define STRING_TOKEN(t)
@ EFI_NATIVE_INTERFACE
Definition: UefiSpec.h:1193
EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL protocol structure.