]> code.delx.au - refind/blobdiff - filesystems/scandisk.c
Sort Fedora's rescue kernel (vmlinuz-0-rescue*) to the end of the list
[refind] / filesystems / scandisk.c
index b175c9ef3939cafc0fcf7194b94c743ca6540c65..d8b862a895040d506063624483da4b4cd6f0abe9 100644 (file)
@@ -5,10 +5,27 @@
  *
  * Copyright (c) 2013 Tencent, Inc.
  */
+/*
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
 #include "fsw_efi.h"
 #ifdef __MAKEWITH_GNUEFI
 #include "edk2/DriverBinding.h"
 #include "edk2/ComponentName.h"
+extern EFI_GUID gEfiDiskIoProtocolGuid;
+extern EFI_GUID gEfiBlockIoProtocolGuid;
 #endif
 #include "../include/refit_call_wrapper.h"
 
@@ -82,16 +99,16 @@ static int scan_disks(int (*hook)(struct fsw_volume *, struct fsw_volume *), str
     Print(L" ");
 #endif
     DPRINT(L"Scanning disks\n");
-    Status = refit_call5_wrapper(BS->LocateHandleBuffer, ByProtocol, &PROTO_NAME(DiskIoProtocol), NULL, &HandleCount, &Handles);
+    Status = refit_call5_wrapper(BS->LocateHandleBuffer, ByProtocol, &gEfiDiskIoProtocolGuid, NULL, &HandleCount, &Handles);
     if (Status == EFI_NOT_FOUND)
         return -1;  // no filesystems. strange, but true...
     for (i = 0; i < HandleCount; i++) {
         EFI_DISK_IO *diskio;
         EFI_BLOCK_IO *blockio;
-        Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &PROTO_NAME(DiskIoProtocol), (VOID **) &diskio);
+        Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &gEfiDiskIoProtocolGuid, (VOID **) &diskio);
         if (Status != 0)
             continue;
-        Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &PROTO_NAME(BlockIoProtocol), (VOID **) &blockio);
+        Status = refit_call3_wrapper(BS->HandleProtocol, Handles[i], &gEfiBlockIoProtocolGuid, (VOID **) &blockio);
         if (Status != 0)
             continue;
         struct fsw_volume *vol = create_dummy_volume(diskio, blockio->Media->MediaId);