[NTDLL_APITEST][LIB_RTL] Add a test for RtlQueryTimeZoneInformation and fix the bug in RtlpQueryRegistryDirect

In working on some problems with Time Zone adjustments in  ReactOS I found that the RtlQueryTimeZoneInformation function is partially broken and wrote an apitest to capture the failures.

Patch by Doug Lyons.

CORE-14658
This commit is contained in:
Eric Kohl 2018-05-31 16:47:42 +02:00
parent 528e6339c2
commit 0f8e720711
3 changed files with 20 additions and 9 deletions

View file

@ -96,17 +96,25 @@ RtlpQueryRegistryDirect(IN ULONG ValueType,
}
else
{
/* Check if there's space for the length and type, plus data */
if (*Length < (2 * sizeof(ULONG) + ValueLength))
if (ValueType != REG_BINARY)
{
/* Nope, fail */
return STATUS_BUFFER_TOO_SMALL;
}
/* Check if there's space for the length and type, plus data */
if (*Length < (2 * sizeof(ULONG) + ValueLength))
{
/* Nope, fail */
return STATUS_BUFFER_TOO_SMALL;
}
/* Return the data */
*Length++ = ValueLength;
*Length++ = ValueType;
RtlCopyMemory(Length, ValueData, ValueLength);
/* Return the data */
*Length++ = ValueLength;
*Length++ = ValueType;
RtlCopyMemory(Length, ValueData, ValueLength);
}
else
{
/* Return the REG_BINARY data */
RtlCopyMemory(Length, ValueData, ValueLength);
}
}
}