Fix FreePoll() bugs in some places.

Removed the dependency to MdeModulePkg in the HiiLibFramework
Removed EDK_RELEASE_VERSION and EFI_SPECIFICATION_VERSION in the Framework inf file.
other coding style changes


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7218 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
gdong1 2009-01-08 09:37:30 +00:00
parent fce9f9bba0
commit 1b74e1c7ff
7 changed files with 38 additions and 43 deletions

View File

@ -1,8 +1,8 @@
#/** @file #/** @file
# Library instance for HII common routines. # Library instance for HII common routines.
# This library instance implements the common HII routines.
# #
# This library instance implements the common HII routines. # Copyright (c) 2006, Intel Corporation.
# Copyright (c) 2006, Intel Corporation
# #
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -21,12 +21,9 @@
MODULE_TYPE = DXE_DRIVER MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0 VERSION_STRING = 1.0
LIBRARY_CLASS = FrameworkHiiLib,HiiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER LIBRARY_CLASS = FrameworkHiiLib,HiiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
EDK_RELEASE_VERSION = 0x00020000 PI_SPECIFICATION_VERSION = 0x00000009
EFI_SPECIFICATION_VERSION = 0x00020000
CONSTRUCTOR = FrameworkHiiLibConstructor CONSTRUCTOR = FrameworkHiiLibConstructor
# #
# The following information is for reference only and not required by the build tools. # The following information is for reference only and not required by the build tools.
# #

View File

