ntdll: Avoid using atoiW().

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-03-30 12:09:49 +02:00
parent 186f189107
commit 8f3d869d78
3 changed files with 9 additions and 8 deletions

View File

@ -3141,10 +3141,10 @@ static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai )
else data_pos = data_len;
tmp = dir_info->FileName + (strchrW(lookup, '*') - lookup);
build = atoiW(tmp);
build = wcstoul( tmp, NULL, 10 );
if (build < min_build) continue;
tmp = strchrW(tmp, '.') + 1;
revision = atoiW(tmp);
revision = wcstoul( tmp, NULL, 10 );
if (build == min_build && revision < min_revision) continue;
tmp = strchrW(tmp, '_') + 1;
tmp = strchrW(tmp, '_') + 1;

View File

@ -301,6 +301,7 @@ ULONG __cdecl NTDLL_wcstoul( LPCWSTR s, LPWSTR *end, INT base );
#define towupper(c) NTDLL_towupper(c)
#define wcslwr(s) NTDLL__wcslwr(s)
#define wcsupr(s) NTDLL__wcsupr(s)
#define wcstoul(s,e,b) NTDLL_wcstoul(s,e,b)
/* convert from straight ASCII to Unicode without depending on the current codepage */
static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len )

View File

@ -285,9 +285,9 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
if (p)
{
*p++ = 0;
version->dwMinorVersion = atoiW( p );
version->dwMinorVersion = wcstoul( p, NULL, 10 );
}
version->dwMajorVersion = atoiW( str );
version->dwMajorVersion = wcstoul( str, NULL, 10 );
}
if (version->dwMajorVersion) /* we got the main version, now fetch the other fields */
@ -302,7 +302,7 @@ static BOOL get_nt_registry_version( RTL_OSVERSIONINFOEXW *version )
{
WCHAR *str = (WCHAR *)info->Data;
str[info->DataLength / sizeof(WCHAR)] = 0;
version->dwBuildNumber = atoiW( str );
version->dwBuildNumber = wcstoul( str, NULL, 10 );
}
/* get version description */
@ -400,7 +400,7 @@ static BOOL get_win9x_registry_version( RTL_OSVERSIONINFOEXW *version )
str[info->DataLength / sizeof(WCHAR)] = 0;
p = strchrW( str, '.' );
if (p) *p++ = 0;
version->dwMajorVersion = atoiW( str );
version->dwMajorVersion = wcstoul( str, NULL, 10 );
if (p)
{
str = p;
@ -408,9 +408,9 @@ static BOOL get_win9x_registry_version( RTL_OSVERSIONINFOEXW *version )
if (p)
{
*p++ = 0;
version->dwBuildNumber = atoiW( p );
version->dwBuildNumber = wcstoul( p, NULL, 10 );
}
version->dwMinorVersion = atoiW( str );
version->dwMinorVersion = wcstoul( str, NULL, 10 );
}
/* build number contains version too on Win9x */
version->dwBuildNumber |= MAKEWORD( version->dwMinorVersion, version->dwMajorVersion ) << 16;