diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index e451db98277..0356f07d6bd 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -690,7 +690,7 @@ @ stub _get_purecall_handler @ stub _get_terminate @ stub _get_timezone -@ stub _get_tzname +@ cdecl _get_tzname(ptr str long long) msvcrt._get_tzname @ stub _get_unexpected @ stub _get_wpgmptr @ stub _getc_nolock diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 1734c729826..a1adb18fac7 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -535,7 +535,7 @@ @ cdecl _get_sbh_threshold() msvcrt._get_sbh_threshold @ stub _get_terminate @ stub _get_timezone -@ stub _get_tzname +@ cdecl _get_tzname(ptr str long long) msvcrt._get_tzname @ stub _get_unexpected @ stub _get_winmajor @ stub _get_winminor diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index f1883296cad..8ec604ac9ef 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -525,7 +525,7 @@ @ cdecl _get_sbh_threshold() msvcrt._get_sbh_threshold @ stub _get_terminate @ stub _get_timezone -@ stub _get_tzname +@ cdecl _get_tzname(ptr str long long) msvcrt._get_tzname @ stub _get_unexpected @ stub _get_wpgmptr @ stub _getc_nolock diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index a667adab2a5..871023ba6b6 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -483,6 +483,7 @@ # stub _get_winver # stub _get_wpgmptr @ stub _get_terminate +@ cdecl _get_tzname(ptr str long long) MSVCRT__get_tzname @ stub _get_unexpected @ cdecl _getch() @ cdecl _getche() diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 9d5962572e3..b345a7f8e16 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -719,10 +719,44 @@ MSVCRT_long * CDECL MSVCRT___p__timezone(void) * must be large enough. The size is picked based on observation of * Windows XP. */ -static char tzname_std[64] = ""; -static char tzname_dst[64] = ""; +static char tzname_std[64] = "PST"; +static char tzname_dst[64] = "PDT"; char *MSVCRT__tzname[2] = { tzname_std, tzname_dst }; +/********************************************************************* + * _get_tzname (MSVCRT.@) + */ +int CDECL MSVCRT__get_tzname(MSVCRT_size_t *ret, char *buf, MSVCRT_size_t bufsize, int index) +{ + char *timezone; + + switch(index) + { + case 0: + timezone = tzname_std; + break; + case 1: + timezone = tzname_dst; + break; + default: + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } + + if(!ret || (!buf && bufsize > 0) || (buf && !bufsize)) + { + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } + + *ret = strlen(timezone)+1; + if(!buf && !bufsize) + return 0; + + strcpy(buf, timezone); + return 0; +} + /********************************************************************* * __p_tzname (MSVCRT.@) */