Nikolay Sivov : kernel32: EnumTimeFormatsA() doesn' t support TIME_NOSECONDS.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Nov 10 10:36:22 CST 2015


Module: wine
Branch: master
Commit: 6f35351f81452344beb3a631bad1806613496b1f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6f35351f81452344beb3a631bad1806613496b1f

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Nov 10 17:40:08 2015 +0300

kernel32: EnumTimeFormatsA() doesn't support TIME_NOSECONDS.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/lcformat.c     | 6 ++++++
 dlls/kernel32/tests/locale.c | 3 +--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/lcformat.c b/dlls/kernel32/lcformat.c
index 48adb11..9ca3e07 100644
--- a/dlls/kernel32/lcformat.c
+++ b/dlls/kernel32/lcformat.c
@@ -1930,6 +1930,12 @@ BOOL WINAPI EnumTimeFormatsA(TIMEFMT_ENUMPROCA proc, LCID lcid, DWORD flags)
 {
     char buf[256];
 
+    if (flags & ~LOCALE_USE_CP_ACP)
+    {
+        SetLastError(ERROR_INVALID_FLAGS);
+        return FALSE;
+    }
+
     if (!proc)
     {
         SetLastError(ERROR_INVALID_PARAMETER);
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index b34767b..6fa2627 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -3520,14 +3520,13 @@ static void test_EnumTimeFormatsW(void)
 
         /* EnumTimeFormatsA doesn't support this flag */
         ret = EnumTimeFormatsA(enum_datetime_procA, lcid, TIME_NOSECONDS);
-    todo_wine {
         ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "EnumTimeFormatsA(TIME_NOSECONDS) ret %d, error %d\n", ret,
             GetLastError());
 
         ret = EnumTimeFormatsA(NULL, lcid, TIME_NOSECONDS);
         ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "EnumTimeFormatsA(TIME_NOSECONDS) ret %d, error %d\n", ret,
             GetLastError());
-    }
+
         /* And it's not supported by GetLocaleInfoA either */
         ret = GetLocaleInfoA(lcid, LOCALE_SSHORTTIME, buf, sizeof(buf)/sizeof(buf[0]));
         ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "GetLocaleInfoA(LOCALE_SSHORTTIME) ret %d, error %d\n", ret,




More information about the wine-cvs mailing list