[ros-diffs] [cgutman] 46578: [RTL] - Fall back to the default user key if RtlFormatCurrentUserKeyPath fails (perhaps we are in a system process)
cgutman at svn.reactos.org
cgutman at svn.reactos.org
Tue Mar 30 05:26:36 CEST 2010
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=46578&r1=46577&r2=46578&view=diff
==============================================================================
--- 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
{
More information about the Ros-diffs
mailing list