From 4922daee362adf600fd19f91aa11cc603d8d17e1 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Thu, 21 Mar 2019 20:57:16 +0100 Subject: Implement better timeout mechanism for password input. Implement new actions "shutdown" and "reboot". Set default timeout value to 3 minutes and default timeout action to "shutdown" --- Library/PasswordLib/ConsolePassword.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Library/PasswordLib') diff --git a/Library/PasswordLib/ConsolePassword.c b/Library/PasswordLib/ConsolePassword.c index 43e03e6..0b2d3c6 100644 --- a/Library/PasswordLib/ConsolePassword.c +++ b/Library/PasswordLib/ConsolePassword.c @@ -36,12 +36,12 @@ AskConsolePwdInt( UINTN EventIndex = 0; InputEvents[0] = gST->ConIn->WaitForKey; gBS->CreateEvent(EVT_TIMER, 0, (EFI_EVENT_NOTIFY)NULL, NULL, &InputEvents[1]); - gBS->SetTimer(InputEvents[1], TimerPeriodic, 10000000 * gPasswordTimeout); + gBS->SetTimer(InputEvents[1], TimerRelative, 10000000 * gPasswordTimeout); gBS->WaitForEvent(2, InputEvents, &EventIndex); - gPasswordTimeout = 0; + gBS->SetTimer(InputEvents[1], TimerCancel, 0); gBS->CloseEvent(InputEvents[1]); if (EventIndex == 1) { - *retCode = AskPwdRetCancel; + *retCode = AskPwdRetTimeout; return ; } } -- cgit v1.2.3