diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index cd17c6c1352..d53ddf86949 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -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; diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index fe0d1755d0b..ccb2e76c200 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -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 ) diff --git a/dlls/ntdll/version.c b/dlls/ntdll/version.c index 4994dbbb5e5..e5fb63e7782 100644 --- a/dlls/ntdll/version.c +++ b/dlls/ntdll/version.c @@ -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;