From b0f8a2b85f1ef8989d77b66e54433009fab53847 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Wed, 25 Feb 2015 15:33:52 +0100 Subject: [PATCH] msvcp: Added _Getdateorder implementation. --- dlls/msvcp100/msvcp100.spec | 2 +- dlls/msvcp110/msvcp110.spec | 2 +- dlls/msvcp120/msvcp120.spec | 2 +- dlls/msvcp120_app/msvcp120_app.spec | 2 +- dlls/msvcp80/msvcp80.spec | 2 +- dlls/msvcp90/locale.c | 26 ++++++++++++++++++++++++-- dlls/msvcp90/msvcp90.spec | 2 +- 7 files changed, 30 insertions(+), 8 deletions(-) diff --git a/dlls/msvcp100/msvcp100.spec b/dlls/msvcp100/msvcp100.spec index 0055d795daf..bafbf185afd 100644 --- a/dlls/msvcp100/msvcp100.spec +++ b/dlls/msvcp100/msvcp100.spec @@ -2912,7 +2912,7 @@ @ cdecl -ret64 _Getcoll() @ cdecl _Getctype(ptr) @ cdecl -ret64 _Getcvt() -@ stub _Getdateorder +@ cdecl _Getdateorder() @ cdecl _Getwctype(long ptr) @ cdecl _Getwctypes(ptr ptr ptr ptr) @ extern _Hugeval diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec index a2c5ac9a0c8..6548146638e 100644 --- a/dlls/msvcp110/msvcp110.spec +++ b/dlls/msvcp110/msvcp110.spec @@ -3781,7 +3781,7 @@ @ cdecl -ret64 _Getcoll() @ cdecl _Getctype(ptr) @ cdecl -ret64 _Getcvt() -@ stub _Getdateorder +@ cdecl _Getdateorder() @ cdecl _Getwctype(long ptr) @ cdecl _Getwctypes(ptr ptr ptr ptr) @ extern _Hugeval diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec index 653b742b3cb..30071abf974 100644 --- a/dlls/msvcp120/msvcp120.spec +++ b/dlls/msvcp120/msvcp120.spec @@ -3724,7 +3724,7 @@ @ cdecl -ret64 _Getcoll() @ cdecl _Getctype(ptr) @ cdecl -ret64 _Getcvt() -@ stub _Getdateorder +@ cdecl _Getdateorder() @ cdecl _Getwctype(long ptr) @ cdecl _Getwctypes(ptr ptr ptr ptr) @ extern _Hugeval diff --git a/dlls/msvcp120_app/msvcp120_app.spec b/dlls/msvcp120_app/msvcp120_app.spec index 390d470eba6..61ba7919c31 100644 --- a/dlls/msvcp120_app/msvcp120_app.spec +++ b/dlls/msvcp120_app/msvcp120_app.spec @@ -3724,7 +3724,7 @@ @ cdecl -ret64 _Getcoll() msvcp120._Getcoll @ cdecl _Getctype(ptr) msvcp120._Getctype @ cdecl -ret64 _Getcvt() msvcp120._Getcvt -@ stub _Getdateorder +@ cdecl _Getdateorder() msvcp120._Getdateorder @ cdecl _Getwctype(long ptr) msvcp120._Getwctype @ cdecl _Getwctypes(ptr ptr ptr ptr) msvcp120._Getwctypes @ extern _Hugeval msvcp120._Hugeval diff --git a/dlls/msvcp80/msvcp80.spec b/dlls/msvcp80/msvcp80.spec index 8f3c43e13da..ed18b59b4f6 100644 --- a/dlls/msvcp80/msvcp80.spec +++ b/dlls/msvcp80/msvcp80.spec @@ -5727,7 +5727,7 @@ @ cdecl -ret64 _Getcoll() @ cdecl _Getctype(ptr) @ cdecl -ret64 _Getcvt() -@ stub _Getdateorder +@ cdecl _Getdateorder() @ cdecl _Getwctype(long ptr) @ cdecl _Getwctypes(ptr ptr ptr ptr) @ extern _Hugeval diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index a0fbc6620e1..95f4e8de491 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -38,6 +38,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcp); +typedef enum { + DATEORDER_no_order, + DATEORDER_dmy, + DATEORDER_mdy, + DATEORDER_ymd, + DATEORDER_ydm +} dateorder; + char* __cdecl _Getdays(void); char* __cdecl _Getmonths(void); void* __cdecl _Gettnames(void); @@ -689,13 +697,27 @@ _Cvtvec* __thiscall _Locinfo__Getcvt(const _Locinfo *this, _Cvtvec *ret) return ret; } +int __cdecl _Getdateorder(void) +{ + WCHAR date_fmt[2]; + + if(!GetLocaleInfoW(___lc_handle_func()[LC_TIME], LOCALE_ILDATE, + date_fmt, sizeof(date_fmt)/sizeof(*date_fmt))) + return DATEORDER_no_order; + + if(*date_fmt == '0') return DATEORDER_mdy; + if(*date_fmt == '1') return DATEORDER_dmy; + if(*date_fmt == '2') return DATEORDER_ymd; + return DATEORDER_no_order; +} + /* ?_Getdateorder@_Locinfo@std@@QBEHXZ */ /* ?_Getdateorder@_Locinfo@std@@QEBAHXZ */ DEFINE_THISCALL_WRAPPER(_Locinfo__Getdateorder, 4) int __thiscall _Locinfo__Getdateorder(const _Locinfo *this) { - FIXME("(%p) stub\n", this); - return 0; + TRACE("(%p)\n", this); + return _Getdateorder(); } /* ?_Getdays@_Locinfo@std@@QBEPBDXZ */ diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec index 925a153aaea..0e5c842d457 100644 --- a/dlls/msvcp90/msvcp90.spec +++ b/dlls/msvcp90/msvcp90.spec @@ -6499,7 +6499,7 @@ @ cdecl -ret64 _Getcoll() @ cdecl _Getctype(ptr) @ cdecl -ret64 _Getcvt() -@ stub _Getdateorder +@ cdecl _Getdateorder() @ cdecl _Getwctype(long ptr) @ cdecl _Getwctypes(ptr ptr ptr ptr) @ extern _Hugeval