Enhance HiiGetBrowserData API to support the case that storage element is 0.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8135 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -273,7 +273,7 @@ BootMaintCallback (
|
|||||||
//
|
//
|
||||||
CurrentFakeNVMap = (BMM_FAKE_NV_DATA *) HiiGetBrowserData (&mBootMaintGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA));
|
CurrentFakeNVMap = (BMM_FAKE_NV_DATA *) HiiGetBrowserData (&mBootMaintGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA));
|
||||||
if (CurrentFakeNVMap == NULL) {
|
if (CurrentFakeNVMap == NULL) {
|
||||||
CurrentFakeNVMap = &Private->BmmFakeNvData;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -590,7 +590,7 @@ BootMaintCallback (
|
|||||||
//
|
//
|
||||||
// Update local settting.
|
// Update local settting.
|
||||||
//
|
//
|
||||||
if ((UINTN) CurrentFakeNVMap != (UINTN) &Private->BmmFakeNvData) {
|
if (CurrentFakeNVMap != NULL) {
|
||||||
CopyMem (&Private->BmmFakeNvData, CurrentFakeNVMap, sizeof (BMM_FAKE_NV_DATA));
|
CopyMem (&Private->BmmFakeNvData, CurrentFakeNVMap, sizeof (BMM_FAKE_NV_DATA));
|
||||||
FreePool (CurrentFakeNVMap);
|
FreePool (CurrentFakeNVMap);
|
||||||
}
|
}
|
||||||
|
@@ -564,6 +564,15 @@ InternalHiiBrowserCallback (
|
|||||||
VariableGuid,
|
VariableGuid,
|
||||||
VariableName
|
VariableName
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
//
|
||||||
|
// No Resluts Data, only allocate one char for '\0'
|
||||||
|
//
|
||||||
|
ResultsData = AllocateZeroPool (sizeof (CHAR16));
|
||||||
|
return ResultsData;
|
||||||
|
}
|
||||||
|
|
||||||
if (Status != EFI_BUFFER_TOO_SMALL) {
|
if (Status != EFI_BUFFER_TOO_SMALL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user