-/**@file\r
+/** @file\r
\r
This file contains the keyboard processing code to the HII database.\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
#include "HiiDatabase.h"\r
#include "HiiHandle.h"\r
#include <Library/DebugLib.h>\r
+#include <Guid/ZeroGuid.h>\r
\r
-CONST EFI_GUID gZeroGuid = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};\r
CONST CHAR16 FrameworkReservedVarstoreName[] = FRAMEWORK_RESERVED_VARSTORE_NAME;\r
\r
/**\r
&Size,\r
PackageListHdr\r
);\r
- ASSERT_EFI_ERROR (Status != EFI_BUFFER_TOO_SMALL);\r
+ ASSERT (Status != EFI_BUFFER_TOO_SMALL);\r
\r
if (Status == EFI_BUFFER_TOO_SMALL) {\r
PackageListHdr = AllocateZeroPool (Size);\r
/**\r
Find the corressponding HII Thunk Context from a UEFI HII Handle given.\r
\r
- @param Private The HII Thunk Module Private context.\r
- @param UEFIHiiHandle The UEFI HII Handle.\r
+ @param Private The HII Thunk Module Private context.\r
+ @param UefiHiiHandle The UEFI HII Handle.\r
\r
@return NULL If UEFI HII Handle is invalid.\r
@return The corresponding HII Thunk Context.\r
/**\r
Clean up the HII Thunk Context for a UEFI HII Handle.\r
\r
- @param Private The HII Thunk Module Private context.\r
- @param UEFIHiiHandle The UEFI HII Handle.\r
+ @param Private The HII Thunk Module Private context.\r
+ @param UefiHiiHandle The UEFI HII Handle.\r
\r
**/\r
VOID\r
DestroyThunkContextForUefiHiiHandle (\r
IN HII_THUNK_PRIVATE_DATA *Private,\r
IN EFI_HII_HANDLE UefiHiiHandle\r
- )\r
+ )\r
{\r
HII_THUNK_CONTEXT *ThunkContext;\r
\r
\r
\r
/**\r
- This function create a HII_THUNK_CONTEXT for a package list registered\r
- by a module calling EFI_HII_DATABASE_PROTOCOL.NewPackageList. It records\r
- the PackageListGuid in EFI_HII_PACKAGE_LIST_HEADER in the TagGuid in \r
- HII_THUNK_CONTEXT created. This TagGuid will be used as a key to s\r
+ This function create a HII_THUNK_CONTEXT for the input UEFI HiiHandle\r
+ that is created when a package list registered by a module calling \r
+ EFI_HII_DATABASE_PROTOCOL.NewPackageList. \r
+ This function records the PackageListGuid of EFI_HII_PACKAGE_LIST_HEADER \r
+ into the TagGuid of the created HII_THUNK_CONTEXT.\r
+\r
+ @param UefiHiiHandle The UEFI HII Handle.\r
+ \r
+ @return the new created Hii thunk context.\r
\r
**/\r
HII_THUNK_CONTEXT *\r
CreateThunkContextForUefiHiiHandle (\r
IN EFI_HII_HANDLE UefiHiiHandle\r
- )\r
+ )\r
{\r
EFI_STATUS Status;\r
EFI_GUID PackageGuid;\r
\r
@param Private The HII Thunk Private Context.\r
@param StringPackageCount The String package count.\r
- @param FormSetGuid The IFR Package count.\r
+ @param IfrPackageCount The IFR Package count.\r
\r
@return A newly created Thunk Context.\r
@retval NULL No resource to create a new Thunk Context.\r
{\r
LIST_ENTRY *StorageList;\r
FORMSET_STORAGE *Storage;\r
- FORMSET_STORAGE *DefaultStorage;\r
\r
//\r
// VarStoreId 0 is invalid in UEFI IFR.\r
//\r
- DefaultStorage= NULL;\r
FormSet->DefaultVarStoreId = 0;\r
StorageList = GetFirstNode (&FormSet->StorageListHead);\r
\r
// 1) If VarStore ID of FRAMEWORK_RESERVED_VARSTORE_ID (0x01) is found, Var Store ID is used.\r
//\r
FormSet->DefaultVarStoreId = FRAMEWORK_RESERVED_VARSTORE_ID;\r
- DefaultStorage = Storage;\r
break;\r
}\r
\r
if (!IsNull (&FormSet->StorageListHead, StorageList)) {\r
Storage = FORMSET_STORAGE_FROM_LINK (StorageList);\r
FormSet->DefaultVarStoreId = Storage->VarStoreId;\r
- DefaultStorage = Storage;\r
}\r
\r
}\r
\r
Status = mHiiDatabase->ExportPackageLists (mHiiDatabase, Handle, &BufferSize, HiiPackageList);\r
}\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
+ if (EFI_ERROR (Status) || HiiPackageList == NULL) {\r
+ return EFI_NOT_FOUND;\r
}\r
\r
//\r