summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-21 05:05:59 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-05-21 05:05:59 +0000
commitde482998ed157445fa9d812544b73c3bae702881 (patch)
tree658bf3e312d7e781d76260bbab1760475f0145b8 /MdeModulePkg
parent14073b3f8c5c3438539015048ab2a45f342c27e7 (diff)
downloadedk2-platforms-de482998ed157445fa9d812544b73c3bae702881.tar.xz
Update DriverSample and PlatDriOverrideDxe driver to correct the return value for ConfigAccess ExtractConfig interface.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8365 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c37
-rw-r--r--MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c9
2 files changed, 20 insertions, 26 deletions
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
index f856083de4..74866be7a9 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
+++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
@@ -22,6 +22,10 @@ EFI_GUID mFormSetGuid = FORMSET_GUID;
EFI_GUID mInventoryGuid = INVENTORY_GUID;
CHAR16 VariableName[] = L"MyIfrNVData";
+//
+// <ConfigHdr> Template
+//
+CONST CHAR16 mDriverSampleConfigHdr[] = L"GUID=00000000000000000000000000000000&NAME=0000&PATH=00";
EFI_HANDLE DriverHandle[2] = {NULL, NULL};
DRIVER_SAMPLE_PRIVATE_DATA *PrivateData = NULL;
@@ -342,7 +346,6 @@ ExtractConfig (
UINTN BufferSize;
DRIVER_SAMPLE_PRIVATE_DATA *PrivateData;
EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting;
- EFI_STRING ConfigRequestHdr;
EFI_STRING ConfigRequest;
UINTN Size;
@@ -352,7 +355,6 @@ ExtractConfig (
//
// Initialize the local variables.
//
- ConfigRequestHdr = NULL;
ConfigRequest = NULL;
Size = 0;
*Progress = Request;
@@ -373,7 +375,7 @@ ExtractConfig (
&PrivateData->Configuration
);
if (EFI_ERROR (Status)) {
- return Status;
+ return EFI_NOT_FOUND;
}
if (Request == NULL) {
@@ -382,32 +384,21 @@ ExtractConfig (
//
//
- // First Set ConfigRequestHdr string.
- //
- ConfigRequestHdr = HiiConstructConfigHdr (&mFormSetGuid, VariableName, PrivateData->DriverHandle[0]);
- ASSERT (ConfigRequestHdr != NULL);
-
- //
// Allocate and fill a buffer large enough to hold the <ConfigHdr> template
// followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator
//
- Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);
+ Size = (StrLen (mDriverSampleConfigHdr) + 32 + 1) * sizeof (CHAR16);
ConfigRequest = AllocateZeroPool (Size);
- UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize);
- FreePool (ConfigRequestHdr);
+ UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", mDriverSampleConfigHdr, (UINT64)BufferSize);
} else {
- ConfigRequest = Request;
- }
-
- //
- // Check routing data in <ConfigHdr>.
- // Note: if only one Storage is used, then this checking could be skipped.
- //
- if (!HiiIsConfigHdrMatch (ConfigRequest, &mFormSetGuid, VariableName)) {
- if (Request == NULL) {
- FreePool (ConfigRequest);
+ //
+ // Check routing data in <ConfigHdr>.
+ // Note: if only one Storage is used, then this checking could be skipped.
+ //
+ if (!HiiIsConfigHdrMatch (Request, &mFormSetGuid, VariableName)) {
+ return EFI_NOT_FOUND;
}
- return EFI_NOT_FOUND;
+ ConfigRequest = Request;
}
//
diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c
index fa7ca9094c..241918691e 100644
--- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c
+++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c
@@ -1218,11 +1218,15 @@ PlatOverMngrRouteConfig (
if (!HiiIsConfigHdrMatch (Configuration, &mPlatformOverridesManagerGuid, mVariableName)) {
return EFI_NOT_FOUND;
}
-
+
+ *Progress = Configuration + StrLen (Configuration);
Private = EFI_CALLBACK_INFO_FROM_THIS (This);
FakeNvData = &Private->FakeNvData;
if (!HiiGetBrowserData (&mPlatformOverridesManagerGuid, mVariableName, sizeof (PLAT_OVER_MNGR_DATA), (UINT8 *) FakeNvData)) {
- return EFI_NOT_FOUND;
+ //
+ // FakeNvData can't be got from SetupBrowser, which doesn't need to be set.
+ //
+ return EFI_SUCCESS;
}
if (mCurrentPage == FORM_ID_DRIVER) {
@@ -1242,7 +1246,6 @@ PlatOverMngrRouteConfig (
CommintChanges (Private, KeyValue, FakeNvData);
}
- *Progress = Configuration + StrLen (Configuration);
return EFI_SUCCESS;
}