+// Returns TRUE if a file with the same name as the original but with
+// ".efi.signed" is also present in the same directory. Ubuntu is using
+// this filename as a signed version of the original unsigned kernel, and
+// there's no point in cluttering the display with two kernels that will
+// behave identically on non-SB systems, or when one will fail when SB
+// is active.
+static BOOLEAN HasSignedCounterpart(IN REFIT_VOLUME *Volume, IN CHAR16 *Path, IN CHAR16 *Filename) {
+ CHAR16 *NewFile = NULL;
+ BOOLEAN retval = FALSE;
+
+ MergeStrings(&NewFile, Path, 0);
+ MergeStrings(&NewFile, Filename, L'\\');
+ MergeStrings(&NewFile, L".efi.signed", 0);
+ if (FileExists(Volume->RootDir, NewFile))
+ retval = TRUE;
+ MyFreePool(NewFile);
+
+ return retval;
+} // BOOLEAN HasSignedCounterpart()
+