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

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