diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 0729f3035a0..c57b43df988 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1604,7 +1604,7 @@ @ cdecl _wtoi(wstr) msvcrt._wtoi @ cdecl -ret64 _wtoi64(wstr) msvcrt._wtoi64 @ stub _wtoi64_l -@ stub _wtoi_l +@ cdecl _wtoi_l(wstr ptr) msvcrt._wtoi_l @ cdecl _wtol(wstr) msvcrt._wtol @ stub _wtol_l @ cdecl _wunlink(wstr) msvcrt._wunlink diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index bd1e86a151b..8c537516081 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -1268,7 +1268,7 @@ @ cdecl _wtoi(wstr) msvcrt._wtoi @ cdecl -ret64 _wtoi64(wstr) msvcrt._wtoi64 @ stub _wtoi64_l -@ stub _wtoi_l +@ cdecl _wtoi_l(wstr ptr) msvcrt._wtoi_l @ cdecl _wtol(wstr) msvcrt._wtol @ stub _wtol_l @ cdecl _wunlink(wstr) msvcrt._wunlink diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 2453e6f97af..500ed276827 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -1259,7 +1259,7 @@ @ cdecl _wtoi(wstr) msvcrt._wtoi @ cdecl -ret64 _wtoi64(wstr) msvcrt._wtoi64 @ stub _wtoi64_l -@ stub _wtoi_l +@ cdecl _wtoi_l(wstr ptr) msvcrt._wtoi_l @ cdecl _wtol(wstr) msvcrt._wtol @ stub _wtol_l @ cdecl _wunlink(wstr) msvcrt._wunlink diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index ecf44fd06d8..239e8201d73 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -1199,7 +1199,7 @@ @ cdecl _wtoi(wstr) ntdll._wtoi @ cdecl -ret64 _wtoi64(wstr) ntdll._wtoi64 # stub -ret64 _wtoi64_l(wstr ptr) -# stub _wtoi_l(wstr ptr) +@ cdecl _wtoi_l(wstr ptr) MSVCRT__wtoi_l @ cdecl _wtol(wstr) ntdll._wtol # stub _wtol_l(wstr ptr) @ cdecl _wunlink(wstr) MSVCRT__wunlink diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 555e63a1e2e..cc489689eec 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -1437,6 +1437,23 @@ __int64 CDECL MSVCRT__wcstoi64(const MSVCRT_wchar_t *nptr, return MSVCRT__wcstoi64_l(nptr, endptr, base, NULL); } +/********************************************************************* + * _wtoi_l (MSVCRT.@) + */ +int MSVCRT__wtoi_l(const MSVCRT_wchar_t *str, MSVCRT__locale_t locale) +{ + __int64 ret = MSVCRT__wcstoi64_l(str, NULL, 10, locale); + + if(ret > INT_MAX) { + ret = INT_MAX; + *MSVCRT__errno() = MSVCRT_ERANGE; + } else if(ret < INT_MIN) { + ret = INT_MIN; + *MSVCRT__errno() = MSVCRT_ERANGE; + } + return ret; +} + /********************************************************************* * _wcstoui64_l (MSVCRT.@) *