Hello!
I compiled the following using msvc:
----------8<--------------------------- #include <stdio.h> #include <windows.h>
typedef short CSHORT; typedef struct { CSHORT Year; CSHORT Month; CSHORT Day; CSHORT Hour; CSHORT Minute; CSHORT Second; CSHORT Milliseconds; CSHORT Weekday; } TIME_FIELDS, *PTIME_FIELDS;
typedef VOID (*RtlTimeToTimeFieldsT) (PLARGE_INTEGER Time, PTIME_FIELDS TimeFields);
int main() { LARGE_INTEGER RtlTime; TIME_FIELDS tf; HINSTANCE hLib; RtlTimeToTimeFieldsT RtlTimeToTimeFields;
RtlTime.LowPart = 0x20de5700; RtlTime.HighPart = 0x1c27d90;
hLib = LoadLibrary("ntdll");
RtlTimeToTimeFields = (RtlTimeToTimeFieldsT)GetProcAddress (hLib, "RtlTimeToTimeFields");
RtlTimeToTimeFields(&RtlTime, &tf);
FreeLibrary(hLib);
printf("%d %d %d %d %d %d\n", tf.Year, tf.Month, tf.Day, tf.Hour, tf.Minute, tf.Second); return 0; } ----------8<---------------------------
with the following output on win2k. 9 0 10 0 9 10
with the following output on win2k. 9 0 10 0 9 10
This is weird, I would have expected to get an output like: 2002 10 27 8 9 10 with the followingo patch applied...
nog.
with the following output on win2k. 9 0 10 0 9 10
This is weird, I would have expected to get an output like: 2002 10
27 8 9 10
with the followingo patch applied...
nog.
Eeek, sorry about that. I forgot a WINAPI in the typedef, see my new version in the attachment...
The following output is more in line with your expectations: 2002 10 27 8 9 10
I have also attached the output of timetest2.c after some adjustments to make it compile on my box which is missing winternl.h. (I didn't take the time to download the SDK.)
However, I don't follow the part about appling patches. I have compiled the code using msvc and executed the code on windows 2000.
/peda