@ -804,6 +804,7 @@ ValidateDataFromHiiHandle (
// //
VariableData = AllocateZeroPool (SizeOfNvStore); VariableData = AllocateZeroPool (SizeOfNvStore);
if (VariableData == NULL) { if (VariableData == NULL) {
FreePool (OldData);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -832,6 +833,7 @@ ValidateDataFromHiiHandle (
VariableData = AllocatePool (SizeOfNvStore); VariableData = AllocatePool (SizeOfNvStore);
if (VariableData == NULL) { if (VariableData == NULL) {
FreePool (OldData);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -875,7 +877,7 @@ ValidateDataFromHiiHandle (
// //
if (!GotMatch) { if (!GotMatch) {
*Results = FALSE; *Results = FALSE;
return EFI_SUCCESS; goto EXIT;
} }
break; break;
@ -886,7 +888,7 @@ ValidateDataFromHiiHandle (
// //
if (VariableData[((FRAMEWORK_EFI_IFR_CHECKBOX *) &RawData[Index])->QuestionId] > 1) { if (VariableData[((FRAMEWORK_EFI_IFR_CHECKBOX *) &RawData[Index])->QuestionId] > 1) {
*Results = FALSE; *Results = FALSE;
return EFI_SUCCESS; goto EXIT;
} }
break; break;
@ -894,7 +896,7 @@ ValidateDataFromHiiHandle (
if ((VariableData[((FRAMEWORK_EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] < ((FRAMEWORK_EFI_IFR_NUMERIC *)&RawData[Index])->Minimum) || if ((VariableData[((FRAMEWORK_EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] < ((FRAMEWORK_EFI_IFR_NUMERIC *)&RawData[Index])->Minimum) ||
(VariableData[((FRAMEWORK_EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] > ((FRAMEWORK_EFI_IFR_NUMERIC *)&RawData[Index])->Maximum)) { (VariableData[((FRAMEWORK_EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] > ((FRAMEWORK_EFI_IFR_NUMERIC *)&RawData[Index])->Maximum)) {
*Results = FALSE; *Results = FALSE;
return EFI_SUCCESS; goto EXIT;
} }
break; break;
@ -903,11 +905,12 @@ ValidateDataFromHiiHandle (
Index = RawData[Index + 1] + Index; Index = RawData[Index + 1] + Index;
} }
EXIT:
// //
// Free our temporary repository of form data // Free our temporary repository of form data
// //
gBS->FreePool (OldData); FreePool (OldData);
gBS->FreePool (VariableData); FreePool (VariableData);
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -72,6 +72,8 @@ CreateFormSet (
GetCurrentLanguage (CurrentLanguage); GetCurrentLanguage (CurrentLanguage);
Status = AddString (*StringBuffer, CurrentLanguage, FormSetTitle, &StringToken); Status = AddString (*StringBuffer, CurrentLanguage, FormSetTitle, &StringToken);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
FreePool (FormBuffer);
FreePool (StringBuffer);
return Status; return Status;
} }

View File

@ -1,9 +1,10 @@
#/** @file #/** @file
# EDK Internal Form Refresentation Support Library Instance. # EDK Internal Form Refresentation Support Library Instance.
# #
# The library instance provides common library routines help in # The library instance provides common library routines help in IFR creation on-the-fly,
# IFR creation on-the-fly, HII variable access, HII database access, multi language supports. # HII variable access, HII database access, multi language supports.
# Copyright (c) 2006 - 2007, Intel Corporation. #
# Copyright (c) 2006 - 2007, Intel Corporation.
# #
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -22,8 +23,7 @@
MODULE_TYPE = DXE_DRIVER MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0 VERSION_STRING = 1.0
LIBRARY_CLASS = FrameworkIfrSupportLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER LIBRARY_CLASS = FrameworkIfrSupportLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
EDK_RELEASE_VERSION = 0x00020000 PI_SPECIFICATION_VERSION = 0x00000009
EFI_SPECIFICATION_VERSION = 0x00020000
# #
# The following information is for reference only and not required by the build tools. # The following information is for reference only and not required by the build tools.
@ -40,12 +40,10 @@
IfrCommon.c IfrCommon.c
IfrSupportLibInternal.h IfrSupportLibInternal.h
[Packages] [Packages]
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
IntelFrameworkPkg/IntelFrameworkPkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec
[LibraryClasses] [LibraryClasses]
UefiRuntimeServicesTableLib UefiRuntimeServicesTableLib
UefiBootServicesTableLib UefiBootServicesTableLib
@ -54,11 +52,8 @@
BaseLib BaseLib
DebugLib DebugLib
[Guids] [Guids]
gEfiGlobalVariableGuid # ALWAYS_CONSUMED gEfiGlobalVariableGuid # CONSUMED, Variable Name: L"Lan"
[Protocols] [Protocols]
gEfiHiiProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiHiiProtocolGuid # PROTOCOL ALWAYS_CONSUMED

View File

@ -1,11 +1,13 @@
#/** @file #/** @file
# Component description file for the entry point to a EFIDXE Drivers # Component description file for the entry point to a EFIDXE Drivers
# #
# Library to abstract Framework extensions that conflict with UEFI 2.0 Specification # Library to abstract Framework extensions that conflict with UEFI 2.0 Specification.
# Help Port Framework/Tinao code that has conflicts with UEFI 2.0 by hiding the oldconflicts
# with library functions and supporting implementations of the old (EDK/EFI 1.10) and new
# (EDK II/UEFI 2.0) way. This module is a DXE driver as it contains DXE enum extensions for
# EFI event services.
# #
# Help Port Framework/Tinao code that has conflicts with UEFI 2.0 by hiding the oldconflicts with library functions and supporting implementations of the old # Copyright (c) 2006, Intel Corporation.
# (EDK/EFI 1.10) and new (EDK II/UEFI 2.0) way. This module is a DXE driver as it contains DXE enum extensions for EFI event services.
# Copyright (c) 2006, Intel Corporation.
# #
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -25,7 +27,6 @@
VERSION_STRING = 1.0 VERSION_STRING = 1.0
LIBRARY_CLASS = UefiLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER LIBRARY_CLASS = UefiLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
# #
# VALID_ARCHITECTURES = IA32 X64 IPF EBC # VALID_ARCHITECTURES = IA32 X64 IPF EBC
# #
@ -38,12 +39,10 @@
UefiLib.c UefiLib.c
UefiLibInternal.h UefiLibInternal.h
[Packages] [Packages]
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
IntelFrameworkPkg/IntelFrameworkPkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec
[LibraryClasses] [LibraryClasses]
PrintLib PrintLib
PcdLib PcdLib
@ -59,7 +58,6 @@
gEfiEventReadyToBootGuid # ALWAYS_CONSUMED gEfiEventReadyToBootGuid # ALWAYS_CONSUMED
gEfiEventLegacyBootGuid # ALWAYS_CONSUMED gEfiEventLegacyBootGuid # ALWAYS_CONSUMED
[Protocols] [Protocols]
gEfiDriverBindingProtocolGuid # ALWAYS_CONSUMED gEfiDriverBindingProtocolGuid # ALWAYS_CONSUMED
gEfiSimpleTextOutProtocolGuid # ALWAYS_CONSUMED gEfiSimpleTextOutProtocolGuid # ALWAYS_CONSUMED
@ -84,5 +82,3 @@
gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable
gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport

View File

@ -17,7 +17,6 @@
#include <Protocol/FrameworkHii.h> #include <Protocol/FrameworkHii.h>
#include <Library/HiiLib.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <Library/UefiBootServicesTableLib.h> #include <Library/UefiBootServicesTableLib.h>
#include <Library/MemoryAllocationLib.h> #include <Library/MemoryAllocationLib.h>

View File

@ -1,8 +1,9 @@
#/** @file #/** @file
# Library instance for HII common routines. # Library instance for HII common routines.
# #
# This library instance implements the common HII routines. # This library instance implements the common HII routines.
# Copyright (c) 2006, Intel Corporation #
# Copyright (c) 2006, Intel Corporation
# #
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -21,13 +22,10 @@
MODULE_TYPE = DXE_DRIVER MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0 VERSION_STRING = 1.0
LIBRARY_CLASS = HiiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER LIBRARY_CLASS = HiiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
EDK_RELEASE_VERSION = 0x00020000 PI_SPECIFICATION_VERSION = 0x00000009
EFI_SPECIFICATION_VERSION = 0x00020000
CONSTRUCTOR = HiiLibFrameworkConstructor CONSTRUCTOR = HiiLibFrameworkConstructor
# #
# The following information is for reference only and not required by the build tools. # The following information is for reference only and not required by the build tools.
# #
@ -39,10 +37,15 @@
[Packages] [Packages]
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
IntelFrameworkPkg/IntelFrameworkPkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec
[LibraryClasses] [LibraryClasses]
MemoryAllocationLib MemoryAllocationLib
UefiBootServicesTableLib
DebugLib DebugLib
[Protocols]
gEfiHiiProtocolGuid # PROTOCOL ALWAYS_CONSUMED
[Depex]
gEfiHiiProtocolGuid