nalika / rpms / grub2

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