Commit 59ed8c59 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcr110: Add _W_Gettnames implementation.

parent d4450b91
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
@ cdecl _Strftime(str long str ptr ptr) ucrtbase._Strftime @ cdecl _Strftime(str long str ptr ptr) ucrtbase._Strftime
@ cdecl _W_Getdays() ucrtbase._W_Getdays @ cdecl _W_Getdays() ucrtbase._W_Getdays
@ cdecl _W_Getmonths() ucrtbase._W_Getmonths @ cdecl _W_Getmonths() ucrtbase._W_Getmonths
@ stub _W_Gettnames @ cdecl _W_Gettnames() ucrtbase._W_Gettnames
@ stub _Wcsftime @ stub _Wcsftime
@ cdecl __daylight() ucrtbase.__daylight @ cdecl __daylight() ucrtbase.__daylight
@ cdecl __dstbias() ucrtbase.__dstbias @ cdecl __dstbias() ucrtbase.__dstbias
......
...@@ -866,7 +866,7 @@ ...@@ -866,7 +866,7 @@
@ stub _Unlock_shared_ptr_spin_lock @ stub _Unlock_shared_ptr_spin_lock
@ cdecl _W_Getdays() @ cdecl _W_Getdays()
@ cdecl _W_Getmonths() @ cdecl _W_Getmonths()
@ stub _W_Gettnames @ cdecl _W_Gettnames()
@ stub _Wcsftime @ stub _Wcsftime
@ cdecl _XcptFilter(long ptr) @ cdecl _XcptFilter(long ptr)
@ cdecl __AdjustPointer(ptr ptr) @ cdecl __AdjustPointer(ptr ptr)
......
...@@ -850,7 +850,7 @@ ...@@ -850,7 +850,7 @@
@ cdecl _Strftime(str long str ptr ptr) @ cdecl _Strftime(str long str ptr ptr)
@ cdecl _W_Getdays() @ cdecl _W_Getdays()
@ cdecl _W_Getmonths() @ cdecl _W_Getmonths()
@ stub _W_Gettnames @ cdecl _W_Gettnames()
@ stub _Wcsftime @ stub _Wcsftime
@ cdecl _XcptFilter(long ptr) @ cdecl _XcptFilter(long ptr)
@ cdecl __AdjustPointer(ptr ptr) @ cdecl __AdjustPointer(ptr ptr)
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <windef.h> #include <windef.h>
#include <winbase.h> #include <winbase.h>
#include <winnls.h>
#include "wine/test.h" #include "wine/test.h"
#include <locale.h> #include <locale.h>
...@@ -80,6 +81,8 @@ static int (CDECL *p__fdsign)(float); ...@@ -80,6 +81,8 @@ static int (CDECL *p__fdsign)(float);
static int (__cdecl *p__dpcomp)(double x, double y); static int (__cdecl *p__dpcomp)(double x, double y);
static wchar_t** (CDECL *p____lc_locale_name_func)(void); static wchar_t** (CDECL *p____lc_locale_name_func)(void);
static unsigned int (CDECL *p__GetConcurrency)(void); static unsigned int (CDECL *p__GetConcurrency)(void);
static void* (CDECL *p__W_Gettnames)(void);
static void (CDECL *p_free)(void*);
static BOOL init(void) static BOOL init(void)
{ {
...@@ -100,6 +103,8 @@ static BOOL init(void) ...@@ -100,6 +103,8 @@ static BOOL init(void)
p__dpcomp = (void*)GetProcAddress(module, "_dpcomp"); p__dpcomp = (void*)GetProcAddress(module, "_dpcomp");
p____lc_locale_name_func = (void*)GetProcAddress(module, "___lc_locale_name_func"); p____lc_locale_name_func = (void*)GetProcAddress(module, "___lc_locale_name_func");
p__GetConcurrency = (void*)GetProcAddress(module,"?_GetConcurrency@details@Concurrency@@YAIXZ"); p__GetConcurrency = (void*)GetProcAddress(module,"?_GetConcurrency@details@Concurrency@@YAIXZ");
p__W_Gettnames = (void*)GetProcAddress(module, "_W_Gettnames");
p_free = (void*)GetProcAddress(module, "free");
return TRUE; return TRUE;
} }
...@@ -269,6 +274,53 @@ static void test__GetConcurrency(void) ...@@ -269,6 +274,53 @@ static void test__GetConcurrency(void)
ok(c == si.dwNumberOfProcessors, "expected %u, got %u\n", si.dwNumberOfProcessors, c); ok(c == si.dwNumberOfProcessors, "expected %u, got %u\n", si.dwNumberOfProcessors, c);
} }
static void test__W_Gettnames(void)
{
static const char *str[] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday",
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
"January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December",
"AM", "PM", "M/d/yyyy"
};
struct {
char *str[43];
int unk[2];
wchar_t *wstr[43];
wchar_t *locname;
char data[1];
} *ret;
int i, size;
WCHAR buf[64];
if(!p_setlocale(LC_ALL, "english"))
return;
ret = p__W_Gettnames();
size = ret->str[0]-(char*)ret;
if(sizeof(void*) == 8)
ok(size==0x2c0, "structure size: %x\n", size);
else
ok(size==0x164, "structure size: %x\n", size);
for(i=0; i<sizeof(str)/sizeof(*str); i++) {
ok(!strcmp(ret->str[i], str[i]), "ret->str[%d] = %s, expected %s\n",
i, ret->str[i], str[i]);
MultiByteToWideChar(CP_ACP, 0, str[i], strlen(str[i])+1,
buf, sizeof(buf)/sizeof(*buf));
ok(!lstrcmpW(ret->wstr[i], buf), "ret->wstr[%d] = %s, expected %s\n",
i, wine_dbgstr_w(ret->wstr[i]), wine_dbgstr_w(buf));
}
p_free(ret);
p_setlocale(LC_ALL, "C");
}
START_TEST(msvcr120) START_TEST(msvcr120)
{ {
if (!init()) return; if (!init()) return;
...@@ -277,4 +329,5 @@ START_TEST(msvcr120) ...@@ -277,4 +329,5 @@ START_TEST(msvcr120)
test__dpcomp(); test__dpcomp();
test____lc_locale_name_func(); test____lc_locale_name_func();
test__GetConcurrency(); test__GetConcurrency();
test__W_Gettnames();
} }
...@@ -844,7 +844,7 @@ ...@@ -844,7 +844,7 @@
@ cdecl _Strftime(str long str ptr ptr) msvcr120._Strftime @ cdecl _Strftime(str long str ptr ptr) msvcr120._Strftime
@ cdecl _W_Getdays() msvcr120._W_Getdays @ cdecl _W_Getdays() msvcr120._W_Getdays
@ cdecl _W_Getmonths() msvcr120._W_Getmonths @ cdecl _W_Getmonths() msvcr120._W_Getmonths
@ stub _W_Gettnames @ cdecl _W_Gettnames() msvcr120._W_Gettnames
@ stub _Wcsftime @ stub _Wcsftime
@ cdecl _XcptFilter(long ptr) msvcr120._XcptFilter @ cdecl _XcptFilter(long ptr) msvcr120._XcptFilter
@ cdecl __AdjustPointer(ptr ptr) msvcr120.__AdjustPointer @ cdecl __AdjustPointer(ptr ptr) msvcr120.__AdjustPointer
......
...@@ -580,6 +580,14 @@ void* CDECL _Gettnames(void) ...@@ -580,6 +580,14 @@ void* CDECL _Gettnames(void)
} }
/********************************************************************* /*********************************************************************
* _W_Gettnames (MSVCR110.@)
*/
void* CDECL _W_Gettnames(void)
{
return _Gettnames();
}
/*********************************************************************
* __crtLCMapStringA (MSVCRT.@) * __crtLCMapStringA (MSVCRT.@)
*/ */
int CDECL __crtLCMapStringA( int CDECL __crtLCMapStringA(
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
@ cdecl _Strftime(str long str ptr ptr) @ cdecl _Strftime(str long str ptr ptr)
@ cdecl _W_Getdays() @ cdecl _W_Getdays()
@ cdecl _W_Getmonths() @ cdecl _W_Getmonths()
@ stub _W_Gettnames @ cdecl _W_Gettnames()
@ stub _Wcsftime @ stub _Wcsftime
@ cdecl __AdjustPointer(ptr ptr) @ cdecl __AdjustPointer(ptr ptr)
@ stub __BuildCatchObject @ stub __BuildCatchObject
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment