From 953de7fb5f6b19efe225f1e102b89b7403e4cbdb Mon Sep 17 00:00:00 2001 From: Aiken Harris Date: Mon, 28 Jul 2025 21:39:07 +0200 Subject: [PATCH] Correct default OS selection in boot menu --- xtldr/xtldr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xtldr/xtldr.c b/xtldr/xtldr.c index b8e517c..2e6511a 100644 --- a/xtldr/xtldr.c +++ b/xtldr/xtldr.c @@ -151,7 +151,8 @@ BlInitializeBootMenuList(OUT PXTBL_BOOTMENU_ITEM *MenuEntries, MenuEntrySection = CONTAIN_RECORD(MenuEntrySectionList, XTBL_CONFIG_SECTION, Flink); /* Check if this is the default menu entry */ - if(RtlCompareWideStringInsensitive(MenuEntrySection->SectionName, DefaultMenuEntry, 0) == 0) + if((RtlWideStringLength(MenuEntrySection->SectionName, 0) == RtlWideStringLength(DefaultMenuEntry, 0)) && + (RtlCompareWideStringInsensitive(MenuEntrySection->SectionName, DefaultMenuEntry, 0) == 0)) { /* Set default OS ID */ DefaultOS = NumberOfEntries;