]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmulatorPkg/EmuGopDxe: Fix TxtInEx.SetState SCT conformance failure
authorRuiyu Ni <ruiyu.ni@intel.com>
Fri, 24 Aug 2018 03:22:05 +0000 (11:22 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Fri, 31 Aug 2018 02:40:07 +0000 (10:40 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1118

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Cc: Andrew Fish <afish@apple.com>
EmulatorPkg/EmuGopDxe/GopInput.c

index 1d40b1d7d682e308168b92481c1ef35c3a3529e5..97a5fbc1ad28a852a5250288f3693b9418d82d23 100644 (file)
@@ -1,6 +1,6 @@
 /*++ @file\r
 \r
 /*++ @file\r
 \r
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 Portions copyright (c) 2010 0 2011,Apple Inc. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 Portions copyright (c) 2010 0 2011,Apple Inc. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -442,11 +442,20 @@ EmuGopSimpleTextInExSetState (
   EFI_STATUS        Status;\r
   EFI_TPL           OldTpl;\r
 \r
   EFI_STATUS        Status;\r
   EFI_TPL           OldTpl;\r
 \r
+  if (KeyToggleState == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);\r
   if (Private->EmuGraphicsWindow == NULL) {\r
     return EFI_NOT_READY;\r
   }\r
 \r
   Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);\r
   if (Private->EmuGraphicsWindow == NULL) {\r
     return EFI_NOT_READY;\r
   }\r
 \r
+  if (((Private->KeyState.KeyToggleState & EFI_TOGGLE_STATE_VALID) != EFI_TOGGLE_STATE_VALID) ||\r
+      ((*KeyToggleState & EFI_TOGGLE_STATE_VALID) != EFI_TOGGLE_STATE_VALID)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   //\r
   // Enter critical section\r
   //\r
   //\r
   // Enter critical section\r
   //\r