From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web08.4335.1639121798384919249 for ; Thu, 09 Dec 2021 23:36:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.com header.s=intel header.b=XhGnY8sL; spf=pass (domain: intel.com, ip: 192.55.52.120, 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=1639121798; x=1670657798; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=M9RfArktUq7pG7nABZhirOc9Iehsg5Hp3J4kKpuwyAk=; b=XhGnY8sLwLwgIhjvpG7nHpFls0+p7ujah51sXl58g4cV+hzRVXJCLuqm NHFMidufVMMsMCBasbvSTfZvJwJVaIN5dcZG3cADSviMxuD1P6PN2OrXi twjI6QSh5dRT+v3nuaFum1k27i01zw9+RiuRc/kaUjoA3YQG+mYAHhnav vE1nHVqkv5nLATSVcV3P6FkuYwUHxO0I4dkRqQv9jayXPM4ejr/POtzGl E6R/+NAYJNwGf+RRQWp+D8+orOzWcBCW3nYkCcFNW/GuIY1kkDN43s5GE J7zx5W1/gux5zhCqsVLuPzLkWbyC2BlrXuj4vJGj6xVBYiVU+lZ9Ukvi2 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10193"; a="237031538" X-IronPort-AV: E=Sophos;i="5.88,194,1635231600"; d="scan'208";a="237031538" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2021 23:36:37 -0800 X-IronPort-AV: E=Sophos;i="5.88,194,1635231600"; d="scan'208";a="463578512" Received: from bkex-mobl.gar.corp.intel.com ([10.215.244.78]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2021 23:36:35 -0800 From: bo-changx.ke@intel.com To: devel@edk2.groups.io Cc: Sai Chaganty , Liming Gao , Dandan Bi Subject: [PATCH] [PATCH v2][Edk2 Platform] UserAuthFeaturePkg: Add boot menu return status code to trigger function. Date: Fri, 10 Dec 2021 15:34:26 +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: Bo Chang Ke --- .../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