Blame SOURCES/0001-fix-EFI-detection-on-Windows.patch

d41074
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a85e8e
From: Andrey Borzenkov <arvidjaar@gmail.com>
a85e8e
Date: Wed, 25 Dec 2013 22:36:28 +0400
d41074
Subject: [PATCH] fix EFI detection on Windows
a85e8e
a85e8e
We are on legacy BIOS if GetFirmwareEnvironmentVariable fails (returns
a85e8e
zero) *and* extended error information is ERROR_INVALID_FUNCTION.
a85e8e
a85e8e
Cf. http://msdn.microsoft.com/en-us/library/windows/desktop/ms724325%28v=vs.85%29.aspx
a85e8e
---
a85e8e
 grub-core/osdep/windows/platform.c | 2 +-
d41074
 ChangeLog                          | 5 +++++
a85e8e
 2 files changed, 6 insertions(+), 1 deletion(-)
a85e8e
a85e8e
diff --git a/grub-core/osdep/windows/platform.c b/grub-core/osdep/windows/platform.c
d41074
index f2b9d714329..d217efe1704 100644
a85e8e
--- a/grub-core/osdep/windows/platform.c
a85e8e
+++ b/grub-core/osdep/windows/platform.c
a85e8e
@@ -100,7 +100,7 @@ get_platform (void)
a85e8e
 
a85e8e
   if (!func_GetFirmwareEnvironmentVariableW (L"BootOrder", GRUB_EFI_GLOBAL_VARIABLE_GUID_WINDOWS_STR,
a85e8e
 					     buffer, sizeof (buffer))
a85e8e
-      && GetLastError () != ERROR_INVALID_FUNCTION)
a85e8e
+      && GetLastError () == ERROR_INVALID_FUNCTION)
a85e8e
     {
a85e8e
       platform = PLAT_BIOS;
a85e8e
       return;
d41074
diff --git a/ChangeLog b/ChangeLog
d41074
index 41bcebfb321..21ec1c77c57 100644
d41074
--- a/ChangeLog
d41074
+++ b/ChangeLog
d41074
@@ -1,3 +1,8 @@
d41074
+2013-12-25  Andrey Borzenkov <arvidjaar@gmail.com>
d41074
+
d41074
+	* grub-core/osdep/windows/platform.c (get_platform): Fix EFI
d41074
+	detection.
d41074
+
d41074
 2013-12-24  Vladimir Serbinenko  <phcoder@gmail.com>
d41074
 
d41074
 	* configure.ac: Set version to 2.02~beta2.