mirror of
https://github.com/reactos/reactos.git
synced 2025-06-27 00:29:44 +00:00
[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:
parent
528e6339c2
commit
0f8e720711
3 changed files with 20 additions and 9 deletions
|
@ -49,6 +49,7 @@ list(APPEND SOURCE
|
||||||
RtlMemoryStream.c
|
RtlMemoryStream.c
|
||||||
RtlNtPathNameToDosPathName.c
|
RtlNtPathNameToDosPathName.c
|
||||||
RtlpEnsureBufferSize.c
|
RtlpEnsureBufferSize.c
|
||||||
|
RtlQueryTimeZoneInfo.c
|
||||||
RtlReAllocateHeap.c
|
RtlReAllocateHeap.c
|
||||||
RtlUnicodeStringToAnsiString.c
|
RtlUnicodeStringToAnsiString.c
|
||||||
RtlUpcaseUnicodeStringToCountedOemString.c
|
RtlUpcaseUnicodeStringToCountedOemString.c
|
||||||
|
|
|
@ -53,6 +53,7 @@ extern void func_RtlIsNameLegalDOS8Dot3(void);
|
||||||
extern void func_RtlMemoryStream(void);
|
extern void func_RtlMemoryStream(void);
|
||||||
extern void func_RtlNtPathNameToDosPathName(void);
|
extern void func_RtlNtPathNameToDosPathName(void);
|
||||||
extern void func_RtlpEnsureBufferSize(void);
|
extern void func_RtlpEnsureBufferSize(void);
|
||||||
|
extern void func_RtlQueryTimeZoneInformation(void);
|
||||||
extern void func_RtlReAllocateHeap(void);
|
extern void func_RtlReAllocateHeap(void);
|
||||||
extern void func_RtlUnicodeStringToAnsiString(void);
|
extern void func_RtlUnicodeStringToAnsiString(void);
|
||||||
extern void func_RtlUpcaseUnicodeStringToCountedOemString(void);
|
extern void func_RtlUpcaseUnicodeStringToCountedOemString(void);
|
||||||
|
@ -111,6 +112,7 @@ const struct test winetest_testlist[] =
|
||||||
{ "RtlMemoryStream", func_RtlMemoryStream },
|
{ "RtlMemoryStream", func_RtlMemoryStream },
|
||||||
{ "RtlNtPathNameToDosPathName", func_RtlNtPathNameToDosPathName },
|
{ "RtlNtPathNameToDosPathName", func_RtlNtPathNameToDosPathName },
|
||||||
{ "RtlpEnsureBufferSize", func_RtlpEnsureBufferSize },
|
{ "RtlpEnsureBufferSize", func_RtlpEnsureBufferSize },
|
||||||
|
{ "RtlQueryTimeZoneInformation", func_RtlQueryTimeZoneInformation },
|
||||||
{ "RtlReAllocateHeap", func_RtlReAllocateHeap },
|
{ "RtlReAllocateHeap", func_RtlReAllocateHeap },
|
||||||
{ "RtlUnicodeStringToAnsiString", func_RtlUnicodeStringToAnsiString },
|
{ "RtlUnicodeStringToAnsiString", func_RtlUnicodeStringToAnsiString },
|
||||||
{ "RtlUpcaseUnicodeStringToCountedOemString", func_RtlUpcaseUnicodeStringToCountedOemString },
|
{ "RtlUpcaseUnicodeStringToCountedOemString", func_RtlUpcaseUnicodeStringToCountedOemString },
|
||||||
|
|
|
@ -96,17 +96,25 @@ RtlpQueryRegistryDirect(IN ULONG ValueType,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Check if there's space for the length and type, plus data */
|
if (ValueType != REG_BINARY)
|
||||||
if (*Length < (2 * sizeof(ULONG) + ValueLength))
|
|
||||||
{
|
{
|
||||||
/* Nope, fail */
|
/* Check if there's space for the length and type, plus data */
|
||||||
return STATUS_BUFFER_TOO_SMALL;
|
if (*Length < (2 * sizeof(ULONG) + ValueLength))
|
||||||
}
|
{
|
||||||
|
/* Nope, fail */
|
||||||
|
return STATUS_BUFFER_TOO_SMALL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Return the data */
|
/* Return the data */
|
||||||
*Length++ = ValueLength;
|
*Length++ = ValueLength;
|
||||||
*Length++ = ValueType;
|
*Length++ = ValueType;
|
||||||
RtlCopyMemory(Length, ValueData, ValueLength);
|
RtlCopyMemory(Length, ValueData, ValueLength);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Return the REG_BINARY data */
|
||||||
|
RtlCopyMemory(Length, ValueData, ValueLength);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue