From 8f9b0abf729f610310f3fd0308386554a2b57297 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Wed, 27 Mar 2013 16:13:21 +0100 Subject: [PATCH] msvcrt: Added _wcstoul_l implementation. --- dlls/msvcrt/msvcrt.spec | 4 ++-- dlls/msvcrt/wcs.c | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index c992f7f6206..1236b58b032 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -1124,7 +1124,7 @@ @ cdecl _wcstombs_s_l(ptr ptr long wstr long ptr) MSVCRT__wcstombs_s_l @ cdecl -ret64 _wcstoui64(wstr ptr long) MSVCRT__wcstoui64 @ cdecl -ret64 _wcstoui64_l(wstr ptr long ptr) MSVCRT__wcstoui64_l -# stub _wcstoul_l(wstr ptr long ptr) +@ cdecl _wcstoul_l(wstr ptr long ptr) MSVCRT__wcstoul_l @ cdecl _wcsupr(wstr) ntdll._wcsupr # stub _wcsupr_l(wstr ptr) @ cdecl _wcsupr_s(wstr long) MSVCRT__wcsupr_s @@ -1501,7 +1501,7 @@ @ cdecl wcstol(wstr ptr long) ntdll.wcstol @ cdecl wcstombs(ptr ptr long) MSVCRT_wcstombs @ cdecl wcstombs_s(ptr ptr long wstr long) MSVCRT_wcstombs_s -@ cdecl wcstoul(wstr ptr long) ntdll.wcstoul +@ cdecl wcstoul(wstr ptr long) MSVCRT_wcstoul @ stub wcsxfrm(ptr wstr long) @ cdecl wctob(long) MSVCRT_wctob @ cdecl wctomb(ptr long) MSVCRT_wctomb diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 6e7c4790bf4..7408beccefb 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -1586,6 +1586,29 @@ unsigned __int64 CDECL MSVCRT__wcstoui64(const MSVCRT_wchar_t *nptr, return MSVCRT__wcstoui64_l(nptr, endptr, base, NULL); } +/********************************************************************* + * _wcstoul_l (MSVCRT.@) + */ +MSVCRT_ulong __cdecl MSVCRT__wcstoul_l(const MSVCRT_wchar_t *s, + MSVCRT_wchar_t **end, int base, MSVCRT__locale_t locale) +{ + __int64 ret = MSVCRT__wcstoui64_l(s, end, base, locale); + + if(ret > MSVCRT_ULONG_MAX) { + ret = MSVCRT_ULONG_MAX; + *MSVCRT__errno() = MSVCRT_ERANGE; + } + return ret; +} + +/********************************************************************* + * wcstoul (MSVCRT.@) + */ +MSVCRT_ulong __cdecl MSVCRT_wcstoul(const MSVCRT_wchar_t *s, MSVCRT_wchar_t **end, int base) +{ + return MSVCRT__wcstoul_l(s, end, base, NULL); +} + /****************************************************************** * wcsnlen (MSVCRT.@) */