diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-01-09 05:45:06 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-01-09 05:45:06 +0000 |
commit | 4c8d993000ed8fa51bfb1e3da7ed24105dcc01e7 (patch) | |
tree | d9c4d06ad763adb13fcd5abd4798a4b69dce7617 | |
parent | 3f3809474ea8ce3681f9c103c985ce2bf4247724 (diff) | |
download | edk2-4c8d993000ed8fa51bfb1e3da7ed24105dcc01e7.zip edk2-4c8d993000ed8fa51bfb1e3da7ed24105dcc01e7.tar.gz edk2-4c8d993000ed8fa51bfb1e3da7ed24105dcc01e7.tar.bz2 |
Add CompareFormsetGuid() in UefiIfrSupportLib to abstract the GUID comparison for HII formset package.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/branches/UefiHiiEnable4354@4532 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdeModulePkg/Library/UefiIfrSupportLib/UefiIfrCommon.c | 28 | ||||
-rw-r--r-- | MdeModulePkg/Universal/UefiSetupBrowserDxe/IfrParse.c | 2 | ||||
-rw-r--r-- | MdeModulePkg/Universal/UefiSetupBrowserDxe/Setup.c | 2 | ||||
-rw-r--r-- | MdePkg/Include/Library/UefiIfrSupportLib.h | 19 | ||||
-rw-r--r-- | MdePkg/Library/HiiLib/HiiLib.c | 3 | ||||
-rw-r--r-- | MdePkg/Library/HiiLib/HiiLib.inf | 1 |
6 files changed, 52 insertions, 3 deletions
diff --git a/MdeModulePkg/Library/UefiIfrSupportLib/UefiIfrCommon.c b/MdeModulePkg/Library/UefiIfrSupportLib/UefiIfrCommon.c index 78a90c1..c8a77eb 100644 --- a/MdeModulePkg/Library/UefiIfrSupportLib/UefiIfrCommon.c +++ b/MdeModulePkg/Library/UefiIfrSupportLib/UefiIfrCommon.c @@ -368,3 +368,31 @@ ExtractGuidFromHiiHandle ( return EFI_SUCCESS; } +/**
+ Compares GUID with the payload GUID in HII formset pacakge.
+
+ @param Guid A pointer to a 128 bit GUID.
+ @param OpCodeData A pointer to op-code associated with the forms data described
+ in EFI_HII_FORM_PACKAGE.
+
+ @retval TRUE Guid matches the GUID contained in OpCodeData.
+ @retval FALSE Guid does not match the GUID contained in OpCodeData.
+
+**/ +BOOLEAN +EFIAPI +CompareFormSetGuid ( + IN CONST EFI_GUID *Guid, + IN VOID *OpCode + ) +{ + EFI_IFR_OP_HEADER *EfiIfrHeader; + VOID *PayLoad; + EFI_GUID *FormSetGuid; + + EfiIfrHeader = OpCode; + PayLoad = EfiIfrHeader + 1; + FormSetGuid = PayLoad; + + return CompareGuid(Guid, FormSetGuid); +} diff --git a/MdeModulePkg/Universal/UefiSetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/UefiSetupBrowserDxe/IfrParse.c index 5b02b55..4e5ea43 100644 --- a/MdeModulePkg/Universal/UefiSetupBrowserDxe/IfrParse.c +++ b/MdeModulePkg/Universal/UefiSetupBrowserDxe/IfrParse.c @@ -1495,7 +1495,7 @@ ParseOpCodes ( // Vendor specific // case EFI_IFR_GUID_OP: - if (CompareGuid (&((EFI_IFR_GUID_BANNER *) OpCodeData)->Guid, &gTianoHiiIfrGuid)) { + if (CompareFormSetGuid (&gTianoHiiIfrGuid, OpCodeData)) { // // Tiano specific GUIDed opcodes // diff --git a/MdeModulePkg/Universal/UefiSetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/UefiSetupBrowserDxe/Setup.c index 2fcc2b4..2b5493d 100644 --- a/MdeModulePkg/Universal/UefiSetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/UefiSetupBrowserDxe/Setup.c @@ -2127,7 +2127,7 @@ GetIfrBinaryData ( // // FormSet GUID is specified, check it // - if (CompareGuid (FormSetGuid, &((EFI_IFR_FORM_SET *) OpCodeData)->Guid)) { + if (CompareFormSetGuid (FormSetGuid, OpCodeData)) { break; } } diff --git a/MdePkg/Include/Library/UefiIfrSupportLib.h b/MdePkg/Include/Library/UefiIfrSupportLib.h index 3343f69..af4a616 100644 --- a/MdePkg/Include/Library/UefiIfrSupportLib.h +++ b/MdePkg/Include/Library/UefiIfrSupportLib.h @@ -93,6 +93,25 @@ typedef struct { UINT8 *Data;
} EFI_HII_UPDATE_DATA;
+
+/**
+ Compares GUID with the payload GUID in HII formset pacakge.
+
+ @param Guid A pointer to a 128 bit GUID.
+ @param OpCodeData A pointer to op-code associated with the forms data described
+ in EFI_HII_FORM_PACKAGE.
+
+ @retval TRUE Guid matches the GUID contained in OpCodeData.
+ @retval FALSE Guid does not match the GUID contained in OpCodeData.
+
+**/
+BOOLEAN +EFIAPI +CompareFormSetGuid ( + IN CONST EFI_GUID *Guid, + IN VOID *OpCodeData + );
+
//
// Exported Library functions
//
diff --git a/MdePkg/Library/HiiLib/HiiLib.c b/MdePkg/Library/HiiLib/HiiLib.c index 173187e..845a006 100644 --- a/MdePkg/Library/HiiLib/HiiLib.c +++ b/MdePkg/Library/HiiLib/HiiLib.c @@ -28,6 +28,7 @@ #include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Library/UefiIfrSupportLib.h>
#include <MdeModuleHii.h>
@@ -760,7 +761,7 @@ Returns: }
if ((((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_GUID_OP) &&
- (CompareMem (&mIfrVendorGuid, &((EFI_IFR_GUID *) OpCodeData)->Guid, sizeof (EFI_GUID)) == 0) &&
+ CompareFormSetGuid (&mIfrVendorGuid, OpCodeData) &&
(((EFI_IFR_GUID_CLASS *) OpCodeData)->ExtendOpCode == EFI_IFR_EXTEND_OP_CLASS)
) {
//
diff --git a/MdePkg/Library/HiiLib/HiiLib.inf b/MdePkg/Library/HiiLib/HiiLib.inf index 06277e7..4c35314 100644 --- a/MdePkg/Library/HiiLib/HiiLib.inf +++ b/MdePkg/Library/HiiLib/HiiLib.inf @@ -44,6 +44,7 @@ [LibraryClasses]
MemoryAllocationLib
DebugLib
+ UefiIfrSupportLib
[Protocols]
gEfiHiiDatabaseProtocolGuid # ALWAYS_CONSUMED
|