mirror of
https://github.com/reactos/reactos.git
synced 2025-05-31 23:18:39 +00:00
[RTL]
- Fall back to the default user key if RtlFormatCurrentUserKeyPath fails (perhaps we are in a system process) svn path=/trunk/; revision=46578
This commit is contained in:
parent
98782624bf
commit
c0add4aee8
1 changed files with 15 additions and 5 deletions
|
@ -474,15 +474,25 @@ RtlpGetRegistryHandle(IN ULONG RelativeTo,
|
||||||
/* Check if we need the current user key */
|
/* Check if we need the current user key */
|
||||||
if (RelativeTo == RTL_REGISTRY_USER)
|
if (RelativeTo == RTL_REGISTRY_USER)
|
||||||
{
|
{
|
||||||
/* Get the path */
|
/* Get the user key path */
|
||||||
Status = RtlFormatCurrentUserKeyPath(&KeyPath);
|
Status = RtlFormatCurrentUserKeyPath(&KeyPath);
|
||||||
if (!NT_SUCCESS(Status)) return(Status);
|
|
||||||
|
|
||||||
/* Append it */
|
/* Check if it worked */
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
/* Append the user key path */
|
||||||
Status = RtlAppendUnicodeStringToString(&KeyName, &KeyPath);
|
Status = RtlAppendUnicodeStringToString(&KeyName, &KeyPath);
|
||||||
|
|
||||||
|
/* Free the user key path */
|
||||||
RtlFreeUnicodeString (&KeyPath);
|
RtlFreeUnicodeString (&KeyPath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
/* It didn't work so fall back to the default user key */
|
||||||
|
Status = RtlAppendUnicodeToString(&KeyName, RtlpRegPaths[RTL_REGISTRY_USER]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
/* Get one of the prefixes */
|
/* Get one of the prefixes */
|
||||||
Status = RtlAppendUnicodeToString(&KeyName,
|
Status = RtlAppendUnicodeToString(&KeyName,
|
||||||
|
|
Loading…
Reference in a new issue