As opposed to _to{lower,upper}() i.e. the broken-by-design version.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/ucrtbase/ucrtbase.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index a262cc63459..8987134d97f 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -1806,8 +1806,8 @@ @ stub _o_tgammal @ stub _o_tmpfile_s @ stub _o_tmpnam_s -@ cdecl _o_tolower(long) MSVCRT__tolower -@ cdecl _o_toupper(long) MSVCRT__toupper +@ cdecl _o_tolower(long) MSVCRT_tolower +@ cdecl _o_toupper(long) MSVCRT_toupper @ stub _o_towlower @ stub _o_towupper @ stub _o_ungetc
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- Together with the previous patch this fixes some crashes reproduced with Heroes of the Storm.
I don't know if the function is actually exported on ARM...
.../api-ms-win-crt-private-l1-1-0.spec | 4 ++-- dlls/ucrtbase/ucrtbase.spec | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec index 7e2717c44ab..1870c738b5f 100644 --- a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec +++ b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec @@ -957,8 +957,8 @@ @ stub _o_fma @ stub _o_fmaf @ stub _o_fmal -@ stub _o_fmod -@ stub _o_fmodf +@ cdecl _o_fmod(double double) ucrtbase._o_fmod +@ cdecl -arch=arm,x86_64,arm64 _o_fmodf(float float) ucrtbase._o_fmodf @ stub _o_fopen @ stub _o_fopen_s @ stub _o_fputc diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 8987134d97f..39d050917d7 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -1621,8 +1621,8 @@ @ stub _o_fma @ stub _o_fmaf @ stub _o_fmal -@ stub _o_fmod -@ stub _o_fmodf +@ cdecl _o_fmod(double double) MSVCRT_fmod +@ cdecl -arch=arm,x86_64,arm64 _o_fmodf(float float) MSVCRT_fmodf @ stub _o_fopen @ stub _o_fopen_s @ stub _o_fputc
On Thu, 9 Jan 2020, Matteo Bruni wrote:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Together with the previous patch this fixes some crashes reproduced with Heroes of the Storm.
I don't know if the function is actually exported on ARM...
Yes, both _o_fmod() and _o_fmodf() are exported from ucrtbase.dll on both ARM and ARM64.
// Martin
On Thu, Jan 9, 2020 at 11:14 PM Martin Storsjö martin@martin.st wrote:
On Thu, 9 Jan 2020, Matteo Bruni wrote:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
Together with the previous patch this fixes some crashes reproduced with Heroes of the Storm.
I don't know if the function is actually exported on ARM...
Yes, both _o_fmod() and _o_fmodf() are exported from ucrtbase.dll on both ARM and ARM64.
// Martin
Cool, thanks!
Hi Matteo,
On 09/01/2020 23:03, Matteo Bruni wrote:
-@ stub _o_fmod -@ stub _o_fmodf +@ cdecl _o_fmod(double double) MSVCRT_fmod +@ cdecl -arch=arm,x86_64,arm64 _o_fmodf(float float) MSVCRT_fmodf
We have !i386 for that now.
Thanks,
Jacek
On Fri, Jan 10, 2020 at 12:11 AM Jacek Caban jacek@codeweavers.com wrote:
Hi Matteo,
On 09/01/2020 23:03, Matteo Bruni wrote:
-@ stub _o_fmod -@ stub _o_fmodf +@ cdecl _o_fmod(double double) MSVCRT_fmod +@ cdecl -arch=arm,x86_64,arm64 _o_fmodf(float float) MSVCRT_fmodf
We have !i386 for that now.
Good point, I think when I originally wrote the patch I was working off a branch that didn't have that feature yet.
I'll resend.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/ucrtbase/tests/string.c | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+)
diff --git a/dlls/ucrtbase/tests/string.c b/dlls/ucrtbase/tests/string.c index c18b5483aaa..7a2cf06a903 100644 --- a/dlls/ucrtbase/tests/string.c +++ b/dlls/ucrtbase/tests/string.c @@ -73,8 +73,14 @@ static double (__cdecl *p_strtod)(const char*, char** end); static int (__cdecl *p__memicmp)(const char*, const char*, size_t); static int (__cdecl *p__memicmp_l)(const char*, const char*, size_t,_locale_t); static size_t (__cdecl *p___strncnt)(const char*, size_t); +static int (__cdecl *p_tolower)(int); +static int (__cdecl *p__tolower)(int); +static int (__cdecl *p__o_tolower)(int); static int (__cdecl *p_towlower)(wint_t); static int (__cdecl *p__towlower_l)(wint_t, _locale_t); +static int (__cdecl *p_toupper)(int); +static int (__cdecl *p__toupper)(int); +static int (__cdecl *p__o_toupper)(int); static int (__cdecl *p_towupper)(wint_t); static int (__cdecl *p__towupper_l)(wint_t, _locale_t); static char* (__cdecl *p_setlocale)(int, const char*); @@ -100,8 +106,14 @@ static BOOL init(void) p__memicmp = (void*)GetProcAddress(module, "_memicmp"); p__memicmp_l = (void*)GetProcAddress(module, "_memicmp_l"); p___strncnt = (void*)GetProcAddress(module, "__strncnt"); + p_tolower = (void*)GetProcAddress(module, "tolower"); + p__tolower = (void*)GetProcAddress(module, "_tolower"); + p__o_tolower = (void*)GetProcAddress(module, "_o_tolower"); p_towlower = (void*)GetProcAddress(module, "towlower"); p__towlower_l = (void*)GetProcAddress(module, "_towlower_l"); + p_toupper = (void*)GetProcAddress(module, "toupper"); + p__toupper = (void*)GetProcAddress(module, "_toupper"); + p__o_toupper = (void*)GetProcAddress(module, "_o_toupper"); p_towupper = (void*)GetProcAddress(module, "towupper"); p__towupper_l = (void*)GetProcAddress(module, "_towupper_l"); p_setlocale = (void*)GetProcAddress(module, "setlocale"); @@ -320,6 +332,28 @@ static void test_C_locale(void) p_setlocale(LC_ALL, "C"); for (i = 0; i <= 0xffff; i++) { + ret = p_tolower(i); + if (i >= 'A' && i <= 'Z') + { + exp = i + 'a' - 'A'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + } + else + ok(ret == i, "expected self %x, got %x for C locale\n", i, ret); + + ret = p__tolower(i); + exp = i + 'a' - 'A'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + + ret = p__o_tolower(i); + if (i >= 'A' && i <= 'Z') + { + exp = i + 'a' - 'A'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + } + else + ok(ret == i, "expected self %x, got %x for C locale\n", i, ret); + ret = p_towlower(i); if (i >= 'A' && i <= 'Z') { @@ -329,6 +363,28 @@ static void test_C_locale(void) else ok(ret == i, "expected self %x, got %x for C locale\n", i, ret);
+ ret = p_toupper(i); + if (i >= 'a' && i <= 'z') + { + exp = i + 'A' - 'a'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + } + else + ok(ret == i, "expected self %x, got %x for C locale\n", i, ret); + + ret = p__toupper(i); + exp = i + 'A' - 'a'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + + ret = p__o_toupper(i); + if (i >= 'a' && i <= 'z') + { + exp = i + 'A' - 'a'; + ok(ret == exp, "expected %x, got %x for C locale\n", exp, ret); + } + else + ok(ret == i, "expected self %x, got %x for C locale\n", i, ret); + ret = p_towupper(i); if (i >= 'a' && i <= 'z') {
Signed-off-by: Piotr Caban piotr@codeweavers.com