Update shell binaries to Shell 1.05 release and integrate an issue to solve RFC3066 language compatibility issues.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5440 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,189 +1,325 @@
|
||||
diff -urN Shell1.04\Shell/Library/DPath.c EdkCompatibilityPkg\Shell/Library/DPath.c
|
||||
--- Shell1.04\Shell/Library/DPath.c 2007-11-15 14:38:52.000000000 +0800
|
||||
+++ EdkCompatibilityPkg\Shell/Library/DPath.c 2008-02-25 13:38:07.000000000 +0800
|
||||
@@ -1,6 +1,6 @@
|
||||
/*++
|
||||
diff -urN --binary -a -x CVS Oldv1.5/Application/Shell/Library/EfiShellLib.h Newv1.5/Application/Shell/Library/EfiShellLib.h
|
||||
--- Oldv1.5/Application/Shell/Library/EfiShellLib.h 2008-06-10 13:46:56.000000000 +0800
|
||||
+++ Newv1.5/Application/Shell/Library/EfiShellLib.h 2008-07-09 11:45:28.026417300 +0800
|
||||
@@ -174,22 +174,23 @@
|
||||
//
|
||||
// Environment variable name constants
|
||||
//
|
||||
-#define VarLanguageCodes L"LangCodes"
|
||||
-#define VarLanguage L"Lang"
|
||||
-#define VarTimeout L"Timeout"
|
||||
-#define VarConsoleIn L"ConIn"
|
||||
-#define VarConsoleOut L"ConOut"
|
||||
-#define VarErrorOut L"ErrOut"
|
||||
-#define VarBootOption L"Boot%04x"
|
||||
-#define VarBootOrder L"BootOrder"
|
||||
-#define VarBootNext L"BootNext"
|
||||
-#define VarBootCurrent L"BootCurrent"
|
||||
-#define VarDriverOption L"Driver%04x"
|
||||
-#define VarDriverOrder L"DriverOrder"
|
||||
-#define VarConsoleInpDev L"ConInDev"
|
||||
-#define VarConsoleOutDev L"ConOutDev"
|
||||
-#define VarErrorOutDev L"ErrOutDev"
|
||||
-#define LanguageCodeEnglish "eng"
|
||||
+#define VarLanguageCodes L"LangCodes"
|
||||
+#define VarLanguage L"Lang"
|
||||
+#define VarTimeout L"Timeout"
|
||||
+#define VarConsoleIn L"ConIn"
|
||||
+#define VarConsoleOut L"ConOut"
|
||||
+#define VarErrorOut L"ErrOut"
|
||||
+#define VarBootOption L"Boot%04x"
|
||||
+#define VarBootOrder L"BootOrder"
|
||||
+#define VarBootNext L"BootNext"
|
||||
+#define VarBootCurrent L"BootCurrent"
|
||||
+#define VarDriverOption L"Driver%04x"
|
||||
+#define VarDriverOrder L"DriverOrder"
|
||||
+#define VarConsoleInpDev L"ConInDev"
|
||||
+#define VarConsoleOutDev L"ConOutDev"
|
||||
+#define VarErrorOutDev L"ErrOutDev"
|
||||
+#define LanguageCodeEnglish "eng"
|
||||
+#define PlatformLanguageCodeEnglish "en-US"
|
||||
|
||||
-Copyright (c) 2005 - 2007, Intel Corporation
|
||||
+Copyright (c) 2005 - 2008, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -1294,17 +1294,8 @@
|
||||
ASSERT (Str != NULL);
|
||||
ASSERT (DevPath != NULL);
|
||||
#define ISO_639_2_ENTRY_SIZE 3
|
||||
#define RFC_3066_ENTRY_SIZE 12
|
||||
@@ -333,4 +334,10 @@
|
||||
IN CHAR8 *LangCode
|
||||
);
|
||||
|
||||
- if (ST->Hdr.Revision > 0x00020000) {
|
||||
- FvPath = DevPath;
|
||||
- CatPrint (Str, L"Fv(%g)", &FvPath->NameGuid);
|
||||
- } else if (ST->Hdr.Revision < 0x00020000) {
|
||||
- //
|
||||
- // MEDIA_FV_FILEPATH_DP_EFI_1_10 == MEDIA_FV_DP == 0x06
|
||||
- //
|
||||
- _DevPathFvFilePath (Str, DevPath);
|
||||
- } else {
|
||||
- _DevPathNodeUnknown (Str, DevPath);
|
||||
- }
|
||||
+ FvPath = DevPath;
|
||||
+ CatPrint (Str, L"Fv(%g)", &FvPath->NameGuid);
|
||||
}
|
||||
+CHAR8 *
|
||||
+ExtractSupportedLanguage (
|
||||
+ IN CONST CHAR8 *SupportedLanguages,
|
||||
+ IN CONST CHAR8 *Language
|
||||
+ );
|
||||
+
|
||||
#endif
|
||||
|
||||
@@ -2006,16 +1997,11 @@
|
||||
#if (EFI_SPECIFICATION_VERSION > 0x00020000)
|
||||
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_EFI_2_00 *FvDevicePathNodeUefi_2_00;
|
||||
|
||||
- if (ST->Hdr.Revision > 0x00020000) {
|
||||
+ if (ST->Hdr.Revision != 0x00020000) {
|
||||
if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
|
||||
DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) {
|
||||
return &FvDevicePathNode->NameGuid;
|
||||
}
|
||||
- } else if (ST->Hdr.Revision < 0x00020000) {
|
||||
- if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
|
||||
- DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP_EFI_1_10) {
|
||||
- return &FvDevicePathNode->NameGuid;
|
||||
- }
|
||||
} else {
|
||||
FvDevicePathNodeUefi_2_00 = (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_EFI_2_00 *)FvDevicePathNode;
|
||||
if (DevicePathType (&FvDevicePathNodeUefi_2_00->Piwg.Header) == MEDIA_DEVICE_PATH &&
|
||||
diff -urN Shell1.04\Shell/Library/DPath.h EdkCompatibilityPkg\Shell/Library/DPath.h
|
||||
--- Shell1.04\Shell/Library/DPath.h 2007-11-14 22:48:14.000000000 +0800
|
||||
+++ EdkCompatibilityPkg\Shell/Library/DPath.h 2008-02-25 13:38:07.000000000 +0800
|
||||
@@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
-Copyright (c) 2005 - 2007, Intel Corporation
|
||||
+Copyright (c) 2005 - 2008, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -161,11 +161,6 @@
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION > 0x00020000)
|
||||
//
|
||||
-// For EFI1.10 FV file device path
|
||||
-//
|
||||
-#define MEDIA_FV_FILEPATH_DP_EFI_1_10 0x06
|
||||
-
|
||||
-//
|
||||
// For UEFI2.0 FV file device path
|
||||
//
|
||||
typedef struct {
|
||||
diff -urN Shell1.04\Shell/Library/FileIO.c EdkCompatibilityPkg\Shell/Library/FileIO.c
|
||||
--- Shell1.04\Shell/Library/FileIO.c 2006-03-15 11:54:44.000000000 +0800
|
||||
+++ EdkCompatibilityPkg\Shell/Library/FileIO.c 2008-03-24 13:44:52.000000000 +0800
|
||||
@@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
-Copyright (c) 2005, Intel Corporation
|
||||
+Copyright (c) 2005 - 2008, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -253,14 +253,16 @@
|
||||
|
||||
--*/
|
||||
{
|
||||
- EFI_STATUS Status;
|
||||
- EFI_FILE_HANDLE LastHandle;
|
||||
- FILEPATH_DEVICE_PATH *FilePathNode;
|
||||
+ EFI_STATUS Status;
|
||||
+ EFI_FILE_HANDLE LastHandle;
|
||||
+ FILEPATH_DEVICE_PATH *FilePathNode;
|
||||
+ EFI_DEVICE_PATH_PROTOCOL *AlignedFilePath;
|
||||
|
||||
ASSERT (FilePath != NULL);
|
||||
ASSERT (DeviceHandle != NULL);
|
||||
ASSERT (FileHandle != NULL);
|
||||
-
|
||||
+
|
||||
+ AlignedFilePath = NULL;
|
||||
//
|
||||
// File the file system for this file path
|
||||
//
|
||||
@@ -274,12 +276,26 @@
|
||||
*FileHandle = LibOpenRoot (*DeviceHandle);
|
||||
Status = *FileHandle ? EFI_SUCCESS : EFI_UNSUPPORTED;
|
||||
|
||||
+ if (EFI_ERROR (Status)) {
|
||||
+ return Status;
|
||||
+ }
|
||||
+
|
||||
+ //
|
||||
+ // Duplicate FilePath to make sure it is aligned so that
|
||||
+ // FilePathNode->PathName below is 16-bit aligned.
|
||||
+ //
|
||||
+ AlignedFilePath = DuplicateDevicePath(*FilePath);
|
||||
+ if (AlignedFilePath == NULL) {
|
||||
+ (*FileHandle)->Close (*FileHandle);
|
||||
+ *FileHandle = NULL;
|
||||
+ return EFI_OUT_OF_RESOURCES;
|
||||
+ }
|
||||
+ FilePathNode = (FILEPATH_DEVICE_PATH *)AlignedFilePath;
|
||||
//
|
||||
// To access as a file system, the file path should only
|
||||
// contain file path components. Follow the file path nodes
|
||||
// and find the target file
|
||||
//
|
||||
- FilePathNode = (FILEPATH_DEVICE_PATH *) *FilePath;
|
||||
while (!IsDevicePathEnd (&FilePathNode->Header)) {
|
||||
//
|
||||
// For file system access each node should be a file path component
|
||||
@@ -332,6 +348,7 @@
|
||||
if (EFI_ERROR (Status)) {
|
||||
*FileHandle = NULL;
|
||||
diff -urN --binary -a -x CVS Oldv1.5/Application/Shell/Library/Misc.c Newv1.5/Application/Shell/Library/Misc.c
|
||||
--- Oldv1.5/Application/Shell/Library/Misc.c 2008-06-10 13:46:56.000000000 +0800
|
||||
+++ Newv1.5/Application/Shell/Library/Misc.c 2008-07-09 11:45:28.088917700 +0800
|
||||
@@ -2271,3 +2271,76 @@
|
||||
}
|
||||
+ FreePool(AlignedFilePath);
|
||||
|
||||
return Status;
|
||||
return Lang;
|
||||
}
|
||||
diff -urN Shell1.04\Shell/shellenv/var.c EdkCompatibilityPkg\Shell/shellenv/var.c
|
||||
--- Shell1.04\Shell/shellenv/var.c 2006-03-07 16:20:44.000000000 +0800
|
||||
+++ EdkCompatibilityPkg\Shell/shellenv/var.c 2008-02-25 13:38:08.000000000 +0800
|
||||
@@ -389,8 +389,15 @@
|
||||
{
|
||||
UINTN Size;
|
||||
VARIABLE_ID *Var;
|
||||
+ UINTN RoundUpValueSize;
|
||||
|
||||
- Size = sizeof (VARIABLE_ID) + StrSize (Name) + ValueSize;
|
||||
+ //
|
||||
+ // Variable buffer layout: VARIABLE_ID + Value + Name
|
||||
+ // We need to round up the variable size to make sure Name is aligned (for IPF).
|
||||
+ //
|
||||
+ RoundUpValueSize = (ValueSize % 2) ? (ValueSize + 1) : ValueSize;
|
||||
+
|
||||
+ Size = sizeof (VARIABLE_ID) + StrSize (Name) + RoundUpValueSize;
|
||||
Var = AllocateZeroPool (Size);
|
||||
if (Var == NULL) {
|
||||
return NULL;
|
||||
@@ -398,7 +405,7 @@
|
||||
+CHAR8 *
|
||||
+ExtractSupportedLanguage (
|
||||
+ IN CONST CHAR8 *SupportedLanguages,
|
||||
+ IN CONST CHAR8 *Language
|
||||
+ )
|
||||
+/*++
|
||||
+
|
||||
+ Routine Description:
|
||||
+
|
||||
+ This function matches the major language code (first two characters) in the
|
||||
+ SupportedLanguages. The first language code in the SupportedLanguages that
|
||||
+ matches first two characters of the input Language is returned. If there is no
|
||||
+ such match, then NULL is returned.
|
||||
+
|
||||
+ Arguments:
|
||||
+
|
||||
+ SupportedLanguages - A Null-terminated ASCII string that contains one
|
||||
+ or more supported language codes.
|
||||
+
|
||||
+ LangCode - A pointer to a Null-terminated ASCII string
|
||||
+ array indicating the RFC 3066 language.
|
||||
+
|
||||
+ Returns:
|
||||
+
|
||||
+ The RFC3066 language code that matches the major language.
|
||||
+
|
||||
+--*/
|
||||
+{
|
||||
+ CONST CHAR8 *CurrentLanguage;
|
||||
+ CHAR8 *SupportedLanguage;
|
||||
+ UINTN LanguageLen;
|
||||
+
|
||||
+ CurrentLanguage = SupportedLanguages;
|
||||
+
|
||||
+ while (CurrentLanguage != '\0') {
|
||||
+ //
|
||||
+ // Search till the end of current language.
|
||||
+ //
|
||||
+ LanguageLen = 0;
|
||||
+ while (CurrentLanguage[LanguageLen] != ';' && CurrentLanguage[LanguageLen] != '\0') {
|
||||
+ LanguageLen++;
|
||||
+ }
|
||||
+
|
||||
+ //
|
||||
+ // should use AsciiStrnCmp(CurrentLanguage, Language, 2) == 0
|
||||
+ //
|
||||
+ if ((CurrentLanguage[0] == Language[0]) && (CurrentLanguage[1] == Language[1])) {
|
||||
+ //
|
||||
+ // Match the major language code, then return a new copy of
|
||||
+ // NULL-terminated SupportedLanguage.
|
||||
+ //
|
||||
+ SupportedLanguage = AllocatePool (LanguageLen + 1);
|
||||
+ CopyMem (SupportedLanguage, (VOID *) CurrentLanguage, LanguageLen);
|
||||
+
|
||||
+ SupportedLanguage[LanguageLen] = '\0';
|
||||
+
|
||||
+ return SupportedLanguage;
|
||||
+ }
|
||||
+ //
|
||||
+ // Make CurrentLangue point to the next candiate language code.
|
||||
+ //
|
||||
+ CurrentLanguage += LanguageLen;
|
||||
+ if (*CurrentLanguage == ';') {
|
||||
+ CurrentLanguage++;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
diff -urN --binary -a -x CVS Oldv1.5/Application/Shell/SmbiosView/PrintInfo.c Newv1.5/Application/Shell/SmbiosView/PrintInfo.c
|
||||
--- Oldv1.5/Application/Shell/SmbiosView/PrintInfo.c 2007-11-26 14:01:00.000000000 +0800
|
||||
+++ Newv1.5/Application/Shell/SmbiosView/PrintInfo.c 2008-07-09 12:36:07.646190700 +0800
|
||||
@@ -1779,7 +1779,7 @@
|
||||
//
|
||||
// MaxSize is determined by follow formula
|
||||
//
|
||||
- MaxSize = 1 << Size;
|
||||
+ MaxSize = (UINTN) 1 << Size;
|
||||
PrintToken (STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_MB), HiiHandle, MaxSize);
|
||||
|
||||
Var->Signature = VARIABLE_SIGNATURE;
|
||||
Var->u.Value = ((UINT8 *) Var) + sizeof (VARIABLE_ID);
|
||||
- Var->Name = (CHAR16 *) (Var->u.Value + ValueSize);
|
||||
+ Var->Name = (CHAR16 *) (Var->u.Value + RoundUpValueSize);
|
||||
Var->ValueSize = ValueSize;
|
||||
CopyMem (Var->u.Value, Value, ValueSize);
|
||||
StrCpy (Var->Name, Name);
|
||||
diff -urN Shell1.04\Shell/ver/Ver.inf EdkCompatibilityPkg\Shell/ver/Ver.inf
|
||||
--- Shell1.04\Shell/ver/Ver.inf 2007-03-04 23:30:48.000000000 +0800
|
||||
+++ EdkCompatibilityPkg\Shell/ver/Ver.inf 2008-03-03 13:36:05.000000000 +0800
|
||||
@@ -1,6 +1,6 @@
|
||||
#/*++
|
||||
#
|
||||
-# Copyright (c) 2005 - 2007, Intel Corporation
|
||||
+# Copyright (c) 2005 - 2008, Intel Corporation
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@@ -45,7 +45,7 @@
|
||||
Ver.c
|
||||
Ver.h
|
||||
|
||||
-[sources.ia32|x64]
|
||||
+[sources.ia32,sources.x64]
|
||||
ia32\ver32.c
|
||||
if (Option >= SHOW_DETAIL) {
|
||||
diff -urN --binary -a -x CVS Oldv1.5/Application/Shell/SmbiosView/Smbios.h Newv1.5/Application/Shell/SmbiosView/Smbios.h
|
||||
--- Oldv1.5/Application/Shell/SmbiosView/Smbios.h 2006-03-07 16:20:46.000000000 +0800
|
||||
+++ Newv1.5/Application/Shell/SmbiosView/Smbios.h 2008-07-09 10:29:41.548254500 +0800
|
||||
@@ -34,11 +34,6 @@
|
||||
|
||||
[sources.ipf]
|
||||
extern EFI_HII_HANDLE HiiHandle;
|
||||
|
||||
-#define EFI_SMBIOS_TABLE_GUID \
|
||||
- { \
|
||||
- 0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
|
||||
- }
|
||||
|
||||
-extern EFI_GUID gEfiSmbiosTableGuid;
|
||||
|
||||
#endif
|
||||
diff -urN --binary -a -x CVS Oldv1.5/Application/Shell/drivers/drivers.c Newv1.5/Application/Shell/drivers/drivers.c
|
||||
--- Oldv1.5/Application/Shell/drivers/drivers.c 2008-05-26 13:22:52.000000000 +0800
|
||||
+++ Newv1.5/Application/Shell/drivers/drivers.c 2008-07-09 12:36:16.552668700 +0800
|
||||
@@ -130,6 +130,7 @@
|
||||
UINTN StringIndex;
|
||||
UINTN Index;
|
||||
CHAR8 *Language;
|
||||
+ CHAR8 *PlatformLanguage;
|
||||
UINTN DriverImageHandleCount;
|
||||
EFI_HANDLE *DriverImageHandleBuffer;
|
||||
UINTN HandleIndex;
|
||||
@@ -152,6 +153,7 @@
|
||||
SHELL_VAR_CHECK_PACKAGE ChkPck;
|
||||
|
||||
Language = NULL;
|
||||
+ PlatformLanguage = NULL;
|
||||
DriverImageHandleCount = 0;
|
||||
DriverImageHandleBuffer = NULL;
|
||||
IsHelp = FALSE;
|
||||
@@ -241,7 +243,7 @@
|
||||
goto Done;
|
||||
}
|
||||
|
||||
- Language = LibGetVariableLang ();
|
||||
+ Language = LibGetVariable (L"Lang", &gEfiGlobalVariableGuid);
|
||||
if (Language == NULL) {
|
||||
Language = (CHAR8 *)AllocateZeroPool(strlena(LanguageCodeEnglish) + 1);
|
||||
if (Language == NULL) {
|
||||
@@ -250,6 +252,15 @@
|
||||
strcpya(Language, LanguageCodeEnglish);
|
||||
}
|
||||
|
||||
+ PlatformLanguage = LibGetVariable (L"PlatformLang", &gEfiGlobalVariableGuid);
|
||||
+ if (PlatformLanguage == NULL) {
|
||||
+ PlatformLanguage = (CHAR8 *)AllocateZeroPool(strlena(PlatformLanguageCodeEnglish) + 1);
|
||||
+ if (PlatformLanguage == NULL) {
|
||||
+ return EFI_OUT_OF_RESOURCES;
|
||||
+ }
|
||||
+ strcpya(PlatformLanguage, PlatformLanguageCodeEnglish);
|
||||
+ }
|
||||
+
|
||||
Item = LibCheckVarGetFlag (&ChkPck, L"-l");
|
||||
if (Item) {
|
||||
if (Language != NULL) {
|
||||
@@ -314,14 +325,6 @@
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
|
||||
- ComponentName = NULL;
|
||||
- ComponentName2 = NULL;
|
||||
- Status = LibGetComponentNameProtocol (
|
||||
- DriverImageHandleBuffer[Index],
|
||||
- &ComponentName,
|
||||
- &ComponentName2
|
||||
- );
|
||||
-
|
||||
DiagnosticsStatus = BS->OpenProtocol (
|
||||
DriverImageHandleBuffer[Index],
|
||||
&gEfiDriverDiagnostics2ProtocolGuid,
|
||||
@@ -418,37 +421,73 @@
|
||||
} else {
|
||||
PrintToken (STRING_TOKEN (STR_SHELLENV_PROTID_ONE_VAR_D), HiiHandle, NumberOfChildren);
|
||||
}
|
||||
-
|
||||
- Status = EFI_SUCCESS;
|
||||
+
|
||||
DriverName = L"<UNKNOWN>";
|
||||
- SupportedLanguage = NULL;
|
||||
- if (ComponentName != NULL) {
|
||||
- if (ComponentName->GetDriverName != NULL) {
|
||||
- SupportedLanguage = LibConvertSupportedLanguage (ComponentName->SupportedLanguages, Language);
|
||||
+ Status = BS->OpenProtocol (
|
||||
+ DriverImageHandleBuffer[Index],
|
||||
+ &gEfiComponentName2ProtocolGuid,
|
||||
+ (VOID **) &ComponentName2,
|
||||
+ NULL,
|
||||
+ NULL,
|
||||
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
+ );
|
||||
+ if (!EFI_ERROR (Status)) {
|
||||
+ //
|
||||
+ // Driver has Component Name 2 Protocol is available, we get the
|
||||
+ // driver name var RFC 3066 language code
|
||||
+ //
|
||||
+ Status = ComponentName2->GetDriverName (
|
||||
+ ComponentName2,
|
||||
+ PlatformLanguage,
|
||||
+ &DriverName
|
||||
+ );
|
||||
+ if (EFI_ERROR (Status)) {
|
||||
+ //
|
||||
+ // Current RFC3066 language code fails, we then extract the supported
|
||||
+ // language from Component Name 2 protocol interface.
|
||||
+ //
|
||||
+ SupportedLanguage = ExtractSupportedLanguage(ComponentName2->SupportedLanguages, Language);
|
||||
+ if (SupportedLanguage != NULL) {
|
||||
+ Status = ComponentName2->GetDriverName (
|
||||
+ ComponentName2,
|
||||
+ SupportedLanguage,
|
||||
+ &DriverName
|
||||
+ );
|
||||
+ FreePool(SupportedLanguage);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if (EFI_ERROR (Status)) {
|
||||
+ //
|
||||
+ // In case Component Name 2 protocol is not available or some error occurs
|
||||
+ // when getting driver name from Component Name 2 protocol, we get driver
|
||||
+ // name from Component Name protocol.
|
||||
+ //
|
||||
+ Status = BS->OpenProtocol (
|
||||
+ DriverImageHandleBuffer[Index],
|
||||
+ &gEfiComponentNameProtocolGuid,
|
||||
+ (VOID **) &ComponentName,
|
||||
+ NULL,
|
||||
+ NULL,
|
||||
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
+ );
|
||||
+ if (!EFI_ERROR (Status)) {
|
||||
Status = ComponentName->GetDriverName (
|
||||
ComponentName,
|
||||
- SupportedLanguage,
|
||||
+ Language,
|
||||
&DriverName
|
||||
);
|
||||
}
|
||||
- } else if (ComponentName2 != NULL) {
|
||||
- if (ComponentName2->GetDriverName != NULL) {
|
||||
- SupportedLanguage = LibConvertSupportedLanguage (ComponentName2->SupportedLanguages, Language);
|
||||
- Status = ComponentName2->GetDriverName (
|
||||
- ComponentName2,
|
||||
- SupportedLanguage,
|
||||
- &DriverName
|
||||
- );
|
||||
- }
|
||||
}
|
||||
- if (SupportedLanguage != NULL) {
|
||||
- FreePool (SupportedLanguage);
|
||||
- }
|
||||
-
|
||||
if (EFI_ERROR (Status)) {
|
||||
+ //
|
||||
+ // Fails to get driver name from either Component Name 2 & Component Name
|
||||
+ // Protocol, we show "<UNKNOWN>" string as driver name.
|
||||
+ //
|
||||
DriverName = L"<UNKNOWN>";
|
||||
}
|
||||
|
||||
+
|
||||
for (StringIndex = 0; StringIndex < StrLen (DriverName) && StringIndex < 35; StringIndex++) {
|
||||
FormattedDriverName[StringIndex] = DriverName[StringIndex];
|
||||
}
|
||||
@@ -491,6 +530,10 @@
|
||||
FreePool (Language);
|
||||
}
|
||||
|
||||
+ if (PlatformLanguage != NULL) {
|
||||
+ FreePool (PlatformLanguage);
|
||||
+ }
|
||||
+
|
||||
ShellCloseHandleEnumerator ();
|
||||
LibCheckVarFreeVarList (&ChkPck);
|
||||
LibUnInitializeStrings ();
|
||||
|
Reference in New Issue
Block a user