winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2011
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
810 discussions
Start a n
N
ew thread
Piotr Caban : msvcp90: Added ctype<char>::is functions implementation.
by Alexandre Julliard
21 Dec '11
21 Dec '11
Module: wine Branch: master Commit: 1a711acdc2af87a98448f7c3cb2cb15e59c09277 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1a711acdc2af87a98448f7c3c…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Dec 21 15:59:31 2011 +0100 msvcp90: Added ctype<char>::is functions implementation. --- dlls/msvcp90/locale.c | 28 ++++++++++++++++++---------- 1 files changed, 18 insertions(+), 10 deletions(-) diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index 7708e38..582d96f 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -1597,8 +1597,8 @@ const char* __thiscall ctype_char_toupper(const ctype_char *this, char *first, c DEFINE_THISCALL_WRAPPER(ctype_char_is_ch, 12) MSVCP_bool __thiscall ctype_char_is_ch(const ctype_char *this, short mask, char ch) { - FIXME("(%p %x %c) stub\n", this, mask, ch); - return 0; + TRACE("(%p %x %c)\n", this, mask, ch); + return (this->ctype.table[(unsigned char)ch] & mask) != 0; } /* ?is@?$ctype@D@std@@QBEPBDPBD0PAF@Z */ @@ -1606,8 +1606,10 @@ MSVCP_bool __thiscall ctype_char_is_ch(const ctype_char *this, short mask, char DEFINE_THISCALL_WRAPPER(ctype_char_is, 16) const char* __thiscall ctype_char_is(const ctype_char *this, const char *first, const char *last, short *dest) { - FIXME("(%p %p %p %p) stub\n", this, first, last, dest); - return NULL; + TRACE("(%p %p %p %p)\n", this, first, last, dest); + for(; first<last; first++) + *dest++ = this->ctype.table[(unsigned char)*first]; + return last; } /* ?scan_is@?$ctype@D@std@@QBEPBDFPBD0@Z */ @@ -1615,8 +1617,11 @@ const char* __thiscall ctype_char_is(const ctype_char *this, const char *first, DEFINE_THISCALL_WRAPPER(ctype_char_scan_is, 16) const char* __thiscall ctype_char_scan_is(const ctype_char *this, short mask, const char *first, const char *last) { - FIXME("(%p %x %p %p) stub\n", this, mask, first, last); - return NULL; + TRACE("(%p %x %p %p)\n", this, mask, first, last); + for(; first<last; first++) + if(!ctype_char_is_ch(this, mask, *first)) + break; + return first; } /* ?scan_not@?$ctype@D@std@@QBEPBDFPBD0@Z */ @@ -1624,8 +1629,11 @@ const char* __thiscall ctype_char_scan_is(const ctype_char *this, short mask, co DEFINE_THISCALL_WRAPPER(ctype_char_scan_not, 16) const char* __thiscall ctype_char_scan_not(const ctype_char *this, short mask, const char *first, const char *last) { - FIXME("(%p %x %p %p) stub\n", this, mask, first, last); - return NULL; + TRACE("(%p %x %p %p)\n", this, mask, first, last); + for(; first<last; first++) + if(ctype_char_is_ch(this, mask, *first)) + break; + return first; } /* ?table@?$ctype@D@std@@IBEPBFXZ */ @@ -1633,8 +1641,8 @@ const char* __thiscall ctype_char_scan_not(const ctype_char *this, short mask, c DEFINE_THISCALL_WRAPPER(ctype_char_table, 4) const short* __thiscall ctype_char_table(const ctype_char *this) { - FIXME("(%p) stub\n", this); - return NULL; + TRACE("(%p)\n", this); + return this->ctype.table; } /* ?id@?$ctype@_W@std@@2V0locale@2@A */
1
0
0
0
Piotr Caban : msvcp90: Added ctype<char>::toupper functions implementation.
by Alexandre Julliard
21 Dec '11
21 Dec '11
Module: wine Branch: master Commit: 7fe9abd5cc63f6b8e66226d8157acb89bb0ab432 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7fe9abd5cc63f6b8e66226d81…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Dec 21 15:59:18 2011 +0100 msvcp90: Added ctype<char>::toupper functions implementation. --- dlls/msvcp90/locale.c | 66 +++++++++++++++++++++++++++++++++++++++----- dlls/msvcp90/msvcp90.spec | 2 +- 2 files changed, 59 insertions(+), 9 deletions(-) diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index 39f01bf..7708e38 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -1505,23 +1505,73 @@ const char* __thiscall ctype_char_tolower(const ctype_char *this, char *first, c return call_ctype_char_do_tolower(this, first, last); } +/* _Toupper */ +int __cdecl _Toupper(int ch, const _Ctypevec *ctype) +{ + unsigned int cp; + + TRACE("%d %p\n", ch, ctype); + + if(ctype) + cp = ctype->page; + else + cp = ___lc_codepage_func(); + + /* Don't convert to unicode in case of C locale */ + if(!cp) { + if(ch>='a' && ch<='z') + ch = ch-'a'+'A'; + return ch; + } else { + WCHAR wide, upper; + char str[2]; + int size; + + if(ch > 255) { + str[0] = (ch>>8) & 255; + str[1] = ch & 255; + size = 2; + } else { + str[0] = ch & 255; + size = 1; + } + + if(!MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, str, size, &wide, 1)) + return ch; + + upper = toupperW(wide); + if(upper == wide) + return ch; + + WideCharToMultiByte(cp, 0, &upper, 1, str, 2, NULL, NULL); + + return str[0] + (str[1]<<8); + } +} + /* ?do_toupper@?$ctype@D@std@@MBEDD@Z */ /* ?do_toupper@?$ctype@D@std@@MEBADD@Z */ +#define call_ctype_char_do_toupper_ch(this, ch) CALL_VTBL_FUNC(this, 16, \ + char, (const ctype_char*, char), (this, ch)) DEFINE_THISCALL_WRAPPER(ctype_char_do_toupper_ch, 8) char __thiscall ctype_char_do_toupper_ch(const ctype_char *this, char ch) { - FIXME("(%p %c) stub\n", this, ch); - return 0; + TRACE("(%p %c)\n", this, ch); + return _Toupper(ch, &this->ctype); } /* ?do_toupper@?$ctype@D@std@@MBEPBDPADPBD@Z */ /* ?do_toupper@?$ctype@D@std@@MEBAPEBDPEADPEBD@Z */ +#define call_ctype_char_do_toupper(this, first, last) CALL_VTBL_FUNC(this, 12, \ + const char*, (const ctype_char*, char*, const char*), (this, first, last)) DEFINE_THISCALL_WRAPPER(ctype_char_do_toupper, 12) const char* __thiscall ctype_char_do_toupper(const ctype_char *this, char *first, const char *last) { - FIXME("(%p %p %p) stub\n", this, first, last); - return NULL; + TRACE("(%p %p %p)\n", this, first, last); + for(; first<last; first++) + *first = _Toupper(*first, &this->ctype); + return last; } /* ?toupper@?$ctype@D@std@@QBEDD@Z */ @@ -1529,8 +1579,8 @@ const char* __thiscall ctype_char_do_toupper(const ctype_char *this, DEFINE_THISCALL_WRAPPER(ctype_char_toupper_ch, 8) char __thiscall ctype_char_toupper_ch(const ctype_char *this, char ch) { - FIXME("(%p %c) stub\n", this, ch); - return 0; + TRACE("(%p %c)\n", this, ch); + return call_ctype_char_do_toupper_ch(this, ch); } /* ?toupper@?$ctype@D@std@@QBEPBDPADPBD@Z */ @@ -1538,8 +1588,8 @@ char __thiscall ctype_char_toupper_ch(const ctype_char *this, char ch) DEFINE_THISCALL_WRAPPER(ctype_char_toupper, 12) const char* __thiscall ctype_char_toupper(const ctype_char *this, char *first, const char *last) { - FIXME("(%p %p %p) stub\n", this, first, last); - return NULL; + TRACE("(%p %p %p)\n", this, first, last); + return call_ctype_char_do_toupper(this, first, last); } /* ?is@?$ctype@D@std@@QBE_NFD@Z */ diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec index b7599ef..976ab8f 100644 --- a/dlls/msvcp90/msvcp90.spec +++ b/dlls/msvcp90/msvcp90.spec @@ -5799,7 +5799,7 @@ @ cdecl _Strcoll(ptr ptr ptr ptr ptr) @ stub _Strxfrm @ cdecl _Tolower(long ptr) -@ stub _Toupper +@ cdecl _Toupper(long ptr) @ stub _Towlower @ stub _Towupper @ stub _Wcrtomb
1
0
0
0
Piotr Caban : msvcp90: Added ctype<char>::tolower functions implementation.
by Alexandre Julliard
21 Dec '11
21 Dec '11
Module: wine Branch: master Commit: 283c07b8ceae3bec3816eaf38581d6fbe37c9434 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=283c07b8ceae3bec3816eaf38…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Dec 21 15:59:09 2011 +0100 msvcp90: Added ctype<char>::tolower functions implementation. --- dlls/msvcp90/locale.c | 88 +++++++++++++++++++++++++++++++++++++++----- dlls/msvcp90/msvcp90.h | 1 + dlls/msvcp90/msvcp90.spec | 2 +- dlls/msvcrt/locale.c | 4 +- dlls/msvcrt/msvcrt.h | 2 +- 5 files changed, 83 insertions(+), 14 deletions(-) diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index 95b5407..39f01bf 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -26,12 +26,14 @@ #include "windef.h" #include "winbase.h" #include "winnls.h" +#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(msvcp90); char* __cdecl _Getdays(void); char* __cdecl _Getmonths(void); void* __cdecl _Gettnames(void); +unsigned int __cdecl ___lc_codepage_func(void); typedef int category; @@ -1397,26 +1399,92 @@ const char* __thiscall ctype_char__Widen_s(const ctype_char *this, /* ?_Getcat@?$ctype@D@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */ MSVCP_size_t __cdecl ctype_char__Getcat(const locale_facet **facet, const locale *loc) { - FIXME("(%p %p) stub\n", facet, loc); - return 0; + TRACE("(%p %p)\n", facet, loc); + + if(facet && !*facet) { + _Locinfo locinfo; + + *facet = MSVCRT_operator_new(sizeof(ctype_char)); + if(!*facet) { + ERR("Out of memory\n"); + throw_exception(EXCEPTION_BAD_ALLOC, NULL); + return 0; + } + + _Locinfo_ctor_cstr(&locinfo, MSVCP_basic_string_char_c_str(&loc->ptr->name)); + ctype_char_ctor_locinfo((ctype_char*)*facet, &locinfo, 0); + _Locinfo_dtor(&locinfo); + } + + return LC_CTYPE; +} + +/* _Tolower */ +int __cdecl _Tolower(int ch, const _Ctypevec *ctype) +{ + unsigned int cp; + + TRACE("%d %p\n", ch, ctype); + + if(ctype) + cp = ctype->page; + else + cp = ___lc_codepage_func(); + + /* Don't convert to unicode in case of C locale */ + if(!cp) { + if(ch>='A' && ch<='Z') + ch = ch-'A'+'a'; + return ch; + } else { + WCHAR wide, lower; + char str[2]; + int size; + + if(ch > 255) { + str[0] = (ch>>8) & 255; + str[1] = ch & 255; + size = 2; + } else { + str[0] = ch & 255; + size = 1; + } + + if(!MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, str, size, &wide, 1)) + return ch; + + lower = tolowerW(wide); + if(lower == wide) + return ch; + + WideCharToMultiByte(cp, 0, &lower, 1, str, 2, NULL, NULL); + + return str[0] + (str[1]<<8); + } } /* ?do_tolower@?$ctype@D@std@@MBEDD@Z */ /* ?do_tolower@?$ctype@D@std@@MEBADD@Z */ +#define call_ctype_char_do_tolower_ch(this, ch) CALL_VTBL_FUNC(this, 8, \ + char, (const ctype_char*, char), (this, ch)) DEFINE_THISCALL_WRAPPER(ctype_char_do_tolower_ch, 8) char __thiscall ctype_char_do_tolower_ch(const ctype_char *this, char ch) { - FIXME("(%p %c) stub\n", this, ch); - return 0; + TRACE("(%p %c)\n", this, ch); + return _Tolower(ch, &this->ctype); } /* ?do_tolower@?$ctype@D@std@@MBEPBDPADPBD@Z */ /* ?do_tolower@?$ctype@D@std@@MEBAPEBDPEADPEBD@Z */ +#define call_ctype_char_do_tolower(this, first, last) CALL_VTBL_FUNC(this, 4, \ + const char*, (const ctype_char*, char*, const char*), (this, first, last)) DEFINE_THISCALL_WRAPPER(ctype_char_do_tolower, 12) const char* __thiscall ctype_char_do_tolower(const ctype_char *this, char *first, const char *last) { - FIXME("(%p %p %p) stub\n", this, first, last); - return NULL; + TRACE("(%p %p %p)\n", this, first, last); + for(; first<last; first++) + *first = _Tolower(*first, &this->ctype); + return last; } /* ?tolower@?$ctype@D@std@@QBEDD@Z */ @@ -1424,8 +1492,8 @@ const char* __thiscall ctype_char_do_tolower(const ctype_char *this, char *first DEFINE_THISCALL_WRAPPER(ctype_char_tolower_ch, 8) char __thiscall ctype_char_tolower_ch(const ctype_char *this, char ch) { - FIXME("(%p %c) stub\n", this, ch); - return 0; + TRACE("(%p %c)\n", this, ch); + return call_ctype_char_do_tolower_ch(this, ch); } /* ?tolower@?$ctype@D@std@@QBEPBDPADPBD@Z */ @@ -1433,8 +1501,8 @@ char __thiscall ctype_char_tolower_ch(const ctype_char *this, char ch) DEFINE_THISCALL_WRAPPER(ctype_char_tolower, 12) const char* __thiscall ctype_char_tolower(const ctype_char *this, char *first, const char *last) { - FIXME("(%p %p %p) stub\n", this, first, last); - return NULL; + TRACE("(%p %p %p)\n", this, first, last); + return call_ctype_char_do_tolower(this, first, last); } /* ?do_toupper@?$ctype@D@std@@MBEDD@Z */ diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 63350fc..61567e8 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -136,6 +136,7 @@ const rtti_object_locator name ## _rtti = { \ extern void *vtbl_wrapper_0; extern void *vtbl_wrapper_4; +extern void *vtbl_wrapper_8; extern void *vtbl_wrapper_12; extern void *vtbl_wrapper_16; extern void *vtbl_wrapper_20; diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec index f53b579..b7599ef 100644 --- a/dlls/msvcp90/msvcp90.spec +++ b/dlls/msvcp90/msvcp90.spec @@ -5798,7 +5798,7 @@ @ stub _Stoulx @ cdecl _Strcoll(ptr ptr ptr ptr ptr) @ stub _Strxfrm -@ stub _Tolower +@ cdecl _Tolower(long ptr) @ stub _Toupper @ stub _Towlower @ stub _Towupper diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index c3a1c4b..60ea424 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -42,7 +42,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); #define MAX_LOCALE_LENGTH 256 MSVCRT__locale_t MSVCRT_locale = NULL; unsigned short *MSVCRT__pctype = NULL; -int MSVCRT___lc_codepage = 0; +unsigned int MSVCRT___lc_codepage = 0; int MSVCRT___lc_collate_cp = 0; LCID MSVCRT___lc_handle[MSVCRT_LC_MAX - MSVCRT_LC_MIN + 1] = { 0 }; int MSVCRT___mb_cur_max = 1; @@ -640,7 +640,7 @@ LCID* CDECL ___lc_handle_func(void) /********************************************************************* * ___lc_codepage_func (MSVCRT.@) */ -int CDECL ___lc_codepage_func(void) +unsigned int CDECL ___lc_codepage_func(void) { return MSVCRT___lc_codepage; } diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 0695e6f..7ea0067 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -218,7 +218,7 @@ extern thread_data_t *msvcrt_get_thread_data(void); LCID MSVCRT_locale_to_LCID(const char *); extern MSVCRT__locale_t MSVCRT_locale; -extern int MSVCRT___lc_codepage; +extern unsigned int MSVCRT___lc_codepage; extern int MSVCRT___lc_collate_cp; extern WORD MSVCRT__ctype [257];
1
0
0
0
Piotr Caban : msvcp90: Hold _LOCK_LOCALE critical section while _Lockinfo object exists.
by Alexandre Julliard
21 Dec '11
21 Dec '11
Module: wine Branch: master Commit: a1db838668820ac899225420f5ec08bf7ee1af2b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a1db838668820ac899225420f…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Dec 21 15:58:50 2011 +0100 msvcp90: Hold _LOCK_LOCALE critical section while _Lockinfo object exists. --- dlls/msvcp90/locale.c | 13 +------------ 1 files changed, 1 insertions(+), 12 deletions(-) diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index 8105ca0..95b5407 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -342,7 +342,6 @@ _Locinfo* __cdecl _Locinfo__Locinfo_ctor_cat_cstr(_Locinfo *locinfo, int categor MSVCP_basic_string_char_ctor_cstr(&locinfo->newlocname, locale); else MSVCP_basic_string_char_ctor_cstr(&locinfo->newlocname, "*"); - _Lockit_dtor(&locinfo->lock); return locinfo; } @@ -396,6 +395,7 @@ void __cdecl _Locinfo__Locinfo_dtor(_Locinfo *locinfo) MSVCP_basic_string_char_dtor(&locinfo->months); MSVCP_basic_string_char_dtor(&locinfo->oldlocname); MSVCP_basic_string_char_dtor(&locinfo->newlocname); + _Lockit_dtor(&locinfo->lock); } /* ??_F_Locinfo@std@@QAEXXZ */ @@ -425,7 +425,6 @@ _Locinfo* __cdecl _Locinfo__Locinfo_Addcats(_Locinfo *locinfo, int category, con if(!locstr) throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name"); - _Lockit_ctor_locktype(&locinfo->lock, _LOCK_LOCALE); MSVCP_basic_string_char_dtor(&locinfo->newlocname); if(category) @@ -437,7 +436,6 @@ _Locinfo* __cdecl _Locinfo__Locinfo_Addcats(_Locinfo *locinfo, int category, con MSVCP_basic_string_char_ctor_cstr(&locinfo->newlocname, locale); else MSVCP_basic_string_char_ctor_cstr(&locinfo->newlocname, "*"); - _Lockit_dtor(&locinfo->lock); return locinfo; } @@ -652,7 +650,6 @@ void __thiscall collate_char__Init(collate *this, const _Locinfo *locinfo) DEFINE_THISCALL_WRAPPER(collate_char_ctor_name, 12) collate* __thiscall collate_char_ctor_name(collate *this, const char *name, MSVCP_size_t refs) { - _Lockit lockit; _Locinfo locinfo; TRACE("(%p %s %lu)\n", this, name, refs); @@ -660,11 +657,9 @@ collate* __thiscall collate_char_ctor_name(collate *this, const char *name, MSVC locale_facet_ctor_refs(&this->facet, refs); this->facet.vtable = &MSVCP_collate_char_vtable; - _Lockit_ctor_locktype(&lockit, _LOCK_LOCALE); _Locinfo_ctor_cstr(&locinfo, name); collate_char__Init(this, &locinfo); _Locinfo_dtor(&locinfo); - _Lockit_dtor(&lockit); return this; } @@ -851,7 +846,6 @@ void __thiscall collate_wchar__Init(collate *this, const _Locinfo *locinfo) DEFINE_THISCALL_WRAPPER(collate_wchar_ctor_name, 12) collate* __thiscall collate_wchar_ctor_name(collate *this, const char *name, MSVCP_size_t refs) { - _Lockit lockit; _Locinfo locinfo; TRACE("(%p %s %lu)\n", this, name, refs); @@ -859,11 +853,9 @@ collate* __thiscall collate_wchar_ctor_name(collate *this, const char *name, MSV locale_facet_ctor_refs(&this->facet, refs); this->facet.vtable = &MSVCP_collate_wchar_vtable; - _Lockit_ctor_locktype(&lockit, _LOCK_LOCALE); _Locinfo_ctor_cstr(&locinfo, name); collate_wchar__Init(this, &locinfo); _Locinfo_dtor(&locinfo); - _Lockit_dtor(&lockit); return this; } @@ -1209,7 +1201,6 @@ DEFINE_THISCALL_WRAPPER(ctype_char_ctor_table, 16) ctype_char* __thiscall ctype_char_ctor_table(ctype_char *this, const short *table, MSVCP_bool delete, MSVCP_size_t refs) { - _Lockit lockit; _Locinfo locinfo; TRACE("(%p %p %d %lu)\n", this, table, delete, refs); @@ -1217,11 +1208,9 @@ ctype_char* __thiscall ctype_char_ctor_table(ctype_char *this, ctype_base_ctor_refs(&this->base, refs); this->base.facet.vtable = &MSVCP_ctype_char_vtable; - _Lockit_ctor_locktype(&lockit, _LOCK_LOCALE); _Locinfo_ctor(&locinfo); ctype_char__Init(this, &locinfo); _Locinfo_dtor(&locinfo); - _Lockit_dtor(&lockit); if(table) { ctype_char__Tidy(this);
1
0
0
0
Piotr Caban : msvcp90: Added ctype<char>::widen functions implementation.
by Alexandre Julliard
21 Dec '11
21 Dec '11
Module: wine Branch: master Commit: 8f8f6b3c0dd59507c5d6cc3f0bf9d7ecb912b043 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8f8f6b3c0dd59507c5d6cc3f0…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Dec 21 15:58:35 2011 +0100 msvcp90: Added ctype<char>::widen functions implementation. --- dlls/msvcp90/locale.c | 34 ++++++++++++++++++++++------------ 1 files changed, 22 insertions(+), 12 deletions(-) diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index 1bae73e..8105ca0 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -1339,30 +1339,40 @@ const char* __thiscall ctype_char__Narrow_s(const ctype_char *this, const char * /* ?do_widen@?$ctype@D@std@@MBEDD@Z */ /* ?do_widen@?$ctype@D@std@@MEBADD@Z */ DEFINE_THISCALL_WRAPPER(ctype_char_do_widen_ch, 8) +#define call_ctype_char_do_widen_ch(this, ch) CALL_VTBL_FUNC(this, 24, \ + char, (const ctype_char*, char), (this, ch)) char __thiscall ctype_char_do_widen_ch(const ctype_char *this, char ch) { - FIXME("(%p %c) stub\n", this, ch); - return 0; + TRACE("(%p %c)\n", this, ch); + return ch; } /* ?do_widen@?$ctype@D@std@@MBEPBDPBD0PAD@Z */ /* ?do_widen@?$ctype@D@std@@MEBAPEBDPEBD0PEAD@Z */ DEFINE_THISCALL_WRAPPER(ctype_char_do_widen, 16) +#define call_ctype_char_do_widen(this, first, last, dest) CALL_VTBL_FUNC(this, 20, \ + const char*, (const ctype_char*, const char*, const char*, char*), \ + (this, first, last, dest)) const char* __thiscall ctype_char_do_widen(const ctype_char *this, const char *first, const char *last, char *dest) { - FIXME("(%p %p %p %p) stub\n", this, first, last, dest); - return NULL; + TRACE("(%p %p %p %p)\n", this, first, last, dest); + memcpy(dest, first, last-first); + return last; } /* ?_Do_widen_s@?$ctype@D@std@@MBEPBDPBD0PADI@Z */ /* ?_Do_widen_s@?$ctype@D@std@@MEBAPEBDPEBD0PEAD_K@Z */ DEFINE_THISCALL_WRAPPER(ctype_char__Do_widen_s, 20) +#define call_ctype_char__Do_widen_s(this, first, last, dest, size) CALL_VTBL_FUNC(this, 28, \ + const char*, (const ctype_char*, const char*, const char*, char*, MSVCP_size_t), \ + (this, first, last, dest, size)) const char* __thiscall ctype_char__Do_widen_s(const ctype_char *this, const char *first, const char *last, char *dest, MSVCP_size_t size) { - FIXME("(%p %p %p %p %lu) stub\n", this, first, last, dest, size); - return NULL; + TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size); + memcpy_s(dest, size, first, last-first); + return last; } /* ?widen@?$ctype@D@std@@QBEDD@Z */ @@ -1370,8 +1380,8 @@ const char* __thiscall ctype_char__Do_widen_s(const ctype_char *this, DEFINE_THISCALL_WRAPPER(ctype_char_widen_ch, 8) char __thiscall ctype_char_widen_ch(const ctype_char *this, char ch) { - FIXME("(%p %c) stub\n", this, ch); - return 0; + TRACE("(%p %c)\n", this, ch); + return call_ctype_char_do_widen_ch(this, ch); } /* ?widen@?$ctype@D@std@@QBEPBDPBD0PAD@Z */ @@ -1380,8 +1390,8 @@ DEFINE_THISCALL_WRAPPER(ctype_char_widen, 16) const char* __thiscall ctype_char_widen(const ctype_char *this, const char *first, const char *last, char *dest) { - FIXME("(%p %p %p %p) stub\n", this, first, last, dest); - return NULL; + TRACE("(%p %p %p %p)\n", this, first, last, dest); + return call_ctype_char_do_widen(this, first, last, dest); } /* ?_Widen_s@?$ctype@D@std@@QBEPBDPBD0PADI@Z */ @@ -1390,8 +1400,8 @@ DEFINE_THISCALL_WRAPPER(ctype_char__Widen_s, 20) const char* __thiscall ctype_char__Widen_s(const ctype_char *this, const char *first, const char *last, char *dest, MSVCP_size_t size) { - FIXME("(%p %p %p %p %lu) stub\n", this, first, last, dest, size); - return NULL; + TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size); + return call_ctype_char__Do_widen_s(this, first, last, dest, size); } /* ?_Getcat@?$ctype@D@std@@SAIPAPBVfacet@locale@2@PBV42@@Z */
1
0
0
0
Piotr Caban : msvcp90: Added ctype<char>::narrow functions implementation.
by Alexandre Julliard
21 Dec '11
21 Dec '11
Module: wine Branch: master Commit: facb3e3fe6796f8ade8d9d4edc2d5cd99efe797c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=facb3e3fe6796f8ade8d9d4ed…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Dec 21 15:58:19 2011 +0100 msvcp90: Added ctype<char>::narrow functions implementation. --- dlls/msvcp90/locale.c | 36 +++++++++++++++++++++++------------- 1 files changed, 23 insertions(+), 13 deletions(-) diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index bf32d85..1bae73e 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -1271,30 +1271,40 @@ ctype_char* __thiscall MSVCP_ctype_char_vector_dtor(ctype_char *this, unsigned i /* ?do_narrow@?$ctype@D@std@@MBEDDD@Z */ /* ?do_narrow@?$ctype@D@std@@MEBADDD@Z */ DEFINE_THISCALL_WRAPPER(ctype_char_do_narrow_ch, 12) +#define call_ctype_char_do_narrow_ch(this, ch, unused) CALL_VTBL_FUNC(this, 36, \ + char, (const ctype_char*, char, char), (this, ch, unused)) char __thiscall ctype_char_do_narrow_ch(const ctype_char *this, char ch, char unused) { - FIXME("(%p %c %c) stub\n", this, ch, unused); - return 0; + TRACE("(%p %c %c)\n", this, ch, unused); + return ch; } /* ?do_narrow@?$ctype@D@std@@MBEPBDPBD0DPAD@Z */ /* ?do_narrow@?$ctype@D@std@@MEBAPEBDPEBD0DPEAD@Z */ DEFINE_THISCALL_WRAPPER(ctype_char_do_narrow, 20) +#define call_ctype_char_do_narrow(this, first, last, unused, dest) CALL_VTBL_FUNC(this, 32, \ + const char*, (const ctype_char*, const char*, const char*, char, char*), \ + (this, first, last, unused, dest)) const char* __thiscall ctype_char_do_narrow(const ctype_char *this, const char *first, const char *last, char unused, char *dest) { - FIXME("(%p %p %p %p) stub\n", this, first, last, dest); - return NULL; + TRACE("(%p %p %p %p)\n", this, first, last, dest); + memcpy(dest, first, last-first); + return last; } /* ?_Do_narrow_s@?$ctype@D@std@@MBEPBDPBD0DPADI@Z */ /* ?_Do_narrow_s@?$ctype@D@std@@MEBAPEBDPEBD0DPEAD_K@Z */ DEFINE_THISCALL_WRAPPER(ctype_char__Do_narrow_s, 24) +#define call_ctype_char__Do_narrow_s(this, first, last, unused, dest, size) CALL_VTBL_FUNC(this, 40, \ + const char*, (const ctype_char*, const char*, const char*, char, char*, MSVCP_size_t), \ + (this, first, last, unused, dest, size)) const char* __thiscall ctype_char__Do_narrow_s(const ctype_char *this, const char *first, const char *last, char unused, char *dest, MSVCP_size_t size) { - FIXME("(%p %p %p %p %lu) stub\n", this, first, last, dest, size); - return NULL; + TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size); + memcpy_s(dest, size, first, last-first); + return last; } /* ?narrow@?$ctype@D@std@@QBEDDD@Z */ @@ -1302,8 +1312,8 @@ const char* __thiscall ctype_char__Do_narrow_s(const ctype_char *this, const cha DEFINE_THISCALL_WRAPPER(ctype_char_narrow_ch, 12) char __thiscall ctype_char_narrow_ch(const ctype_char *this, char ch, char dflt) { - FIXME("(%p %c %c) stub\n", this, ch, dflt); - return 0; + TRACE("(%p %c %c)\n", this, ch, dflt); + return call_ctype_char_do_narrow_ch(this, ch, dflt); } /* ?narrow@?$ctype@D@std@@QBEPBDPBD0DPAD@Z */ @@ -1312,18 +1322,18 @@ DEFINE_THISCALL_WRAPPER(ctype_char_narrow, 20) const char* __thiscall ctype_char_narrow(const ctype_char *this, const char *first, const char *last, char dflt, char *dest) { - FIXME("(%p %p %p %c %p) stub\n", this, first, last, dflt, dest); - return NULL; + TRACE("(%p %p %p %c %p)\n", this, first, last, dflt, dest); + return call_ctype_char_do_narrow(this, first, last, dflt, dest); } /* ?_Narrow_s@?$ctype@D@std@@QBEPBDPBD0DPADI@Z */ /* ?_Narrow_s@?$ctype@D@std@@QEBAPEBDPEBD0DPEAD_K@Z */ DEFINE_THISCALL_WRAPPER(ctype_char__Narrow_s, 24) const char* __thiscall ctype_char__Narrow_s(const ctype_char *this, const char *first, - const char *last, char unused, char *dest, MSVCP_size_t size) + const char *last, char dflt, char *dest, MSVCP_size_t size) { - FIXME("(%p %p %p %p %lu) stub\n", this, first, last, dest, size); - return NULL; + TRACE("(%p %p %p %p %lu)\n", this, first, last, dest, size); + return call_ctype_char__Do_narrow_s(this, first, last, dflt, dest, size); } /* ?do_widen@?$ctype@D@std@@MBEDD@Z */
1
0
0
0
Piotr Caban : msvcp90: Added ctype<char> constructors implementation.
by Alexandre Julliard
21 Dec '11
21 Dec '11
Module: wine Branch: master Commit: 72d18e01116e81b8c033b9dfdb76a22cf575a995 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=72d18e01116e81b8c033b9dfd…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Dec 21 15:58:03 2011 +0100 msvcp90: Added ctype<char> constructors implementation. --- dlls/msvcp90/locale.c | 60 ++++++++++++++++++++++++++++++++++-------------- 1 files changed, 42 insertions(+), 18 deletions(-) diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index b8c4b11..bf32d85 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -73,7 +73,7 @@ typedef struct { typedef struct { LCID handle; unsigned page; - short *table; + const short *table; int delfl; } _Ctypevec; @@ -477,18 +477,20 @@ _Ctypevec __cdecl _Getctype(void) { _Ctypevec ret; _locale_t locale = _get_current_locale(); + short *table; TRACE("\n"); ret.page = locale->locinfo->lc_codepage; ret.handle = locale->locinfo->lc_handle[LC_COLLATE]; ret.delfl = TRUE; - ret.table = malloc(sizeof(short[256])); - if(!ret.table) { + table = malloc(sizeof(short[256])); + if(!table) { _free_locale(locale); throw_exception(EXCEPTION_BAD_ALLOC, NULL); } - memcpy(ret.table, locale->locinfo->pctype, sizeof(short[256])); + memcpy(table, locale->locinfo->pctype, sizeof(short[256])); + ret.table = table; _free_locale(locale); return ret; } @@ -1156,8 +1158,8 @@ extern const vtable_ptr MSVCP_ctype_char_vtable; /* ?_Id_func@?$ctype@D@std@@SAAEAVid@locale@2@XZ */ locale_id* __cdecl ctype_char__Id_func(void) { - FIXME("() stub\n"); - return NULL; + TRACE("()\n"); + return &ctype_char_id; } /* ?_Init@?$ctype@D@std@@IAEXABV_Locinfo@2@@Z */ @@ -1165,7 +1167,8 @@ locale_id* __cdecl ctype_char__Id_func(void) DEFINE_THISCALL_WRAPPER(ctype_char__Init, 8) void __thiscall ctype_char__Init(ctype_char *this, _Locinfo *locinfo) { - FIXME("(%p %p) stub\n", this, locinfo); + TRACE("(%p %p)\n", this, locinfo); + this->ctype = _Locinfo__Getctype(locinfo); } /* ?_Tidy@?$ctype@D@std@@IAEXXZ */ @@ -1173,15 +1176,18 @@ void __thiscall ctype_char__Init(ctype_char *this, _Locinfo *locinfo) DEFINE_THISCALL_WRAPPER(ctype_char__Tidy, 4) void __thiscall ctype_char__Tidy(ctype_char *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + + if(this->ctype.delfl) + free((short*)this->ctype.table); } /* ?classic_table@?$ctype@D@std@@KAPBFXZ */ /* ?classic_table@?$ctype@D@std@@KAPEBFXZ */ const short* __cdecl ctype_char_classic_table(void) { - FIXME("() stub\n"); - return NULL; + TRACE("()\n"); + return &((short*)GetProcAddress(GetModuleHandleA("msvcrt.dll"), "_ctype"))[1]; } /* ??0?$ctype@D@std@@QAE@ABV_Locinfo@1@I@Z */ @@ -1190,9 +1196,11 @@ DEFINE_THISCALL_WRAPPER(ctype_char_ctor_locinfo, 12) ctype_char* __thiscall ctype_char_ctor_locinfo(ctype_char *this, _Locinfo *locinfo, MSVCP_size_t refs) { - FIXME("(%p %p %lu) stub\n", this, locinfo, refs); + TRACE("(%p %p %lu)\n", this, locinfo, refs); + ctype_base_ctor_refs(&this->base, refs); this->base.facet.vtable = &MSVCP_ctype_char_vtable; - return NULL; + ctype_char__Init(this, locinfo); + return this; } /* ??0?$ctype@D@std@@QAE@PBF_NI@Z */ @@ -1201,9 +1209,26 @@ DEFINE_THISCALL_WRAPPER(ctype_char_ctor_table, 16) ctype_char* __thiscall ctype_char_ctor_table(ctype_char *this, const short *table, MSVCP_bool delete, MSVCP_size_t refs) { - FIXME("(%p %p %d %lu) stub\n", this, table, delete, refs); + _Lockit lockit; + _Locinfo locinfo; + + TRACE("(%p %p %d %lu)\n", this, table, delete, refs); + + ctype_base_ctor_refs(&this->base, refs); this->base.facet.vtable = &MSVCP_ctype_char_vtable; - return NULL; + + _Lockit_ctor_locktype(&lockit, _LOCK_LOCALE); + _Locinfo_ctor(&locinfo); + ctype_char__Init(this, &locinfo); + _Locinfo_dtor(&locinfo); + _Lockit_dtor(&lockit); + + if(table) { + ctype_char__Tidy(this); + this->ctype.table = table; + this->ctype.delfl = delete; + } + return this; } /* ??_F?$ctype@D@std@@QAEXXZ */ @@ -1211,9 +1236,7 @@ ctype_char* __thiscall ctype_char_ctor_table(ctype_char *this, DEFINE_THISCALL_WRAPPER(ctype_char_ctor, 4) ctype_char* __thiscall ctype_char_ctor(ctype_char *this) { - FIXME("(%p) stub\n", this); - this->base.facet.vtable = &MSVCP_ctype_char_vtable; - return NULL; + return ctype_char_ctor_table(this, NULL, FALSE, 0); } /* ??1?$ctype@D@std@@MAE@XZ */ @@ -1221,7 +1244,8 @@ ctype_char* __thiscall ctype_char_ctor(ctype_char *this) DEFINE_THISCALL_WRAPPER(ctype_char_dtor, 4) void __thiscall ctype_char_dtor(ctype_char *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); + ctype_char__Tidy(this); } DEFINE_THISCALL_WRAPPER(MSVCP_ctype_char_vector_dtor, 8)
1
0
0
0
Piotr Caban : msvcp90: Added partial collate<wchar_t> implementation.
by Alexandre Julliard
21 Dec '11
21 Dec '11
Module: wine Branch: master Commit: bb002e27b35bb4d7f5620f97bcebd0745a1b7efe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bb002e27b35bb4d7f5620f97b…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Wed Dec 21 15:57:46 2011 +0100 msvcp90: Added partial collate<wchar_t> implementation. --- dlls/msvcp90/locale.c | 97 ++++++++++++++++++++++++++++++++------------- dlls/msvcp90/msvcp90.spec | 2 +- 2 files changed, 70 insertions(+), 29 deletions(-) diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index 7b0fa5f..b8c4b11 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -833,14 +833,36 @@ extern const vtable_ptr MSVCP_collate_wchar_vtable; /* ??_7?$collate@G@std@@6B@ */ extern const vtable_ptr MSVCP_collate_short_vtable; +/* ?_Init@?$collate@_W@std@@IAEXABV_Locinfo@2@@Z */ +/* ?_Init@?$collate@_W@std@@IEAAXAEBV_Locinfo@2@@Z */ +/* ?_Init@?$collate@G@std@@IAEXABV_Locinfo@2@@Z */ +/* ?_Init@?$collate@G@std@@IEAAXAEBV_Locinfo@2@@Z */ +DEFINE_THISCALL_WRAPPER(collate_wchar__Init, 8) +void __thiscall collate_wchar__Init(collate *this, const _Locinfo *locinfo) +{ + TRACE("(%p %p)\n", this, locinfo); + this->coll = _Locinfo__Getcoll(locinfo); +} + /* ??0?$collate@_W@std@@IAE@PBDI@Z */ /* ??0?$collate@_W@std@@IEAA@PEBD_K@Z */ DEFINE_THISCALL_WRAPPER(collate_wchar_ctor_name, 12) collate* __thiscall collate_wchar_ctor_name(collate *this, const char *name, MSVCP_size_t refs) { - FIXME("(%p %s %lu) stub\n", this, name, refs); + _Lockit lockit; + _Locinfo locinfo; + + TRACE("(%p %s %lu)\n", this, name, refs); + + locale_facet_ctor_refs(&this->facet, refs); this->facet.vtable = &MSVCP_collate_wchar_vtable; - return NULL; + + _Lockit_ctor_locktype(&lockit, _LOCK_LOCALE); + _Locinfo_ctor_cstr(&locinfo, name); + collate_wchar__Init(this, &locinfo); + _Locinfo_dtor(&locinfo); + _Lockit_dtor(&lockit); + return this; } /* ??0?$collate@G@std@@IAE@PBDI@Z */ @@ -858,9 +880,12 @@ collate* __thiscall collate_short_ctor_name(collate *this, const char *name, MSV DEFINE_THISCALL_WRAPPER(collate_wchar_ctor_locinfo, 12) collate* __thiscall collate_wchar_ctor_locinfo(collate *this, _Locinfo *locinfo, MSVCP_size_t refs) { - FIXME("(%p %p %lu) stub\n", this, locinfo, refs); + TRACE("(%p %p %lu)\n", this, locinfo, refs); + + locale_facet_ctor_refs(&this->facet, refs); this->facet.vtable = &MSVCP_collate_wchar_vtable; - return NULL; + collate_wchar__Init(this, locinfo); + return this; } /* ??0?$collate@G@std@@QAE@ABV_Locinfo@1@I@Z */ @@ -878,9 +903,7 @@ collate* __thiscall collate_short_ctor_locinfo(collate *this, _Locinfo *locinfo, DEFINE_THISCALL_WRAPPER(collate_wchar_ctor_refs, 8) collate* __thiscall collate_wchar_ctor_refs(collate *this, MSVCP_size_t refs) { - FIXME("(%p %lu) stub\n", this, refs); - this->facet.vtable = &MSVCP_collate_wchar_vtable; - return NULL; + return collate_wchar_ctor_name(this, "C", refs); } /* ??0?$collate@G@std@@QAE@I@Z */ @@ -900,7 +923,7 @@ collate* __thiscall collate_short_ctor_refs(collate *this, MSVCP_size_t refs) DEFINE_THISCALL_WRAPPER(collate_wchar_dtor, 4) void __thiscall collate_wchar_dtor(collate *this) { - FIXME("(%p) stub\n", this); + TRACE("(%p)\n", this); } DEFINE_THISCALL_WRAPPER(MSVCP_collate_wchar_vector_dtor, 8) @@ -934,9 +957,7 @@ collate* __thiscall MSVCP_collate_short_vector_dtor(collate *this, unsigned int DEFINE_THISCALL_WRAPPER(collate_wchar_ctor, 4) collate* __thiscall collate_wchar_ctor(collate *this) { - FIXME("(%p) stub\n", this); - this->facet.vtable = &MSVCP_collate_wchar_vtable; - return NULL; + return collate_wchar_ctor_name(this, "C", 0); } /* ??_F?$collate@G@std@@QAEXXZ */ @@ -955,18 +976,28 @@ collate* __thiscall collate_short_ctor(collate *this) /* ?_Getcat@?$collate@G@std@@SA_KPEAPEBVfacet@locale@2@PEBV42@@Z */ MSVCP_size_t __cdecl collate_wchar__Getcat(const locale_facet **facet, const locale *loc) { - FIXME("(%p %p) stub\n", facet, loc); - return 0; + TRACE("(%p %p)\n", facet, loc); + + if(facet && !*facet) { + *facet = MSVCRT_operator_new(sizeof(collate)); + if(!*facet) { + ERR("Out of memory\n"); + throw_exception(EXCEPTION_BAD_ALLOC, NULL); + return 0; + } + collate_wchar_ctor_name((collate*)*facet, + MSVCP_basic_string_char_c_str(&loc->ptr->name), 0); + } + + return LC_COLLATE; } -/* ?_Init@?$collate@_W@std@@IAEXABV_Locinfo@2@@Z */ -/* ?_Init@?$collate@_W@std@@IEAAXAEBV_Locinfo@2@@Z */ -/* ?_Init@?$collate@G@std@@IAEXABV_Locinfo@2@@Z */ -/* ?_Init@?$collate@G@std@@IEAAXAEBV_Locinfo@2@@Z */ -DEFINE_THISCALL_WRAPPER(collate_wchar__Init, 8) -void __thiscall collate_wchar__Init(collate *this, const _Locinfo *locinfo) +/* _Wcscoll */ +int __cdecl _Wcscoll(const wchar_t *first1, const wchar_t *last1, const wchar_t *first2, + const wchar_t *last2, const _Collvec *coll) { - FIXME("(%p %p) stub\n", this, locinfo); + TRACE("(%s %s)\n", debugstr_wn(first1, last1-first1), debugstr_wn(first2, last2-first2)); + return CompareStringW(coll->handle, 0, first1, last1-first1, first2, last2-first2)-2; } /* ?do_compare@?$collate@_W@std@@MBEHPB_W000@Z */ @@ -974,11 +1005,14 @@ void __thiscall collate_wchar__Init(collate *this, const _Locinfo *locinfo) /* ?do_compare@?$collate@G@std@@MBEHPBG000@Z */ /* ?do_compare@?$collate@G@std@@MEBAHPEBG000@Z */ DEFINE_THISCALL_WRAPPER(collate_wchar_do_compare, 20) +#define call_collate_wchar_do_compare(this, first1, last1, first2, last2) CALL_VTBL_FUNC(this, 4, int, \ + (const collate*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*), \ + (this, first1, last1, first2, last2)) int __thiscall collate_wchar_do_compare(const collate *this, const wchar_t *first1, const wchar_t *last1, const wchar_t *first2, const wchar_t *last2) { - FIXME("(%p %p %p %p %p) stub\n", this, first1, last1, first2, last2); - return 0; + TRACE("(%p %p %p %p %p)\n", this, first1, last1, first2, last2); + return _Wcscoll(first1, last1, first2, last2, &this->coll); } /* ?compare@?$collate@_W@std@@QBEHPB_W000@Z */ @@ -989,8 +1023,8 @@ DEFINE_THISCALL_WRAPPER(collate_wchar_compare, 20) int __thiscall collate_wchar_compare(const collate *this, const wchar_t *first1, const wchar_t *last1, const wchar_t *first2, const wchar_t *last2) { - FIXME("(%p %p %p %p %p) stub\n", this, first1, last1, first2, last2); - return 0; + TRACE("(%p %p %p %p %p)\n", this, first1, last1, first2, last2); + return call_collate_wchar_do_compare(this, first1, last1, first2, last2); } /* ?do_hash@?$collate@_W@std@@MBEJPB_W0@Z */ @@ -998,11 +1032,18 @@ int __thiscall collate_wchar_compare(const collate *this, const wchar_t *first1, /* ?do_hash@?$collate@G@std@@MBEJPBG0@Z */ /* ?do_hash@?$collate@G@std@@MEBAJPEBG0@Z */ DEFINE_THISCALL_WRAPPER(collate_wchar_do_hash, 12) +#define call_collate_wchar_do_hash(this, first, last) CALL_VTBL_FUNC(this, 12, LONG, \ + (const collate*, const wchar_t*, const wchar_t*), (this, first, last)) LONG __thiscall collate_wchar_do_hash(const collate *this, const wchar_t *first, const wchar_t *last) { - FIXME("(%p %p %p) stub\n", this, first, last); - return 0; + ULONG ret = 0; + + TRACE("(%p %p %p)\n", this, first, last); + + for(; first<last; first++) + ret = (ret<<8 | ret>>24) + *first; + return ret; } /* ?hash@?$collate@_W@std@@QBEJPB_W0@Z */ @@ -1013,8 +1054,8 @@ DEFINE_THISCALL_WRAPPER(collate_wchar_hash, 12) LONG __thiscall collate_wchar_hash(const collate *this, const wchar_t *first, const wchar_t *last) { - FIXME("(%p %p %p) stub\n", this, first, last); - return 0; + TRACE("(%p %p %p)\n", this, first, last); + return call_collate_wchar_do_hash(this, first, last); } /* ?do_transform@?$collate@_W@std@@MBE?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@PB_W0@Z */ diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec index 687bacc..f53b579 100644 --- a/dlls/msvcp90/msvcp90.spec +++ b/dlls/msvcp90/msvcp90.spec @@ -5803,7 +5803,7 @@ @ stub _Towlower @ stub _Towupper @ stub _Wcrtomb -@ stub _Wcscoll +@ cdecl _Wcscoll(ptr ptr ptr ptr ptr) @ stub _Wcsxfrm # extern _Xbig @ stub __Wcrtomb_lk
1
0
0
0
Rico Schüller : d3dx9/tests: Add effect parameter value GetIntArray() test.
by Alexandre Julliard
21 Dec '11
21 Dec '11
Module: wine Branch: master Commit: 5341b5518bc3a0526c5044bcb2dd5752c5876df5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5341b5518bc3a0526c5044bcb…
Author: Rico Schüller <kgbricola(a)web.de> Date: Wed Dec 21 15:03:05 2011 +0100 d3dx9/tests: Add effect parameter value GetIntArray() test. --- dlls/d3dx9_36/tests/effect.c | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index 0fbe980..54d6a25 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -646,6 +646,48 @@ static void test_effect_parameter_value_GetInt(const struct test_effect_paramete } } +static void test_effect_parameter_value_GetIntArray(const struct test_effect_parameter_value_result *res, + ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i) +{ + const D3DXPARAMETER_DESC *res_desc = &res->desc; + LPCSTR res_full_name = res->full_name; + INT iavalue[EFFECT_PARAMETER_VALUE_ARRAY_SIZE]; + HRESULT hr; + UINT l; + + memset(iavalue, 0xab, sizeof(iavalue)); + hr = effect->lpVtbl->GetIntArray(effect, parameter, iavalue, res_desc->Bytes / sizeof(*iavalue)); + if (res_desc->Class == D3DXPC_SCALAR + || res_desc->Class == D3DXPC_VECTOR + || res_desc->Class == D3DXPC_MATRIX_ROWS) + { + ok(hr == D3D_OK, "%u - %s: GetIntArray failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK); + + for (l = 0; l < res_desc->Bytes / sizeof(*iavalue); ++l) + { + ok(iavalue[l] == get_int(res_desc->Type, &res_value[l]), "%u - %s: GetIntArray iavalue[%u] failed, got %i, expected %i\n", + i, res_full_name, l, iavalue[l], get_int(res_desc->Type, &res_value[l])); + } + + for (l = res_desc->Bytes / sizeof(*iavalue); l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) + { + ok(iavalue[l] == 0xabababab, "%u - %s: GetIntArray iavalue[%u] failed, got %i, expected %i\n", + i, res_full_name, l, iavalue[l], 0xabababab); + } + } + else + { + ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetIntArray failed, got %#x, expected %#x\n", + i, res_full_name, hr, D3DERR_INVALIDCALL); + + for (l = 0; l < EFFECT_PARAMETER_VALUE_ARRAY_SIZE; ++l) + { + ok(iavalue[l] == 0xabababab, "%u - %s: GetIntArray iavalue[%u] failed, got %i, expected %i\n", + i, res_full_name, l, iavalue[l], 0xabababab); + } + } +} + static void test_effect_parameter_value(IDirect3DDevice9 *device) { UINT i; @@ -719,6 +761,7 @@ static void test_effect_parameter_value(IDirect3DDevice9 *device) test_effect_parameter_value_GetBool(&res[k], effect, &blob[res_value_offset], parameter, i); test_effect_parameter_value_GetBoolArray(&res[k], effect, &blob[res_value_offset], parameter, i); test_effect_parameter_value_GetInt(&res[k], effect, &blob[res_value_offset], parameter, i); + test_effect_parameter_value_GetIntArray(&res[k], effect, &blob[res_value_offset], parameter, i); } count = effect->lpVtbl->Release(effect);
1
0
0
0
Rico Schüller : d3dx9/tests: Add effect parameter value GetInt() test.
by Alexandre Julliard
21 Dec '11
21 Dec '11
Module: wine Branch: master Commit: d984a524e7ceacca522fab8e62a754169d6ab18f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d984a524e7ceacca522fab8e6…
Author: Rico Schüller <kgbricola(a)web.de> Date: Wed Dec 21 15:03:00 2011 +0100 d3dx9/tests: Add effect parameter value GetInt() test. --- dlls/d3dx9_36/tests/effect.c | 73 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 73 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index 517a7de..0fbe980 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -22,6 +22,33 @@ #include "d3dx9.h" /* helper functions */ +static inline INT get_int(D3DXPARAMETER_TYPE type, LPCVOID data) +{ + INT i; + + switch (type) + { + case D3DXPT_FLOAT: + i = *(FLOAT *)data; + break; + + case D3DXPT_INT: + i = *(INT *)data; + break; + + case D3DXPT_BOOL: + i = *(BOOL *)data; + break; + + default: + i = 0; + ok(0, "Unhandled type %x.\n", type); + break; + } + + return i; +} + static inline BOOL get_bool(LPCVOID data) { return (*(BOOL *)data) ? TRUE : FALSE; @@ -465,6 +492,8 @@ test_effect_parameter_value_data[] = #undef ADD_PARAMETER_VALUE #define EFFECT_PARAMETER_VALUE_ARRAY_SIZE 48 +/* Constants for special INT/FLOAT conversation */ +#define INT_FLOAT_MULTI 255.0f static void test_effect_parameter_value_GetValue(const struct test_effect_parameter_value_result *res, ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i) @@ -574,6 +603,49 @@ static void test_effect_parameter_value_GetBoolArray(const struct test_effect_pa } } +static void test_effect_parameter_value_GetInt(const struct test_effect_parameter_value_result *res, + ID3DXEffect *effect, const DWORD *res_value, D3DXHANDLE parameter, UINT i) +{ + const D3DXPARAMETER_DESC *res_desc = &res->desc; + LPCSTR res_full_name = res->full_name; + INT ivalue = 0xabababab; + HRESULT hr; + + hr = effect->lpVtbl->GetInt(effect, parameter, &ivalue); + if (!res_desc->Elements && res_desc->Columns == 1 && res_desc->Rows == 1) + { + ok(hr == D3D_OK, "%u - %s: GetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK); + ok(ivalue == get_int(res_desc->Type, res_value), "%u - %s: GetInt ivalue failed, got %i, expected %i\n", + i, res_full_name, ivalue, get_int(res_desc->Type, res_value)); + } + else if(!res_desc->Elements && res_desc->Type == D3DXPT_FLOAT && + ((res_desc->Class == D3DXPC_VECTOR && res_desc->Columns != 2) || + (res_desc->Class == D3DXPC_MATRIX_ROWS && res_desc->Rows != 2 && res_desc->Columns == 1))) + { + INT tmp; + + ok(hr == D3D_OK, "%u - %s: GetInt failed, got %#x, expected %#x\n", i, res_full_name, hr, D3D_OK); + + tmp = (INT)(min(max(0.0f, *((FLOAT *)res_value + 2)), 1.0f) * INT_FLOAT_MULTI); + tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 1)), 1.0f) * INT_FLOAT_MULTI)) << 8; + tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 0)), 1.0f) * INT_FLOAT_MULTI)) << 16; + if (res_desc->Columns * res_desc->Rows > 3) + { + tmp += ((INT)(min(max(0.0f, *((FLOAT *)res_value + 3)), 1.0f) * INT_FLOAT_MULTI)) << 24; + } + + ok(ivalue == tmp, "%u - %s: GetInt ivalue failed, got %x, expected %x\n", + i, res_full_name, ivalue, tmp); + } + else + { + ok(hr == D3DERR_INVALIDCALL, "%u - %s: GetInt failed, got %#x, expected %#x\n", + i, res_full_name, hr, D3DERR_INVALIDCALL); + ok(ivalue == 0xabababab, "%u - %s: GetInt ivalue failed, got %i, expected %i\n", + i, res_full_name, ivalue, 0xabababab); + } +} + static void test_effect_parameter_value(IDirect3DDevice9 *device) { UINT i; @@ -646,6 +718,7 @@ static void test_effect_parameter_value(IDirect3DDevice9 *device) test_effect_parameter_value_GetValue(&res[k], effect, &blob[res_value_offset], parameter, i); test_effect_parameter_value_GetBool(&res[k], effect, &blob[res_value_offset], parameter, i); test_effect_parameter_value_GetBoolArray(&res[k], effect, &blob[res_value_offset], parameter, i); + test_effect_parameter_value_GetInt(&res[k], effect, &blob[res_value_offset], parameter, i); } count = effect->lpVtbl->Release(effect);
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
81
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Results per page:
10
25
50
100
200