From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web08.4739.1639125958125970774 for ; Fri, 10 Dec 2021 00:45:58 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.com header.s=intel header.b=RLPXPQEp; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: bo-changx.ke@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639125958; x=1670661958; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Wb+3uu8zR4sh+1vqQ6yQQTvI93cyGAeT4orUbwXas1Q=; b=RLPXPQEp3s0p+p6z4GjM1c7Ef8HNaup2QwVTxLqcSO6Vqy4w6xZ5LM0g DzgYKldGFpsWZxg4akcDxH+1QTzthiOrwsLrsxJrHv9tzmBXum/jRtO9N HQg7g3FtYgZbOInhfUZYuqq6g+ym+HSrHDYNV+dXehF7LkTkadF5yXBfC dctvFg8isRWbTr+ZPHHdXr63Fa2T5D6Txvk/LGFOCKEd4tnFk85sc+sCY /gCayLmSN13sJBdFsZgwGLgrpeEGNRjOudMd075k447fbAXbVuovE3pCA 3gGqbkZtI1Z936gI/WBdA987a1f46UiqjFybRi2QFjCiyCLaXLvMKLmEA w==; X-IronPort-AV: E=McAfee;i="6200,9189,10193"; a="238109682" X-IronPort-AV: E=Sophos;i="5.88,194,1635231600"; d="scan'208";a="238109682" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 00:45:54 -0800 X-IronPort-AV: E=Sophos;i="5.88,194,1635231600"; d="scan'208";a="680675416" Received: from bkex-mobl.gar.corp.intel.com ([10.215.244.78]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 00:45:51 -0800 From: "Bo Chang Ke" To: devel@edk2.groups.io Cc: Sai Chaganty , Liming Gao , Dandan Bi , Dong, Eric , Ke, Bo-ChangX Subject: [PATCH] [PATCH v2][Edk2 Platform] UserAuthFeaturePkg: Add boot menu return status code to trigger function. Date: Fri, 10 Dec 2021 16:45:04 +0800 Message-Id: X-Mailer: git-send-email 2.32.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3764 BIOS password is not required when overriding boot device via F7 hotkey. Add boot menu return status code in callback function for ReportStatusCode() notification. Signed-off-by: Bo Chang Ke Cc: Sai Chaganty Cc: Liming Gao Cc: Dandan Bi Cc: Dong, Eric Cc: Ke, Bo-ChangX --- .../UserAuthenticationDxe.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.c b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.c index bba2057a96..382d891711 100644 --- a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.c +++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.c @@ -13,6 +13,7 @@ EFI_EVENT mExitBootServicesEvent = NULL; EFI_RSC_HANDLER_PROTOCOL *mRscHandlerProtocol = NULL; USER_AUTHENTICATION_PRIVATE_DATA *mUserAuthenticationData = NULL; EFI_SMM_COMMUNICATION_PROTOCOL *mSmmCommunication = NULL; +BOOLEAN mHotKeyF7pressed = FALSE; EFI_GUID mUserAuthenticationVendorGuid = USER_AUTHENTICATION_FORMSET_GUID; HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath = { @@ -352,10 +353,19 @@ CheckForPassword ( IN EFI_STATUS_CODE_DATA *Data OPTIONAL ) { - BOOLEAN PasswordSet; + BOOLEAN PasswordSet; + EFI_INPUT_KEY Key; + EFI_STATUS Status = EFI_SUCCESS; + Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); + + if (Key.ScanCode == SCAN_F7 && IsPasswordInstalled()) { + mHotKeyF7pressed = TRUE; + } if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) && - (Value == (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_PC_USER_SETUP))) { + (((Value == (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT)) && mHotKeyF7pressed) || + (Value == (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_PC_USER_SETUP)))) { + mHotKeyF7pressed = FALSE; // // Check whether enter setup page. // -- 2.32.0.windows.1