Author: cgutman Date: Tue Mar 30 05:26:35 2010 New Revision: 46578
URL: http://svn.reactos.org/svn/reactos?rev=46578&view=rev Log: [RTL] - Fall back to the default user key if RtlFormatCurrentUserKeyPath fails (perhaps we are in a system process)
Modified: trunk/reactos/lib/rtl/registry.c
Modified: trunk/reactos/lib/rtl/registry.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/registry.c?rev=4657... ============================================================================== --- trunk/reactos/lib/rtl/registry.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/registry.c [iso-8859-1] Tue Mar 30 05:26:35 2010 @@ -474,13 +474,23 @@ /* Check if we need the current user key */ if (RelativeTo == RTL_REGISTRY_USER) { - /* Get the path */ + /* Get the user key path */ Status = RtlFormatCurrentUserKeyPath(&KeyPath); - if (!NT_SUCCESS(Status)) return(Status); - - /* Append it */ - Status = RtlAppendUnicodeStringToString(&KeyName, &KeyPath); - RtlFreeUnicodeString (&KeyPath); + + /* Check if it worked */ + if (NT_SUCCESS(Status)) + { + /* Append the user key path */ + Status = RtlAppendUnicodeStringToString(&KeyName, &KeyPath); + + /* Free the user key path */ + RtlFreeUnicodeString (&KeyPath); + } + else + { + /* It didn't work so fall back to the default user key */ + Status = RtlAppendUnicodeToString(&KeyName, RtlpRegPaths[RTL_REGISTRY_USER]); + } } else {