If ConfigResp is NULL, then ASSERT().\r
\r
@param[in] ConfigResp Pointer to a Null-terminated Unicode string.\r
+ @param[in] BufferSize Length in bytes of buffer to hold retrived data. \r
\r
@retval NULL The block could not be generated..\r
@retval Other Pointer to the allocated block.\r
UINT8 *\r
EFIAPI\r
InternalHiiConfigToBlock (\r
- IN CONST EFI_STRING ConfigResp\r
+ IN EFI_STRING ConfigResp,\r
+ IN UINTN BlockSize\r
)\r
{\r
EFI_STATUS Status;\r
- UINTN BlockSize;\r
- UINT8 TempBlock;\r
CHAR16 *Progress;\r
UINT8 *Block;\r
\r
ASSERT (ConfigResp != NULL);\r
\r
- //\r
- // Get the size of the buffer required for <ConfigResp> conversion\r
- //\r
- BlockSize = 0;\r
- Status = gHiiConfigRouting->ConfigToBlock (\r
- gHiiConfigRouting,\r
- ConfigResp,\r
- &TempBlock,\r
- &BlockSize,\r
- &Progress\r
- );\r
- if (Status != EFI_BUFFER_TOO_SMALL) {\r
- return NULL;\r
- }\r
-\r
//\r
// Allocate a buffer to hold the <ConfigResp> conversion\r
//\r
is an optional parameter that may be NULL.\r
@param[in] VariableGuid Pointer to an EFI_GUID structure. This is an optional \r
parameter that may be NULL.\r
+ @param[in] BufferSize Length in bytes of buffer to hold retrived data. \r
\r
@retval NULL The uncommitted data could not be retrieved.\r
@retval Other A pointer to a buffer containing the uncommitted data.\r
EFIAPI\r
HiiGetBrowserData (\r
IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
- IN CONST CHAR16 *VariableName OPTIONAL\r
+ IN CONST CHAR16 *VariableName, OPTIONAL\r
+ IN UINTN BlockSize\r
)\r
{\r
EFI_STRING ResultsData;\r
Size = (StrLen (mConfigHdrTemplate) + 1 + StrLen (ResultsData) + 1) * sizeof (CHAR16);\r
ConfigResp = AllocateZeroPool (Size);\r
UnicodeSPrint (ConfigResp, Size, L"%s&%s", mConfigHdrTemplate, ResultsData);\r
-\r
-\r
+ \r
+ //\r
+ // Free the allocated buffer\r
+ //\r
FreePool (ResultsData);\r
if (ConfigResp == NULL) {\r
return NULL;\r
//\r
// Convert <ConfigResp> to a buffer\r
//\r
- Block = InternalHiiConfigToBlock (ConfigResp);\r
+ Block = InternalHiiConfigToBlock (ConfigResp, BlockSize);\r
FreePool (ConfigResp);\r
\r
- //\r
- // Return converted buffer\r
- //\r
return Block;\r
}\r
\r
//\r
if ((UpdateIfrOpHdr->Length == IfrOpHdr->Length) && \\r
(CompareMem (IfrOpHdr, UpdateIfrOpHdr, UpdateIfrOpHdr->Length) == 0)) {\r
- //\r
- // Keep the End opcode flag\r
- //\r
- CopyMem (BufferPos, IfrOpHdr, IfrOpHdr->Length);\r
- BufferPos += IfrOpHdr->Length;\r
- UpdatePackageLength += IfrOpHdr->Length;\r
break;\r
}\r
//\r
AddOpCode = (EFI_IFR_OP_HEADER *) ((UINT8 *) (AddOpCode) + AddOpCode->Length);\r
AddSize += AddOpCode->Length; \r
}\r
+\r
+ if (OpCodeBufferEnd != NULL) {\r
+ //\r
+ // Add the end opcode\r
+ //\r
+ CopyMem (BufferPos, IfrOpHdr, IfrOpHdr->Length);\r
+ BufferPos += IfrOpHdr->Length;\r
+ UpdatePackageLength += IfrOpHdr->Length;\r
+ }\r
//\r
// Set update flag\r
//\r