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) {