]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Forms.c
MdePkg: introduce standalone MM entry point library implementation
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / FrameworkHiiOnUefiHiiThunk / Forms.c
index d39001f981bb1eb353ea02a7d8c53e17559e0ac7..1fe6487197d5681c6f7fcb60761925c4b21c4433 100644 (file)
@@ -1,8 +1,8 @@
-/**@file\r
+/** @file\r
   This file contains the form processing code to the HII database.\r
 \r
-Copyright (c) 2006 - 2008 Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2010, 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
@@ -23,7 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 typedef struct {\r
   EFI_HII_PACK_HEADER            PackageHeader;\r
   FRAMEWORK_EFI_IFR_FORM_SET     FormSet;\r
-  FRAMEWORK_EFI_IFR_END_FORM_SET EndFormSet;\r
+  EFI_IFR_END_FORM_SET           EndFormSet;\r
 } FW_HII_FORMSET_TEMPLATE;\r
 #pragma pack()\r
 \r
@@ -47,8 +47,8 @@ FW_HII_FORMSET_TEMPLATE FormSetTemplate = {
   },\r
   {\r
     {\r
-      FRAMEWORK_EFI_IFR_END_FORM_SET_OP,\r
-      sizeof (FRAMEWORK_EFI_IFR_END_FORM_SET)\r
+      EFI_IFR_END_FORM_SET_OP,\r
+      sizeof (EFI_IFR_END_FORM_SET)\r
     }\r
   }\r
 };\r
@@ -59,7 +59,7 @@ EFI_GUID  mTianoHiiIfrGuid              = EFI_IFR_TIANO_GUID;
 /**\r
 \r
   This thunk module only handles UEFI HII packages. The caller of this function \r
-  won¡¯t be able to parse the content. Therefore, it is not supported.\r
+  won't be able to parse the content. Therefore, it is not supported.\r
   \r
   This function will ASSERT and return EFI_UNSUPPORTED.\r
 \r
@@ -289,7 +289,7 @@ GetPackageData (
   EFI_HII_PACKAGE_HEADER        *Package;\r
   UINT32                        Offset;\r
   UINT32                        PackageListLength;\r
-  EFI_HII_PACKAGE_HEADER        PackageHeader = {0, 0};\r
+  EFI_HII_PACKAGE_HEADER        PackageHeader;\r
 \r
   ASSERT(HiiPackageList != NULL);\r
 \r
@@ -297,6 +297,7 @@ GetPackageData (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  ZeroMem (&PackageHeader, sizeof (PackageHeader));\r
   Package = NULL;\r
   Index   = 0;\r
   Offset  = sizeof (EFI_HII_PACKAGE_LIST_HEADER);\r
@@ -407,13 +408,15 @@ LocateLabel (
   with value as the same as the input Label in the Formset registered with UefiHiiHandle. The FormSet GUID \r
   and Form ID is returned if such Label is found.\r
 \r
+  @param Handle       Uefi Hii Handle to be searched.\r
+  @param Label        The first Label ID to be found.\r
+  @param FormsetGuid  The matched FormSet GUID.\r
+  @param FormId       The matched Form ID.\r
   \r
   @retval EFI_INVALID_PARAMETER If UefiHiiHandle is not a valid handle.\r
-  @retval EFI_NOT_FOUND   The package list identified by UefiHiiHandle deos not contain FormSet or\r
-                                         There is no Form ID with value Label found in all Form Sets in the pacakge\r
-                                         list.\r
-                                         \r
-  @retval EFI_SUCCESS       The first found Form ID is returned in FormId.\r
+  @retval EFI_NOT_FOUND         The package list identified by UefiHiiHandle deos not contain FormSet or\r
+                                Form ID with value Label found in all Form Sets in the pacakge list.\r
+  @retval EFI_SUCCESS           The first found Form ID is returned in FormId.\r
 **/\r
 EFI_STATUS\r
 LocateFormId (\r
@@ -567,6 +570,7 @@ HiiThunkUpdateForm (
     if (Data->DataCount != 0) {\r
 \r
       ThunkContext = UefiHiiHandleToThunkContext (Private, UefiHiiHandle);\r
+      ASSERT (ThunkContext != NULL);\r
       Status = FwUpdateDataToUefiUpdateData (ThunkContext, Data, StartOpCodeHandle);\r
       ASSERT_EFI_ERROR (Status);\r
 \r