summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/DriverSampleDxe
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2010-12-23 06:47:50 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2010-12-23 06:47:50 +0000
commite2100bfa651cd0d1295ef13451b9cf4adddb8bfa (patch)
treef66ecec3f0655199fb98e79780e376c82891d40a /MdeModulePkg/Universal/DriverSampleDxe
parent7b546f7480c39e72d230970cf114ab333c912eb7 (diff)
downloadedk2-platforms-e2100bfa651cd0d1295ef13451b9cf4adddb8bfa.tar.xz
1. Support inconsistent if opcode used in string/password opcode.
2. Add sample code of using inconsistent if opcode in string opcode. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11196 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/DriverSampleDxe')
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c12
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr3
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.unibin48460 -> 49092 bytes
3 files changed, 12 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
index efd260512a..9b664b4958 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
+++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
@@ -910,9 +910,6 @@ DriverCallback (
return EFI_INVALID_PARAMETER;
}
- if ((Type == EFI_IFR_TYPE_STRING) && (Value->string == 0)) {
- return EFI_INVALID_PARAMETER;
- }
Status = EFI_SUCCESS;
PrivateData = DRIVER_SAMPLE_PRIVATE_FROM_THIS (This);
@@ -1167,6 +1164,15 @@ DriverCallback (
case 0x2000:
//
+ // Only used to update the state.
+ //
+ if ((Type == EFI_IFR_TYPE_STRING) && (Value->string == 0) &&
+ (PrivateData->PasswordState == BROWSER_STATE_SET_PASSWORD)) {
+ PrivateData->PasswordState = BROWSER_STATE_VALIDATE_PASSWORD;
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
// When try to set a new password, user will be chanlleged with old password.
// The Callback is responsible for validating old password input by user,
// If Callback return EFI_SUCCESS, it indicates validation pass.
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
index e82cccc9db..00982700b7 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
+++ b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
@@ -285,6 +285,9 @@ formset
key = 0x1236,
minsize = 6,
maxsize = 40,
+ inconsistentif prompt = STRING_TOKEN(STR_STRING_CHECK_ERROR_POPUP),
+ pushthis != stringref(STRING_TOKEN(STR_STRING_CHECK))
+ endif
endstring;
//
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
index 4abcfa2cd7..5b65a1bc1b 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
+++ b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
Binary files differ