From 6acb13c903558057004aee631c2a3b3b0cf175f6 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 30 Jul 2025 16:56:00 +0300 Subject: [PATCH] [RTL] Fix RtlpGetRegistryHandle --- sdk/lib/rtl/registry.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sdk/lib/rtl/registry.c b/sdk/lib/rtl/registry.c index 8beeb388ab8..5f9f455fc6b 100644 --- a/sdk/lib/rtl/registry.c +++ b/sdk/lib/rtl/registry.c @@ -523,10 +523,13 @@ RtlpGetRegistryHandle(IN ULONG RelativeTo, if (!NT_SUCCESS(Status)) return Status; } - /* And now append the path */ - if (Path[0] == L'\\' && RelativeTo != RTL_REGISTRY_ABSOLUTE) Path++; // HACK! - Status = RtlAppendUnicodeToString(&KeyName, Path); - if (!NT_SUCCESS(Status)) return Status; + if (Path != NULL) + { + /* And now append the path */ + if (Path[0] == L'\\' && RelativeTo != RTL_REGISTRY_ABSOLUTE) Path++; // HACK! + Status = RtlAppendUnicodeToString(&KeyName, Path); + if (!NT_SUCCESS(Status)) return Status; + } /* Initialize the object attributes */ InitializeObjectAttributes(&ObjectAttributes,