mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[0.4.11][SDK:RTL] RtlpCallQueryRegistryRoutine(): Correctly set SpareData and SpareLength (#5466)
ports back:
0.4.15-dev-6640-g 02883d1c16
SpareData and SpareLength need to be calculated correctly, as they are used
later in that function as well.
This allows to not overwrite Source UString when writing to Destination UString.
Fixes the problem described in the following JIRA issue, where services could
not start in 2nd-stage-bootcd-setup when installing ReactOS in a very-long-named directory.
CORE-18988
This commit is contained in:
parent
553b905ab4
commit
5a5afdcc2d
1 changed files with 28 additions and 28 deletions
|
@ -195,9 +195,6 @@ RtlpCallQueryRegistryRoutine(IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
/* Check if this isn't a direct return */
|
|
||||||
if (!(QueryTable->Flags & RTL_QUERY_REGISTRY_DIRECT))
|
|
||||||
{
|
{
|
||||||
/* Check if we have length */
|
/* Check if we have length */
|
||||||
if (KeyValueInfo->DataLength)
|
if (KeyValueInfo->DataLength)
|
||||||
|
@ -226,6 +223,9 @@ RtlpCallQueryRegistryRoutine(IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||||
return STATUS_BUFFER_TOO_SMALL;
|
return STATUS_BUFFER_TOO_SMALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if this isn't a direct return */
|
||||||
|
if (!(QueryTable->Flags & RTL_QUERY_REGISTRY_DIRECT))
|
||||||
|
{
|
||||||
/* Copy the data and null-terminate it */
|
/* Copy the data and null-terminate it */
|
||||||
Name = (PWCHAR)SpareData;
|
Name = (PWCHAR)SpareData;
|
||||||
RtlCopyMemory(Name, KeyValueInfo->Name, KeyValueInfo->NameLength);
|
RtlCopyMemory(Name, KeyValueInfo->Name, KeyValueInfo->NameLength);
|
||||||
|
@ -330,7 +330,7 @@ RtlpCallQueryRegistryRoutine(IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||||
RtlInitEmptyUnicodeString(&Source, Data, (USHORT)Length);
|
RtlInitEmptyUnicodeString(&Source, Data, (USHORT)Length);
|
||||||
Source.Length = Source.MaximumLength - sizeof(UNICODE_NULL);
|
Source.Length = Source.MaximumLength - sizeof(UNICODE_NULL);
|
||||||
|
|
||||||
/* Setup the desination string */
|
/* Setup the destination string */
|
||||||
RtlInitEmptyUnicodeString(&Destination, (PWCHAR)SpareData, 0);
|
RtlInitEmptyUnicodeString(&Destination, (PWCHAR)SpareData, 0);
|
||||||
|
|
||||||
/* Check if we're out of space */
|
/* Check if we're out of space */
|
||||||
|
|
Loading…
Reference in a new issue