]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add in code to support the deletion of opcode from a form.
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 30 Apr 2008 06:35:24 +0000 (06:35 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 30 Apr 2008 06:35:24 +0000 (06:35 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5153 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Forms.c
EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/OpcodeCreation.c

index 95bd618bb6414a23717b62a5d28c381287fe1e5b..ee4e2ac988039fb43e1ff8c368617475b2f57018 100644 (file)
@@ -435,32 +435,50 @@ Returns:
     }\r
   }\r
 \r
-  if (Data->DataCount != 0) {\r
-    if (HandleMapEntry->IsPackageListWithOnlyStringPackages) {\r
-      UefiHiiHandle = TagGuidToUefiIfrHiiHandle (Private, &HandleMapEntry->TagGuid);\r
+  if (HandleMapEntry->IsPackageListWithOnlyStringPackages) {\r
+    UefiHiiHandle = TagGuidToUefiIfrHiiHandle (Private, &HandleMapEntry->TagGuid);\r
+  \r
+    if (UefiHiiHandle == NULL) {\r
+      return EFI_INVALID_PARAMETER;\r
+    }\r
+  } else {\r
+    UefiHiiHandle = HandleMapEntry->UefiHiiHandle;\r
+  }\r
 \r
-      if (UefiHiiHandle == NULL) {\r
-        return EFI_INVALID_PARAMETER;\r
-      }\r
+  UefiHiiUpdateData = NULL;\r
+\r
+  if (AddData) {\r
+    if (Data->DataCount != 0) {\r
+      \r
+      Status = ThunkFrameworkUpdateDataToUefiUpdateData (Data, AddData, &UefiHiiUpdateData);\r
+      ASSERT_EFI_ERROR (Status);\r
+\r
+      Status = ThunkLocateFormId (UefiHiiHandle, Label, &FormsetGuid, &FormId);\r
+      ASSERT_EFI_ERROR (Status);\r
+\r
+      Status = IfrLibUpdateForm (UefiHiiHandle, &FormsetGuid, FormId, Label, AddData, UefiHiiUpdateData);\r
+      ASSERT_EFI_ERROR (Status);\r
+      \r
     } else {\r
-      UefiHiiHandle = HandleMapEntry->UefiHiiHandle;\r
+      ASSERT (FALSE);\r
+      return EFI_INVALID_PARAMETER;\r
     }\r
-\r
-    UefiHiiUpdateData = NULL;\r
     \r
-    Status = ThunkFrameworkUpdateDataToUefiUpdateData (Data, AddData, &UefiHiiUpdateData);\r
-    ASSERT_EFI_ERROR (Status);\r
-\r
+  } else {\r
     Status = ThunkLocateFormId (UefiHiiHandle, Label, &FormsetGuid, &FormId);\r
     ASSERT_EFI_ERROR (Status);\r
 \r
-    Status = IfrLibUpdateForm (UefiHiiHandle, &FormsetGuid, FormId, Label, AddData, UefiHiiUpdateData);\r
-    ASSERT_EFI_ERROR (Status);\r
+    //\r
+    // Delete Opcode starting from Labe in FormId found\r
+    //\r
     \r
-    if (UefiHiiUpdateData != NULL) {\r
-      SafeFreePool (UefiHiiUpdateData->Data);\r
-      SafeFreePool (UefiHiiUpdateData);\r
-    }\r
+    Status = IfrLibUpdateForm (UefiHiiHandle, &FormsetGuid, FormId, Label, FALSE, NULL);\r
+    ASSERT_EFI_ERROR (Status);\r
+  }\r
+\r
+  if (UefiHiiUpdateData != NULL) {\r
+    SafeFreePool (UefiHiiUpdateData->Data);\r
+    SafeFreePool (UefiHiiUpdateData);\r
   }\r
 \r
   return Status;\r
index fb6169b29c13351ec27d5510ce75732370fe2a58..391e698d1e8c6de2c55696a996bfec34802278fb 100644 (file)
@@ -595,7 +595,7 @@ F2UCreateNumericOpCode (
   }\r
 \r
   //\r
-  // We need to create a default \r
+  // We need to create a default value.\r
   //\r
   if (FwOpcode->Default != 0) {\r
     ZeroMem (&UOpcodeDefault, sizeof (UOpcodeDefault));\r