Eryk Wieliczko : msvcrt: Implement _get_tzname.
Alexandre Julliard
julliard at winehq.org
Thu Nov 4 12:52:51 CDT 2010
Module: wine
Branch: master
Commit: 7b8ac6a255d3d53757087dd24222c3613be0fe47
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7b8ac6a255d3d53757087dd24222c3613be0fe47
Author: Eryk Wieliczko <ewdevel at gmail.com>
Date: Wed Nov 3 02:12:28 2010 +0100
msvcrt: Implement _get_tzname.
---
dlls/msvcr100/msvcr100.spec | 2 +-
dlls/msvcr80/msvcr80.spec | 2 +-
dlls/msvcr90/msvcr90.spec | 2 +-
dlls/msvcrt/msvcrt.spec | 1 +
dlls/msvcrt/time.c | 38 ++++++++++++++++++++++++++++++++++++--
5 files changed, 40 insertions(+), 5 deletions(-)
diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index e451db9..0356f07 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 1734c72..a1adb18 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 f188329..8ec604a 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 a667ada..871023b 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 9d59625..b345a7f 100644
--- a/dlls/msvcrt/time.c
+++ b/dlls/msvcrt/time.c
@@ -719,11 +719,45 @@ 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.@)
*/
char ** CDECL __p__tzname(void)
More information about the wine-cvs
mailing list