From: Andrey Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: [PATCH] fix EFI detection on Windows
Date: Wed, 25 Dec 2013 22:26:35 +0400 [thread overview]
Message-ID: <1387995995-3948-1-git-send-email-arvidjaar@gmail.com> (raw)
We are on legacy BIOS if GetFirmwareEnvironmentVariable fails (returns
zero) *and* extended error information is ERROR_INVALID_FUNCTION.
Cf. http://msdn.microsoft.com/en-us/library/windows/desktop/ms724325%28v=vs.85%29.aspx
---
grub-core/osdep/windows/platform.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/osdep/windows/platform.c b/grub-core/osdep/windows/platform.c
index f2b9d71..d217efe 100644
--- a/grub-core/osdep/windows/platform.c
+++ b/grub-core/osdep/windows/platform.c
@@ -100,7 +100,7 @@ get_platform (void)
if (!func_GetFirmwareEnvironmentVariableW (L"BootOrder", GRUB_EFI_GLOBAL_VARIABLE_GUID_WINDOWS_STR,
buffer, sizeof (buffer))
- && GetLastError () != ERROR_INVALID_FUNCTION)
+ && GetLastError () == ERROR_INVALID_FUNCTION)
{
platform = PLAT_BIOS;
return;
--
tg: (e8f0782..) u/windows-efi-detection (depends on: master)
next reply other threads:[~2013-12-25 18:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-25 18:26 Andrey Borzenkov [this message]
2013-12-25 18:29 ` [PATCH] fix EFI detection on Windows Vladimir 'phcoder' Serbinenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1387995995-3948-1-git-send-email-arvidjaar@gmail.com \
--to=arvidjaar@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).