X-Git-Url: https://code.delx.au/refind/blobdiff_plain/346735a39ca8b64c8278ba342a633b5acce0159b..508d89056f8675d0d664493fc82a574119e6f60a:/gptsync/os_efi.c diff --git a/gptsync/os_efi.c b/gptsync/os_efi.c index 9559014..e857f71 100644 --- a/gptsync/os_efi.c +++ b/gptsync/os_efi.c @@ -125,15 +125,13 @@ UINTN input_boolean(CHARN *prompt, BOOLEAN *bool_out) Print(prompt); - if (ReadAllKeyStrokes()) { // remove buffered key strokes - refit_call1_wrapper(BS->Stall, 500000); // 0.5 seconds delay - ReadAllKeyStrokes(); // empty the buffer again - } - - refit_call3_wrapper(BS->WaitForEvent, 1, &ST->ConIn->WaitForKey, &Index); - Status = refit_call2_wrapper(ST->ConIn->ReadKeyStroke, ST->ConIn, &Key); - if (EFI_ERROR(Status)) - return 1; + ReadAllKeyStrokes(); // Remove buffered key strokes + do { + refit_call3_wrapper(BS->WaitForEvent, 1, &ST->ConIn->WaitForKey, &Index); + Status = refit_call2_wrapper(ST->ConIn->ReadKeyStroke, ST->ConIn, &Key); + if (EFI_ERROR(Status) && Status != EFI_NOT_READY) + return 1; + } while (Status == EFI_NOT_READY); if (Key.UnicodeChar == 'y' || Key.UnicodeChar == 'Y') { Print(L"Yes\n"); @@ -191,7 +189,7 @@ static BOOLEAN VerifyGoOn(VOID) { BOOLEAN GoOn = TRUE; UINTN invalid; - if (MyStriCmp(L"Apple", ST->FirmwareVendor)) { + if (!MyStriCmp(L"Apple", ST->FirmwareVendor)) { Print(L"Your firmware is made by %s.\n", ST->FirmwareVendor); Print(L"Ordinarily, a hybrid MBR (which this program creates) should be used ONLY on\n"); Print(L"Apple Macs that dual-boot with Windows or some other BIOS-mode OS. Are you\n");