summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
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/DriverSample.c
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/DriverSample.c')
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c12
1 files changed, 9 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.