12#define MAX_LEN_DRIVER_NAME 35
42 Status =
gBS->OpenProtocol (
44 &gEfiLoadedImageProtocolGuid,
45 (VOID **)&LoadedImage,
48 EFI_OPEN_PROTOCOL_GET_PROTOCOL
50 if (!EFI_ERROR (Status)) {
51 Status =
gBS->OpenProtocol (
53 &gEfiDevicePathProtocolGuid,
54 (VOID **)&ImageDevicePath,
57 EFI_OPEN_PROTOCOL_GET_PROTOCOL
59 if (!EFI_ERROR (Status)) {
63 &gEfiDevicePathProtocolGuid,
71 &gEfiLoadedImageProtocolGuid,
77 if (FinalPath ==
NULL) {
81 RetVal = gEfiShellProtocol->GetFilePathFromDevicePath (FinalPath);
106 if (EFI_ERROR (Status)) {
129 if (EFI_ERROR (Status)) {
131 if (EFI_ERROR (Status)) {
158 Status =
gBS->OpenProtocol ((
EFI_HANDLE)TheHandle, &gEfiDriverBindingProtocolGuid, (VOID **)&DriverBinding,
gImageHandle,
NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
159 if (!EFI_ERROR (Status)) {
160 RetVal = DriverBinding->
Version;
186 UINT32 AuthenticationStatus;
190 DriverBinding =
NULL;
193 Status =
gBS->OpenProtocol (
195 &gEfiDriverBindingProtocolGuid,
196 (VOID **)&DriverBinding,
199 EFI_OPEN_PROTOCOL_GET_PROTOCOL
201 if (EFI_ERROR (Status)) {
205 Status =
gBS->OpenProtocol (
207 &gEfiLoadedImageProtocolGuid,
208 (VOID **)&LoadedImage,
211 EFI_OPEN_PROTOCOL_GET_PROTOCOL
213 if (!EFI_ERROR (Status)) {
214 DevPathNode = LoadedImage->
FilePath;
215 if (DevPathNode ==
NULL) {
221 if (NameGuid !=
NULL) {
222 Status =
gBS->HandleProtocol (
224 &gEfiFirmwareVolume2ProtocolGuid,
227 if (!EFI_ERROR (Status)) {
228 Status = Fv2->ReadSection (
231 EFI_SECTION_USER_INTERFACE,
235 &AuthenticationStatus
237 if (!EFI_ERROR (Status)) {
251 if (ImageName ==
NULL) {
274 CHAR16 *ProblemParam;
282 CHAR16 ChildCountStr[21];
283 CHAR16 DeviceCountStr[21];
285 CONST CHAR16 *FullDriverName;
286 CHAR16 *TruncatedDriverName;
288 CHAR16 *FormatString;
289 UINT32 DriverVersion;
290 BOOLEAN DriverConfig;
313 if (EFI_ERROR (Status)) {
314 if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam !=
NULL)) {
330 if (Language ==
NULL) {
338 ASSERT (Language ==
NULL);
356 gShellDriver1HiiHandle,
369 gShellDriver1HiiHandle
373 if (FormatString ==
NULL) {
381 for (HandleWalker = HandleList; HandleWalker !=
NULL && *HandleWalker !=
NULL; HandleWalker++) {
395 TruncatedDriverName =
NULL;
396 if (!SfoFlag && (FullDriverName !=
NULL)) {
397 TruncatedDriverName =
AllocateZeroPool ((MAX_LEN_DRIVER_NAME + 1) *
sizeof (CHAR16));
398 if (TruncatedDriverName ==
NULL) {
404 StrnCpyS (TruncatedDriverName, MAX_LEN_DRIVER_NAME + 1, FullDriverName, MAX_LEN_DRIVER_NAME);
414 ChildCount > 0 ? L
'B' : (DeviceCount > 0 ? L
'D' : L
'?'),
415 DriverConfig ? L
'X' : L
'-',
416 DriverDiag ? L
'X' : L
'-',
417 DeviceCount > 0 ? DeviceCountStr : L
"-",
418 ChildCount > 0 ? ChildCountStr : L
"-",
420 ImageName ==
NULL ? L
"" : ImageName
429 ChildCount > 0 ? L
'B' : (DeviceCount > 0 ? L
'D' : L
'?'),
430 DriverConfig ? L
'Y' : L
'N',
431 DriverDiag ? L
'Y' : L
'N',
435 Temp2 ==
NULL ? L
"" : Temp2
439 if (TruncatedDriverName !=
NULL) {
447 if (ImageName !=
NULL) {
458 SHELL_FREE_NON_NULL (Language);
460 SHELL_FREE_NON_NULL (FormatString);
463 return (ShellStatus);
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
RETURN_STATUS EFIAPI StrnCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
BOOLEAN EFIAPI IsDevicePathEnd(IN CONST VOID *Node)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI NextDevicePathNode(IN CONST VOID *Node)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI AppendDevicePath(IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath OPTIONAL)
CHAR16 *EFIAPI ConvertDevicePathToText(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts)
UINT32 ReturnDriverVersion(IN CONST EFI_HANDLE TheHandle)
BOOLEAN ReturnDriverDiag(IN CONST EFI_HANDLE TheHandle)
CHAR16 * GetImageNameFromHandle(IN CONST EFI_HANDLE Handle)
CHAR16 * GetDevicePathTextForHandle(IN EFI_HANDLE TheHandle)
SHELL_STATUS EFIAPI ShellCommandRunDrivers(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
BOOLEAN ReturnDriverConfig(IN CONST EFI_HANDLE TheHandle)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
CONST CHAR16 *EFIAPI GetStringNameFromHandle(IN CONST EFI_HANDLE TheHandle, IN CONST CHAR8 *Language)
EFI_STATUS EFIAPI ParseHandleDatabaseForChildDevices(IN CONST EFI_HANDLE DriverHandle, IN UINTN *MatchingHandleCount, OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL)
#define PARSE_HANDLE_DATABASE_DEVICES(DriverHandle, Count, Buffer)
UINTN EFIAPI ConvertHandleToHandleIndex(IN CONST EFI_HANDLE TheHandle)
EFI_HANDLE *EFIAPI GetHandleListByProtocol(IN CONST EFI_GUID *ProtocolGuid OPTIONAL)
EFI_STRING EFIAPI HiiGetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
RETURN_STATUS EFIAPI UnicodeValueToStringS(IN OUT CHAR16 *Buffer, IN UINTN BufferSize, IN UINTN Flags, IN INT64 Value, IN UINTN Width)
UINTN EFIAPI AsciiSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString,...)
#define ASSERT_EFI_ERROR(StatusParameter)
@ SHELL_INVALID_PARAMETER
EFI_STATUS EFIAPI CommandInit(VOID)
CONST CHAR16 *EFIAPI ShellCommandLineGetValue(IN CONST LIST_ENTRY *CheckPackage, IN CHAR16 *KeyString)
BOOLEAN EFIAPI ShellGetExecutionBreakFlag(VOID)
#define ShellCommandLineParse(CheckList, CheckPackage, ProblemParam, AutoPageBreak)
Make it easy to upgrade from older versions of the shell library.
EFI_STATUS EFIAPI ShellPrintHiiEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR8 *Language OPTIONAL, IN CONST EFI_STRING_ID HiiFormatStringId, IN CONST EFI_HII_HANDLE HiiFormatHandle,...)
BOOLEAN EFIAPI ShellCommandLineGetFlag(IN CONST LIST_ENTRY *CONST CheckPackage, IN CONST CHAR16 *CONST KeyString)
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
@ TypeFlag
A flag that is present or not present only (IE "-a").
VOID EFIAPI ShellCommandLineFreeVarList(IN LIST_ENTRY *CheckPackage)
EFI_STATUS EFIAPI ShellInitialize(VOID)
EFI_STATUS EFIAPI ShellPrintEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR16 *Format,...)
UINTN EFIAPI ShellCommandLineGetCount(IN CONST LIST_ENTRY *CheckPackage)
EFI_GUID *EFIAPI EfiGetNameGuidFromFwVolDevicePathNode(IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode)
EFI_DEVICE_PATH_PROTOCOL * FilePath
EFI_HANDLE DeviceHandle
The device handle that the EFI Image was loaded from.