msvcrt: Implement _get_tzname.

This commit is contained in:
Eryk Wieliczko 2010-11-03 02:12:28 +01:00 committed by Alexandre Julliard
parent c4c091d4b7
commit 7b8ac6a255
5 changed files with 40 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -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.@)
*/