[PATCH 0/1] MR4851: kernelbase: Add naive SystemTimeToTzSpecificLocalTimeEx implementation
The cast there seems safe from looking at the struct definitions, and is also used elsewhere in the codebase (dlls/kernelbase/locale.c:5682). It's obviously not a full implementation, but works well enough for my usecase and maybe others as well. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4851
From: Russell Greene <russell(a)shotover.com> --- dlls/kernel32/kernel32.spec | 2 +- dlls/kernelbase/kernelbase.spec | 2 +- dlls/kernelbase/locale.c | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index bb9c8fbfe0e..be9a0f1c490 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -1528,7 +1528,7 @@ @ stdcall -import SwitchToThread() @ stdcall -import SystemTimeToFileTime(ptr ptr) @ stdcall -import SystemTimeToTzSpecificLocalTime (ptr ptr ptr) -# @ stub SystemTimeToTzSpecificLocalTimeEx +@ stdcall -import SystemTimeToTzSpecificLocalTimeEx (ptr ptr ptr) @ stdcall TerminateJobObject(long long) @ stdcall -import TerminateProcess(long long) @ stdcall -import TerminateThread(long long) diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index ffb153a46ee..2c38bc5c348 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -1634,7 +1634,7 @@ @ stdcall SwitchToThread() @ stdcall SystemTimeToFileTime(ptr ptr) @ stdcall SystemTimeToTzSpecificLocalTime(ptr ptr ptr) -@ stub SystemTimeToTzSpecificLocalTimeEx +@ stdcall SystemTimeToTzSpecificLocalTimeEx(ptr ptr ptr) @ stdcall TerminateProcess(long long) # @ stub TerminateProcessOnMemoryExhaustion @ stdcall TerminateThread(long long) diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 44af29f163d..c6c46c3a629 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -7084,6 +7084,18 @@ BOOL WINAPI DECLSPEC_HOTPATCH SystemTimeToTzSpecificLocalTime( const TIME_ZONE_I } +/*********************************************************************** + * SystemTimeToTzSpecificLocalTimeEx (kernelbase.@) + */ +BOOL WINAPI DECLSPEC_HOTPATCH SystemTimeToTzSpecificLocalTimeEx( const DYNAMIC_TIME_ZONE_INFORMATION *info, + const SYSTEMTIME *system, + SYSTEMTIME *local ) +{ + FIXME( "just runs SystemTimeToTzSpecificLocalTime\n" ); + return SystemTimeToTzSpecificLocalTime( (const TIME_ZONE_INFORMATION *)info, system, local ); +} + + /*********************************************************************** * TzSpecificLocalTimeToSystemTime (kernelbase.@) */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4851
I imagine this will produce incorrect results when you actually have dynamic DST data, and it's not that rare. Could you name an application that needs this? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4851#note_88924
I added this for a proprietary mapping app. Yeah, it's not a correct implementation, but it allowed the app to not crash and actually to run pretty decently. I can probably find some time to look into a proper implementation, but it was certainly enough for me. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4851#note_88944
participants (3)
-
Nikolay Sivov (@nsivov) -
Russell Greene -
Russell Greene (@russelltg)