From 9f36d397f0e5232efa2a400345f8718f5c1a487a Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Sun, 3 Dec 2023 23:42:59 +0100 Subject: [PATCH] Do not overwrite some options for easy debugging and testing new themes --- xtldr2/config.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/xtldr2/config.c b/xtldr2/config.c index beb72cc..c0b5b13 100644 --- a/xtldr2/config.c +++ b/xtldr2/config.c @@ -78,10 +78,14 @@ BlpConfigUpdateGlobalConfiguration(IN PWCHAR Options) Argument += 6; Length = RtlWideStringLength(Argument, 0); - /* Save debug port in global configuration */ - BlMemoryAllocatePool(Length, (PVOID *)&BlpConfiguration.Debug); - RtlCopyMemory(BlpConfiguration.Debug, Argument, (Length * sizeof(WCHAR)) - 1); - BlpConfiguration.Debug[Length] = '\0'; + /* Store debug port configuration if not set already */ + if(BlpConfiguration.Debug == NULL) + { + /* Save debug port in global configuration */ + BlMemoryAllocatePool(Length, (PVOID *)&BlpConfiguration.Debug); + RtlCopyMemory(BlpConfiguration.Debug, Argument, (Length * sizeof(WCHAR)) - 1); + BlpConfiguration.Debug[Length] = '\0'; + } } else if(RtlWideStringCompare(Argument, L"SHELL", 5) == 0) { @@ -94,10 +98,14 @@ BlpConfigUpdateGlobalConfiguration(IN PWCHAR Options) Argument += 6; Length = RtlWideStringLength(Argument, 0); - /* Save theme in global configuration */ - BlMemoryAllocatePool(Length, (PVOID *)&BlpConfiguration.Theme); - RtlCopyMemory(BlpConfiguration.Theme, Argument, (Length * sizeof(WCHAR)) - 1); - BlpConfiguration.Theme[Length] = '\0'; + /* Store theme configuration if not set already */ + if(BlpConfiguration.Theme == NULL) + { + /* Save theme in global configuration */ + BlMemoryAllocatePool(Length, (PVOID *)&BlpConfiguration.Theme); + RtlCopyMemory(BlpConfiguration.Theme, Argument, (Length * sizeof(WCHAR)) - 1); + BlpConfiguration.Theme[Length] = '\0'; + } } else if(RtlWideStringCompare(Argument, L"TIMEOUT=", 8) == 0) {