msvcr110: Add _W_Gettnames implementation.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2016-01-20 11:42:14 +01:00 committed by Alexandre Julliard
parent d4450b9195
commit 59ed8c593c
7 changed files with 66 additions and 5 deletions

View file

@ -4,7 +4,7 @@
@ cdecl _Strftime(str long str ptr ptr) ucrtbase._Strftime
@ cdecl _W_Getdays() ucrtbase._W_Getdays
@ cdecl _W_Getmonths() ucrtbase._W_Getmonths
@ stub _W_Gettnames
@ cdecl _W_Gettnames() ucrtbase._W_Gettnames
@ stub _Wcsftime
@ cdecl __daylight() ucrtbase.__daylight
@ cdecl __dstbias() ucrtbase.__dstbias

View file

@ -866,7 +866,7 @@
@ stub _Unlock_shared_ptr_spin_lock
@ cdecl _W_Getdays()
@ cdecl _W_Getmonths()
@ stub _W_Gettnames
@ cdecl _W_Gettnames()
@ stub _Wcsftime
@ cdecl _XcptFilter(long ptr)
@ cdecl __AdjustPointer(ptr ptr)

View file

@ -850,7 +850,7 @@
@ cdecl _Strftime(str long str ptr ptr)
@ cdecl _W_Getdays()
@ cdecl _W_Getmonths()
@ stub _W_Gettnames
@ cdecl _W_Gettnames()
@ stub _Wcsftime
@ cdecl _XcptFilter(long ptr)
@ cdecl __AdjustPointer(ptr ptr)

View file

@ -24,6 +24,7 @@
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include "wine/test.h"
#include <locale.h>
@ -80,6 +81,8 @@ static int (CDECL *p__fdsign)(float);
static int (__cdecl *p__dpcomp)(double x, double y);
static wchar_t** (CDECL *p____lc_locale_name_func)(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)
{
@ -100,6 +103,8 @@ static BOOL init(void)
p__dpcomp = (void*)GetProcAddress(module, "_dpcomp");
p____lc_locale_name_func = (void*)GetProcAddress(module, "___lc_locale_name_func");
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;
}
@ -269,6 +274,53 @@ static void test__GetConcurrency(void)
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)
{
if (!init()) return;
@ -277,4 +329,5 @@ START_TEST(msvcr120)
test__dpcomp();
test____lc_locale_name_func();
test__GetConcurrency();
test__W_Gettnames();
}

View file

@ -844,7 +844,7 @@
@ cdecl _Strftime(str long str ptr ptr) msvcr120._Strftime
@ cdecl _W_Getdays() msvcr120._W_Getdays
@ cdecl _W_Getmonths() msvcr120._W_Getmonths
@ stub _W_Gettnames
@ cdecl _W_Gettnames() msvcr120._W_Gettnames
@ stub _Wcsftime
@ cdecl _XcptFilter(long ptr) msvcr120._XcptFilter
@ cdecl __AdjustPointer(ptr ptr) msvcr120.__AdjustPointer

View file

@ -579,6 +579,14 @@ void* CDECL _Gettnames(void)
return ret;
}
/*********************************************************************
* _W_Gettnames (MSVCR110.@)
*/
void* CDECL _W_Gettnames(void)
{
return _Gettnames();
}
/*********************************************************************
* __crtLCMapStringA (MSVCRT.@)
*/

View file

@ -43,7 +43,7 @@
@ cdecl _Strftime(str long str ptr ptr)
@ cdecl _W_Getdays()
@ cdecl _W_Getmonths()
@ stub _W_Gettnames
@ cdecl _W_Gettnames()
@ stub _Wcsftime
@ cdecl __AdjustPointer(ptr ptr)
@ stub __BuildCatchObject