Add support to original EFI_IFR_FORM_SET in initial UEFI2.1 spec. Now, it has been updated to new one in UEFI2.1D.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9906 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2010-02-02 01:38:00 +00:00
parent 158bb28ae0
commit d228526f93
2 changed files with 23 additions and 16 deletions

View File

@ -1,7 +1,7 @@
/** @file
Parser for IFR binary encoding.
Copyright (c) 2007 - 2009, Intel Corporation
Copyright (c) 2007 - 2010, 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
@ -1110,11 +1110,13 @@ ParseOpCodes (
CopyMem (&FormSet->FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
CopyMem (&FormSet->Help, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
//
// The formset OpCode contains ClassGuid
//
FormSet->NumberOfClassGuid = (UINT8) (((EFI_IFR_FORM_SET *) OpCodeData)->Flags & 0x3);
CopyMem (FormSet->ClassGuid, OpCodeData + sizeof (EFI_IFR_FORM_SET), FormSet->NumberOfClassGuid * sizeof (EFI_GUID));
if (OpCodeLength > OFFSET_OF (EFI_IFR_FORM_SET, Flags)) {
//
// The formset OpCode contains ClassGuid
//
FormSet->NumberOfClassGuid = (UINT8) (((EFI_IFR_FORM_SET *) OpCodeData)->Flags & 0x3);
CopyMem (FormSet->ClassGuid, OpCodeData + sizeof (EFI_IFR_FORM_SET), FormSet->NumberOfClassGuid * sizeof (EFI_GUID));
}
InitializeListHead (&FormSet->ExpressionListHead);
break;

View File

@ -2461,18 +2461,23 @@ GetIfrBinaryData (
break;
}
//
// Try to compare against formset class GUID
//
NumberOfClassGuid = (UINT8) (((EFI_IFR_FORM_SET *) OpCodeData)->Flags & 0x3);
ClassGuid = (EFI_GUID *) (OpCodeData + sizeof (EFI_IFR_FORM_SET));
for (Index = 0; Index < NumberOfClassGuid; Index++) {
if (CompareGuid (ComparingGuid, ClassGuid + Index)) {
ClassGuidMatch = TRUE;
if (((EFI_IFR_OP_HEADER *) OpCodeData)->Length > OFFSET_OF (EFI_IFR_FORM_SET, Flags)) {
//
// Try to compare against formset class GUID
//
NumberOfClassGuid = (UINT8) (((EFI_IFR_FORM_SET *) OpCodeData)->Flags & 0x3);
ClassGuid = (EFI_GUID *) (OpCodeData + sizeof (EFI_IFR_FORM_SET));
for (Index = 0; Index < NumberOfClassGuid; Index++) {
if (CompareGuid (ComparingGuid, ClassGuid + Index)) {
ClassGuidMatch = TRUE;
break;
}
}
if (ClassGuidMatch) {
break;
}
}
if (ClassGuidMatch) {
} else if (ComparingGuid == &gEfiHiiPlatformSetupFormsetGuid) {
ClassGuidMatch = TRUE;
break;
}
}