From e9668a606e6e518025b70487333f17e72a15b8e2 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Fri, 10 Jun 2011 02:11:52 +0000 Subject: Add the missing logic in HiiConfigRouting ExtractConfig() to retrieves FALSE as default value for CheckBox without default flag. Signed-off-by: lgao4 Reviewed-by: ydong10 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11782 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/HiiDatabaseDxe/ConfigRouting.c | 75 +++++++++++++--------- 1 file changed, 44 insertions(+), 31 deletions(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 02d7d7b..29576ba 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -1158,51 +1158,64 @@ ParseIfrData ( InsertBlockData (&VarStorageData->BlockEntry, &BlockData); // - // Add default value by CheckBox Flags + // Add default value for standard ID by CheckBox Flag // + VarDefaultId = EFI_HII_DEFAULT_CLASS_STANDARD; + // + // Prepare new DefaultValue + // + DefaultData = (IFR_DEFAULT_DATA *) AllocateZeroPool (sizeof (IFR_DEFAULT_DATA)); + if (DefaultData == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto Done; + } + DefaultData->OpCode = IfrOpHdr->OpCode; + DefaultData->DefaultId = VarDefaultId; if ((IfrCheckBox->Flags & EFI_IFR_CHECKBOX_DEFAULT) == EFI_IFR_CHECKBOX_DEFAULT) { // - // Set standard ID to Manufacture ID - // - VarDefaultId = EFI_HII_DEFAULT_CLASS_STANDARD; - // - // Prepare new DefaultValue + // When flag is set, defautl value is TRUE. // - DefaultData = (IFR_DEFAULT_DATA *) AllocateZeroPool (sizeof (IFR_DEFAULT_DATA)); - if (DefaultData == NULL) { - Status = EFI_OUT_OF_RESOURCES; - goto Done; - } - DefaultData->OpCode = IfrOpHdr->OpCode; - DefaultData->DefaultId = VarDefaultId; - DefaultData->Value = 1; + DefaultData->Value = 1; + } else { // - // Add DefaultValue into current BlockData + // When flag is not set, defautl value is FASLE. // - InsertDefaultValue (BlockData, DefaultData); + DefaultData->Value = 0; } + // + // Add DefaultValue into current BlockData + // + InsertDefaultValue (BlockData, DefaultData); + // + // Add default value for Manufacture ID by CheckBox Flag + // + VarDefaultId = EFI_HII_DEFAULT_CLASS_MANUFACTURING; + // + // Prepare new DefaultValue + // + DefaultData = (IFR_DEFAULT_DATA *) AllocateZeroPool (sizeof (IFR_DEFAULT_DATA)); + if (DefaultData == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto Done; + } + DefaultData->OpCode = IfrOpHdr->OpCode; + DefaultData->DefaultId = VarDefaultId; if ((IfrCheckBox->Flags & EFI_IFR_CHECKBOX_DEFAULT_MFG) == EFI_IFR_CHECKBOX_DEFAULT_MFG) { // - // Set standard ID to Manufacture ID - // - VarDefaultId = EFI_HII_DEFAULT_CLASS_MANUFACTURING; - // - // Prepare new DefaultValue + // When flag is set, defautl value is TRUE. // - DefaultData = (IFR_DEFAULT_DATA *) AllocateZeroPool (sizeof (IFR_DEFAULT_DATA)); - if (DefaultData == NULL) { - Status = EFI_OUT_OF_RESOURCES; - goto Done; - } - DefaultData->OpCode = IfrOpHdr->OpCode; - DefaultData->DefaultId = VarDefaultId; - DefaultData->Value = 1; + DefaultData->Value = 1; + } else { // - // Add DefaultValue into current BlockData + // When flag is not set, defautl value is FASLE. // - InsertDefaultValue (BlockData, DefaultData); + DefaultData->Value = 0; } + // + // Add DefaultValue into current BlockData + // + InsertDefaultValue (BlockData, DefaultData); break; case EFI_IFR_STRING_OP: -- cgit v1.1