msvcrt: Implement _get_tzname.
Eryk Wieliczko
ewdevel at gmail.com
Tue Nov 2 20:12:28 CDT 2010
---
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 6471e6b..79542d4 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 5041b01..4267b39 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 f1bb7e9..0f4ede5 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 848519e..a1413b5 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 261c57a..2bd35ae 100644
--- a/dlls/msvcrt/time.c
+++ b/dlls/msvcrt/time.c
@@ -720,11 +720,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)
--
1.7.0.4
More information about the wine-patches
mailing list