From 0f2d32f01145f82fa83806e08ddde6cdce8a496d Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 28 Apr 2015 23:47:59 +0200 Subject: Windows: enable showing/hiding password for system encryption in Windows UI and in the bootloader (F5 key). This will be helpful to diagnose issues with non-US versions of Windows. --- src/Boot/Windows/BootMain.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Boot/Windows') diff --git a/src/Boot/Windows/BootMain.cpp b/src/Boot/Windows/BootMain.cpp index b29d3ff8..334762ea 100644 --- a/src/Boot/Windows/BootMain.cpp +++ b/src/Boot/Windows/BootMain.cpp @@ -60,6 +60,7 @@ static void PrintMainMenu () return; Print (" Keyboard Controls:\r\n"); + Print (" [F5] Hide/Show Password\r\n"); Print (" [Esc] "); #ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE @@ -149,6 +150,7 @@ static byte AskPassword (Password &password) size_t pos = 0; byte scanCode; byte asciiCode; + byte hidePassword = 1; Print ("Enter password"); Print (PreventNormalSystemBoot ? " for hidden system:\r\n" : ": "); @@ -178,6 +180,10 @@ static byte AskPassword (Password &password) } continue; + case TC_BIOS_KEY_F5: + hidePassword ^= 0x01; + continue; + default: if (scanCode == TC_BIOS_KEY_ESC || IsMenuKey (scanCode)) { @@ -196,10 +202,11 @@ static byte AskPassword (Password &password) } password.Text[pos++] = asciiCode; + if (hidePassword) asciiCode = '*'; if (pos < MAX_PASSWORD) - PrintChar ('*'); + PrintChar (asciiCode); else - PrintCharAtCursor ('*'); + PrintCharAtCursor (asciiCode); } } -- cgit v1.2.3