- Rewrite SystemTimeOfDay QuerySystemInformation case. ReqSize is the amount of data copied to the user so use it accordingly. Also, fill up the buffer as much as the caller requested. Fixes 1 "ntdll_winetest.exe info".

- Use a newer (5.0 and higher) version of SYSTEM_TIMEOFDAY_INFORMATION structure (consisting of two additional 64 bits fields: boot time bias and sleep time bias).

svn path=/trunk/; revision=38565
This commit is contained in:
Aleksey Bragin 2009-01-04 15:11:47 +00:00
parent 24dceb4922
commit 2494ca79f9
2 changed files with 27 additions and 12 deletions

View file

@ -817,6 +817,10 @@ typedef struct _SYSTEM_TIMEOFDAY_INFORMATION
LARGE_INTEGER TimeZoneBias;
ULONG TimeZoneId;
ULONG Reserved;
#if (NTDDI_VERSION >= NTDDI_WIN2K)
ULONGLONG BootTimeBias;
ULONGLONG SleepTimeBias;
#endif
} SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION;
// Class 4

View file

@ -663,25 +663,36 @@ QSI_DEF(SystemPerformanceInformation)
/* Class 3 - Time Of Day Information */
QSI_DEF(SystemTimeOfDayInformation)
{
PSYSTEM_TIMEOFDAY_INFORMATION Sti;
SYSTEM_TIMEOFDAY_INFORMATION Sti;
LARGE_INTEGER CurrentTime;
Sti = (PSYSTEM_TIMEOFDAY_INFORMATION)Buffer;
*ReqSize = sizeof (SYSTEM_TIMEOFDAY_INFORMATION);
/* Set amount of written information to 0 */
*ReqSize = 0;
/* Check user buffer's size */
if (Size != sizeof (SYSTEM_TIMEOFDAY_INFORMATION))
{
return STATUS_INFO_LENGTH_MISMATCH;
}
if (Size > sizeof(SYSTEM_TIMEOFDAY_INFORMATION))
{
return STATUS_INFO_LENGTH_MISMATCH;
}
/* Get current time */
KeQuerySystemTime(&CurrentTime);
Sti->BootTime= KeBootTime;
Sti->CurrentTime = CurrentTime;
Sti->TimeZoneBias.QuadPart = ExpTimeZoneBias.QuadPart;
Sti->TimeZoneId = ExpTimeZoneId;
Sti->Reserved = 0;
/* Zero local buffer */
RtlZeroMemory(&Sti, sizeof(SYSTEM_TIMEOFDAY_INFORMATION));
/* Fill local time structure */
Sti.BootTime= KeBootTime;
Sti.CurrentTime = CurrentTime;
Sti.TimeZoneBias.QuadPart = ExpTimeZoneBias.QuadPart;
Sti.TimeZoneId = ExpTimeZoneId;
Sti.Reserved = 0;
/* Copy as much as requested by caller */
RtlCopyMemory(Buffer, &Sti, Size);
/* Set amount of information we copied */
*ReqSize = Size;
return STATUS_SUCCESS;
}