This fixes LLVM ASAN an the ASAN then works as expected with Wine. Would something like this be acceptable for upstream?
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50993 Signed-off-by: Roman Pišl rpisl@seznam.cz --- dlls/msvcrt/string.c | 206 +++++++++++++++++++++---------------------- 1 file changed, 103 insertions(+), 103 deletions(-)
diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index d92b7a38d12..c5a8f834705 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -40,7 +40,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); * _mbsdup (MSVCRT.@) * _strdup (MSVCRT.@) */ -char* CDECL _strdup(const char* str) +char* CDECL DECLSPEC_HOTPATCH _strdup(const char* str) { if(str) { @@ -54,7 +54,7 @@ char* CDECL _strdup(const char* str) /********************************************************************* * _strlwr_s_l (MSVCRT.@) */ -int CDECL _strlwr_s_l(char *str, size_t len, _locale_t locale) +int CDECL DECLSPEC_HOTPATCH _strlwr_s_l(char *str, size_t len, _locale_t locale) { pthreadlocinfo locinfo; char *ptr = str; @@ -107,7 +107,7 @@ int CDECL _strlwr_s_l(char *str, size_t len, _locale_t locale) /********************************************************************* * _strlwr_s (MSVCRT.@) */ -int CDECL _strlwr_s(char *str, size_t len) +int CDECL DECLSPEC_HOTPATCH _strlwr_s(char *str, size_t len) { return _strlwr_s_l(str, len, NULL); } @@ -115,7 +115,7 @@ int CDECL _strlwr_s(char *str, size_t len) /********************************************************************* * _strlwr_l (MSVCRT.@) */ -char* CDECL _strlwr_l(char *str, _locale_t locale) +char* CDECL DECLSPEC_HOTPATCH _strlwr_l(char *str, _locale_t locale) { _strlwr_s_l(str, -1, locale); return str; @@ -124,7 +124,7 @@ char* CDECL _strlwr_l(char *str, _locale_t locale) /********************************************************************* * _strlwr (MSVCRT.@) */ -char* CDECL _strlwr(char *str) +char* CDECL DECLSPEC_HOTPATCH _strlwr(char *str) { _strlwr_s_l(str, -1, NULL); return str; @@ -133,7 +133,7 @@ char* CDECL _strlwr(char *str) /********************************************************************* * _strupr_s_l (MSVCRT.@) */ -int CDECL _strupr_s_l(char *str, size_t len, _locale_t locale) +int CDECL DECLSPEC_HOTPATCH _strupr_s_l(char *str, size_t len, _locale_t locale) { pthreadlocinfo locinfo; char *ptr = str; @@ -186,7 +186,7 @@ int CDECL _strupr_s_l(char *str, size_t len, _locale_t locale) /********************************************************************* * _strupr_s (MSVCRT.@) */ -int CDECL _strupr_s(char *str, size_t len) +int CDECL DECLSPEC_HOTPATCH _strupr_s(char *str, size_t len) { return _strupr_s_l(str, len, NULL); } @@ -194,7 +194,7 @@ int CDECL _strupr_s(char *str, size_t len) /********************************************************************* * _strupr_l (MSVCRT.@) */ -char* CDECL _strupr_l(char *str, _locale_t locale) +char* CDECL DECLSPEC_HOTPATCH _strupr_l(char *str, _locale_t locale) { _strupr_s_l(str, -1, locale); return str; @@ -203,7 +203,7 @@ char* CDECL _strupr_l(char *str, _locale_t locale) /********************************************************************* * _strupr (MSVCRT.@) */ -char* CDECL _strupr(char *str) +char* CDECL DECLSPEC_HOTPATCH _strupr(char *str) { _strupr_s_l(str, -1, NULL); return str; @@ -212,7 +212,7 @@ char* CDECL _strupr(char *str) /********************************************************************* * _strnset_s (MSVCRT.@) */ -int CDECL _strnset_s(char *str, size_t size, int c, size_t count) +int CDECL DECLSPEC_HOTPATCH _strnset_s(char *str, size_t size, int c, size_t count) { size_t i;
@@ -236,7 +236,7 @@ int CDECL _strnset_s(char *str, size_t size, int c, size_t count) /********************************************************************* * _strnset (MSVCRT.@) */ -char* CDECL _strnset(char* str, int value, size_t len) +char* CDECL DECLSPEC_HOTPATCH _strnset(char* str, int value, size_t len) { if (len > 0 && str) while (*str && len--) @@ -247,7 +247,7 @@ char* CDECL _strnset(char* str, int value, size_t len) /********************************************************************* * _strrev (MSVCRT.@) */ -char* CDECL _strrev(char* str) +char* CDECL DECLSPEC_HOTPATCH _strrev(char* str) { char * p1; char * p2; @@ -266,7 +266,7 @@ char* CDECL _strrev(char* str) /********************************************************************* * _strset (MSVCRT.@) */ -char* CDECL _strset(char* str, int value) +char* CDECL DECLSPEC_HOTPATCH _strset(char* str, int value) { char *ptr = str; while (*ptr) @@ -278,7 +278,7 @@ char* CDECL _strset(char* str, int value) /********************************************************************* * strtok (MSVCRT.@) */ -char * CDECL strtok( char *str, const char *delim ) +char * CDECL DECLSPEC_HOTPATCH strtok( char *str, const char *delim ) { thread_data_t *data = msvcrt_get_thread_data(); char *ret; @@ -302,7 +302,7 @@ char * CDECL strtok( char *str, const char *delim ) /********************************************************************* * strtok_s (MSVCRT.@) */ -char * CDECL strtok_s(char *str, const char *delim, char **ctx) +char * CDECL DECLSPEC_HOTPATCH strtok_s(char *str, const char *delim, char **ctx) { if (!MSVCRT_CHECK_PMT(delim != NULL)) return NULL; if (!MSVCRT_CHECK_PMT(ctx != NULL)) return NULL; @@ -331,7 +331,7 @@ char * CDECL strtok_s(char *str, const char *delim, char **ctx) /********************************************************************* * _swab (MSVCRT.@) */ -void CDECL _swab(char* src, char* dst, int len) +void CDECL DECLSPEC_HOTPATCH _swab(char* src, char* dst, int len) { if (len > 1) { @@ -1045,7 +1045,7 @@ static inline double strtod_helper(const char *str, char **end, _locale_t locale /********************************************************************* * _strtod_l (MSVCRT.@) */ -double CDECL _strtod_l(const char *str, char **end, _locale_t locale) +double CDECL DECLSPEC_HOTPATCH _strtod_l(const char *str, char **end, _locale_t locale) { return strtod_helper(str, end, locale, NULL); } @@ -1053,7 +1053,7 @@ double CDECL _strtod_l(const char *str, char **end, _locale_t locale) /********************************************************************* * strtod (MSVCRT.@) */ -double CDECL strtod( const char *str, char **end ) +double CDECL DECLSPEC_HOTPATCH strtod( const char *str, char **end ) { return _strtod_l( str, end, NULL ); } @@ -1063,7 +1063,7 @@ double CDECL strtod( const char *str, char **end ) /********************************************************************* * strtof_l (MSVCR120.@) */ -float CDECL _strtof_l( const char *str, char **end, _locale_t locale ) +float CDECL DECLSPEC_HOTPATCH _strtof_l( const char *str, char **end, _locale_t locale ) { double ret = _strtod_l(str, end, locale); if (ret && isfinite(ret)) { @@ -1077,7 +1077,7 @@ float CDECL _strtof_l( const char *str, char **end, _locale_t locale ) /********************************************************************* * strtof (MSVCR120.@) */ -float CDECL strtof( const char *str, char **end ) +float CDECL DECLSPEC_HOTPATCH strtof( const char *str, char **end ) { return _strtof_l(str, end, NULL); } @@ -1087,7 +1087,7 @@ float CDECL strtof( const char *str, char **end ) /********************************************************************* * atof (MSVCRT.@) */ -double CDECL atof( const char *str ) +double CDECL DECLSPEC_HOTPATCH atof( const char *str ) { return _strtod_l(str, NULL, NULL); } @@ -1095,7 +1095,7 @@ double CDECL atof( const char *str ) /********************************************************************* * _atof_l (MSVCRT.@) */ -double CDECL _atof_l( const char *str, _locale_t locale) +double CDECL DECLSPEC_HOTPATCH _atof_l( const char *str, _locale_t locale) { return _strtod_l(str, NULL, locale); } @@ -1103,7 +1103,7 @@ double CDECL _atof_l( const char *str, _locale_t locale) /********************************************************************* * _atoflt_l (MSVCRT.@) */ -int CDECL _atoflt_l(_CRT_FLOAT *value, char *str, _locale_t locale) +int CDECL DECLSPEC_HOTPATCH _atoflt_l(_CRT_FLOAT *value, char *str, _locale_t locale) { double d; int err; @@ -1120,7 +1120,7 @@ int CDECL _atoflt_l(_CRT_FLOAT *value, char *str, _locale_t locale) /********************************************************************* * _atoflt (MSVCR100.@) */ -int CDECL _atoflt(_CRT_FLOAT *value, char *str) +int CDECL DECLSPEC_HOTPATCH _atoflt(_CRT_FLOAT *value, char *str) { return _atoflt_l(value, str, NULL); } @@ -1128,7 +1128,7 @@ int CDECL _atoflt(_CRT_FLOAT *value, char *str) /********************************************************************* * _atodbl_l (MSVCRT.@) */ -int CDECL _atodbl_l(_CRT_DOUBLE *value, char *str, _locale_t locale) +int CDECL DECLSPEC_HOTPATCH _atodbl_l(_CRT_DOUBLE *value, char *str, _locale_t locale) { int err;
@@ -1143,7 +1143,7 @@ int CDECL _atodbl_l(_CRT_DOUBLE *value, char *str, _locale_t locale) /********************************************************************* * _atodbl (MSVCRT.@) */ -int CDECL _atodbl(_CRT_DOUBLE *value, char *str) +int CDECL DECLSPEC_HOTPATCH _atodbl(_CRT_DOUBLE *value, char *str) { return _atodbl_l(value, str, NULL); } @@ -1151,7 +1151,7 @@ int CDECL _atodbl(_CRT_DOUBLE *value, char *str) /********************************************************************* * _strcoll_l (MSVCRT.@) */ -int CDECL _strcoll_l( const char* str1, const char* str2, _locale_t locale ) +int CDECL DECLSPEC_HOTPATCH _strcoll_l( const char* str1, const char* str2, _locale_t locale ) { pthreadlocinfo locinfo;
@@ -1168,7 +1168,7 @@ int CDECL _strcoll_l( const char* str1, const char* str2, _locale_t locale ) /********************************************************************* * strcoll (MSVCRT.@) */ -int CDECL strcoll( const char* str1, const char* str2 ) +int CDECL DECLSPEC_HOTPATCH strcoll( const char* str1, const char* str2 ) { return _strcoll_l(str1, str2, NULL); } @@ -1176,7 +1176,7 @@ int CDECL strcoll( const char* str1, const char* str2 ) /********************************************************************* * _stricoll_l (MSVCRT.@) */ -int CDECL _stricoll_l( const char* str1, const char* str2, _locale_t locale ) +int CDECL DECLSPEC_HOTPATCH _stricoll_l( const char* str1, const char* str2, _locale_t locale ) { pthreadlocinfo locinfo;
@@ -1194,7 +1194,7 @@ int CDECL _stricoll_l( const char* str1, const char* str2, _locale_t locale ) /********************************************************************* * _stricoll (MSVCRT.@) */ -int CDECL _stricoll( const char* str1, const char* str2 ) +int CDECL DECLSPEC_HOTPATCH _stricoll( const char* str1, const char* str2 ) { return _stricoll_l(str1, str2, NULL); } @@ -1202,7 +1202,7 @@ int CDECL _stricoll( const char* str1, const char* str2 ) /********************************************************************* * _strncoll_l (MSVCRT.@) */ -int CDECL _strncoll_l( const char* str1, const char* str2, size_t count, _locale_t locale ) +int CDECL DECLSPEC_HOTPATCH _strncoll_l( const char* str1, const char* str2, size_t count, _locale_t locale ) { pthreadlocinfo locinfo;
@@ -1221,7 +1221,7 @@ int CDECL _strncoll_l( const char* str1, const char* str2, size_t count, _locale /********************************************************************* * _strncoll (MSVCRT.@) */ -int CDECL _strncoll( const char* str1, const char* str2, size_t count ) +int CDECL DECLSPEC_HOTPATCH _strncoll( const char* str1, const char* str2, size_t count ) { return _strncoll_l(str1, str2, count, NULL); } @@ -1229,7 +1229,7 @@ int CDECL _strncoll( const char* str1, const char* str2, size_t count ) /********************************************************************* * _strnicoll_l (MSVCRT.@) */ -int CDECL _strnicoll_l( const char* str1, const char* str2, size_t count, _locale_t locale ) +int CDECL DECLSPEC_HOTPATCH _strnicoll_l( const char* str1, const char* str2, size_t count, _locale_t locale ) { pthreadlocinfo locinfo;
@@ -1248,7 +1248,7 @@ int CDECL _strnicoll_l( const char* str1, const char* str2, size_t count, _local /********************************************************************* * _strnicoll (MSVCRT.@) */ -int CDECL _strnicoll( const char* str1, const char* str2, size_t count ) +int CDECL DECLSPEC_HOTPATCH _strnicoll( const char* str1, const char* str2, size_t count ) { return _strnicoll_l(str1, str2, count, NULL); } @@ -1256,7 +1256,7 @@ int CDECL _strnicoll( const char* str1, const char* str2, size_t count ) /********************************************************************* * strncpy (MSVCRT.@) */ -char* __cdecl strncpy(char *dst, const char *src, size_t len) +char* __cdecl DECLSPEC_HOTPATCH strncpy(char *dst, const char *src, size_t len) { size_t i;
@@ -1271,7 +1271,7 @@ char* __cdecl strncpy(char *dst, const char *src, size_t len) /********************************************************************* * strcpy (MSVCRT.@) */ -char* CDECL strcpy(char *dst, const char *src) +char* CDECL DECLSPEC_HOTPATCH strcpy(char *dst, const char *src) { char *ret = dst; while ((*dst++ = *src++)); @@ -1281,7 +1281,7 @@ char* CDECL strcpy(char *dst, const char *src) /********************************************************************* * strcpy_s (MSVCRT.@) */ -int CDECL strcpy_s( char* dst, size_t elem, const char* src ) +int CDECL DECLSPEC_HOTPATCH strcpy_s( char* dst, size_t elem, const char* src ) { size_t i; if(!elem) return EINVAL; @@ -1303,7 +1303,7 @@ int CDECL strcpy_s( char* dst, size_t elem, const char* src ) /********************************************************************* * strcat_s (MSVCRT.@) */ -int CDECL strcat_s( char* dst, size_t elem, const char* src ) +int CDECL DECLSPEC_HOTPATCH strcat_s( char* dst, size_t elem, const char* src ) { size_t i, j; if(!dst) return EINVAL; @@ -1332,7 +1332,7 @@ int CDECL strcat_s( char* dst, size_t elem, const char* src ) /********************************************************************* * strcat (MSVCRT.@) */ -char* __cdecl strcat( char *dst, const char *src ) +char* __cdecl DECLSPEC_HOTPATCH strcat( char *dst, const char *src ) { char *d = dst; while (*d) d++; @@ -1343,7 +1343,7 @@ char* __cdecl strcat( char *dst, const char *src ) /********************************************************************* * strncat_s (MSVCRT.@) */ -int CDECL strncat_s( char* dst, size_t elem, const char* src, size_t count ) +int CDECL DECLSPEC_HOTPATCH strncat_s( char* dst, size_t elem, const char* src, size_t count ) { size_t i, j;
@@ -1382,7 +1382,7 @@ int CDECL strncat_s( char* dst, size_t elem, const char* src, size_t count ) /********************************************************************* * strncat (MSVCRT.@) */ -char* __cdecl strncat(char *dst, const char *src, size_t len) +char* __cdecl DECLSPEC_HOTPATCH strncat(char *dst, const char *src, size_t len) { char *d = dst; while (*d) d++; @@ -1394,7 +1394,7 @@ char* __cdecl strncat(char *dst, const char *src, size_t len) /********************************************************************* * _strxfrm_l (MSVCRT.@) */ -size_t CDECL _strxfrm_l( char *dest, const char *src, +size_t CDECL DECLSPEC_HOTPATCH _strxfrm_l( char *dest, const char *src, size_t len, _locale_t locale ) { pthreadlocinfo locinfo; @@ -1440,7 +1440,7 @@ size_t CDECL _strxfrm_l( char *dest, const char *src, /********************************************************************* * strxfrm (MSVCRT.@) */ -size_t CDECL strxfrm( char *dest, const char *src, size_t len ) +size_t CDECL DECLSPEC_HOTPATCH strxfrm( char *dest, const char *src, size_t len ) { return _strxfrm_l(dest, src, len, NULL); } @@ -1448,7 +1448,7 @@ size_t CDECL strxfrm( char *dest, const char *src, size_t len ) /******************************************************************** * __STRINGTOLD_L (MSVCR80.@) */ -int CDECL __STRINGTOLD_L( MSVCRT__LDOUBLE *value, char **endptr, +int CDECL DECLSPEC_HOTPATCH __STRINGTOLD_L( MSVCRT__LDOUBLE *value, char **endptr, const char *str, int flags, _locale_t locale ) { pthreadlocinfo locinfo; @@ -1480,7 +1480,7 @@ int CDECL __STRINGTOLD_L( MSVCRT__LDOUBLE *value, char **endptr, /******************************************************************** * __STRINGTOLD (MSVCRT.@) */ -int CDECL __STRINGTOLD( MSVCRT__LDOUBLE *value, char **endptr, const char *str, int flags ) +int CDECL DECLSPEC_HOTPATCH __STRINGTOLD( MSVCRT__LDOUBLE *value, char **endptr, const char *str, int flags ) { return __STRINGTOLD_L( value, endptr, str, flags, NULL ); } @@ -1488,7 +1488,7 @@ int CDECL __STRINGTOLD( MSVCRT__LDOUBLE *value, char **endptr, const char *str, /******************************************************************** * _atoldbl_l (MSVCRT.@) */ -int CDECL _atoldbl_l( MSVCRT__LDOUBLE *value, char *str, _locale_t locale ) +int CDECL DECLSPEC_HOTPATCH _atoldbl_l( MSVCRT__LDOUBLE *value, char *str, _locale_t locale ) { char *endptr; switch(__STRINGTOLD_L( value, &endptr, str, 0, locale )) @@ -1502,7 +1502,7 @@ int CDECL _atoldbl_l( MSVCRT__LDOUBLE *value, char *str, _locale_t locale ) /******************************************************************** * _atoldbl (MSVCRT.@) */ -int CDECL _atoldbl(_LDOUBLE *value, char *str) +int CDECL DECLSPEC_HOTPATCH _atoldbl(_LDOUBLE *value, char *str) { return _atoldbl_l( (MSVCRT__LDOUBLE*)value, str, NULL ); } @@ -1510,7 +1510,7 @@ int CDECL _atoldbl(_LDOUBLE *value, char *str) /********************************************************************* * strlen (MSVCRT.@) */ -size_t __cdecl strlen(const char *str) +size_t __cdecl DECLSPEC_HOTPATCH strlen(const char *str) { const char *s = str; while (*s) s++; @@ -1520,7 +1520,7 @@ size_t __cdecl strlen(const char *str) /****************************************************************** * strnlen (MSVCRT.@) */ -size_t CDECL strnlen(const char *s, size_t maxlen) +size_t CDECL DECLSPEC_HOTPATCH strnlen(const char *s, size_t maxlen) { size_t i;
@@ -1535,7 +1535,7 @@ size_t CDECL strnlen(const char *s, size_t maxlen) * * FIXME: locale parameter is ignored */ -__int64 CDECL _strtoi64_l(const char *nptr, char **endptr, int base, _locale_t locale) +__int64 CDECL DECLSPEC_HOTPATCH _strtoi64_l(const char *nptr, char **endptr, int base, _locale_t locale) { const char *p = nptr; BOOL negative = FALSE; @@ -1607,7 +1607,7 @@ __int64 CDECL _strtoi64_l(const char *nptr, char **endptr, int base, _locale_t l /********************************************************************* * _strtoi64 (MSVCRT.@) */ -__int64 CDECL _strtoi64(const char *nptr, char **endptr, int base) +__int64 CDECL DECLSPEC_HOTPATCH _strtoi64(const char *nptr, char **endptr, int base) { return _strtoi64_l(nptr, endptr, base, NULL); } @@ -1615,7 +1615,7 @@ __int64 CDECL _strtoi64(const char *nptr, char **endptr, int base) /********************************************************************* * _atoi_l (MSVCRT.@) */ -int __cdecl _atoi_l(const char *str, _locale_t locale) +int __cdecl DECLSPEC_HOTPATCH _atoi_l(const char *str, _locale_t locale) { __int64 ret = _strtoi64_l(str, NULL, 10, locale);
@@ -1633,7 +1633,7 @@ int __cdecl _atoi_l(const char *str, _locale_t locale) * atoi (MSVCRT.@) */ #if _MSVCR_VER == 0 -int __cdecl atoi(const char *str) +int __cdecl DECLSPEC_HOTPATCH atoi(const char *str) { BOOL minus = FALSE; int ret = 0; @@ -1658,7 +1658,7 @@ int __cdecl atoi(const char *str) return minus ? -ret : ret; } #else -int CDECL atoi(const char *str) +int CDECL DECLSPEC_HOTPATCH atoi(const char *str) { return _atoi_l(str, NULL); } @@ -1667,7 +1667,7 @@ int CDECL atoi(const char *str) /****************************************************************** * _atoi64_l (MSVCRT.@) */ -__int64 CDECL _atoi64_l(const char *str, _locale_t locale) +__int64 CDECL DECLSPEC_HOTPATCH _atoi64_l(const char *str, _locale_t locale) { return _strtoi64_l(str, NULL, 10, locale); } @@ -1675,7 +1675,7 @@ __int64 CDECL _atoi64_l(const char *str, _locale_t locale) /****************************************************************** * _atoi64 (MSVCRT.@) */ -__int64 CDECL _atoi64(const char *str) +__int64 CDECL DECLSPEC_HOTPATCH _atoi64(const char *str) { return _strtoi64_l(str, NULL, 10, NULL); } @@ -1683,7 +1683,7 @@ __int64 CDECL _atoi64(const char *str) /****************************************************************** * _atol_l (MSVCRT.@) */ -__msvcrt_long CDECL _atol_l(const char *str, _locale_t locale) +__msvcrt_long CDECL DECLSPEC_HOTPATCH _atol_l(const char *str, _locale_t locale) { __int64 ret = _strtoi64_l(str, NULL, 10, locale);
@@ -1700,7 +1700,7 @@ __msvcrt_long CDECL _atol_l(const char *str, _locale_t locale) /****************************************************************** * atol (MSVCRT.@) */ -__msvcrt_long CDECL atol(const char *str) +__msvcrt_long CDECL DECLSPEC_HOTPATCH atol(const char *str) { #if _MSVCR_VER == 0 return atoi(str); @@ -1714,7 +1714,7 @@ __msvcrt_long CDECL atol(const char *str) /****************************************************************** * _atoll_l (MSVCR120.@) */ -__int64 CDECL _atoll_l(const char* str, _locale_t locale) +__int64 CDECL DECLSPEC_HOTPATCH _atoll_l(const char* str, _locale_t locale) { return _strtoi64_l(str, NULL, 10, locale); } @@ -1722,7 +1722,7 @@ __int64 CDECL _atoll_l(const char* str, _locale_t locale) /****************************************************************** * atoll (MSVCR120.@) */ -__int64 CDECL atoll(const char* str) +__int64 CDECL DECLSPEC_HOTPATCH atoll(const char* str) { return _atoll_l(str, NULL); } @@ -1732,7 +1732,7 @@ __int64 CDECL atoll(const char* str) /****************************************************************** * _strtol_l (MSVCRT.@) */ -__msvcrt_long CDECL _strtol_l(const char* nptr, +__msvcrt_long CDECL DECLSPEC_HOTPATCH _strtol_l(const char* nptr, char** end, int base, _locale_t locale) { __int64 ret = _strtoi64_l(nptr, end, base, locale); @@ -1751,7 +1751,7 @@ __msvcrt_long CDECL _strtol_l(const char* nptr, /****************************************************************** * strtol (MSVCRT.@) */ -__msvcrt_long CDECL strtol(const char* nptr, char** end, int base) +__msvcrt_long CDECL DECLSPEC_HOTPATCH strtol(const char* nptr, char** end, int base) { return _strtol_l(nptr, end, base, NULL); } @@ -1759,7 +1759,7 @@ __msvcrt_long CDECL strtol(const char* nptr, char** end, int base) /****************************************************************** * _strtoul_l (MSVCRT.@) */ -__msvcrt_ulong CDECL _strtoul_l(const char* nptr, char** end, int base, _locale_t locale) +__msvcrt_ulong CDECL DECLSPEC_HOTPATCH _strtoul_l(const char* nptr, char** end, int base, _locale_t locale) { __int64 ret = _strtoi64_l(nptr, end, base, locale);
@@ -1777,7 +1777,7 @@ __msvcrt_ulong CDECL _strtoul_l(const char* nptr, char** end, int base, _locale_ /****************************************************************** * strtoul (MSVCRT.@) */ -__msvcrt_ulong CDECL strtoul(const char* nptr, char** end, int base) +__msvcrt_ulong CDECL DECLSPEC_HOTPATCH strtoul(const char* nptr, char** end, int base) { return _strtoul_l(nptr, end, base, NULL); } @@ -1787,7 +1787,7 @@ __msvcrt_ulong CDECL strtoul(const char* nptr, char** end, int base) * * FIXME: locale parameter is ignored */ -unsigned __int64 CDECL _strtoui64_l(const char *nptr, char **endptr, int base, _locale_t locale) +unsigned __int64 CDECL DECLSPEC_HOTPATCH _strtoui64_l(const char *nptr, char **endptr, int base, _locale_t locale) { const char *p = nptr; BOOL negative = FALSE; @@ -1853,7 +1853,7 @@ unsigned __int64 CDECL _strtoui64_l(const char *nptr, char **endptr, int base, _ /********************************************************************* * _strtoui64 (MSVCRT.@) */ -unsigned __int64 CDECL _strtoui64(const char *nptr, char **endptr, int base) +unsigned __int64 CDECL DECLSPEC_HOTPATCH _strtoui64(const char *nptr, char **endptr, int base) { return _strtoui64_l(nptr, endptr, base, NULL); } @@ -1989,7 +1989,7 @@ static int ltow_helper(__msvcrt_long value, wchar_t *str, size_t size, int radix /********************************************************************* * _ltoa_s (MSVCRT.@) */ -int CDECL _ltoa_s(__msvcrt_long value, char *str, size_t size, int radix) +int CDECL DECLSPEC_HOTPATCH _ltoa_s(__msvcrt_long value, char *str, size_t size, int radix) { if (!MSVCRT_CHECK_PMT(str != NULL)) return EINVAL; if (!MSVCRT_CHECK_PMT(size > 0)) return EINVAL; @@ -2005,7 +2005,7 @@ int CDECL _ltoa_s(__msvcrt_long value, char *str, size_t size, int radix) /********************************************************************* * _ltow_s (MSVCRT.@) */ -int CDECL _ltow_s(__msvcrt_long value, wchar_t *str, size_t size, int radix) +int CDECL DECLSPEC_HOTPATCH _ltow_s(__msvcrt_long value, wchar_t *str, size_t size, int radix) { if (!MSVCRT_CHECK_PMT(str != NULL)) return EINVAL; if (!MSVCRT_CHECK_PMT(size > 0)) return EINVAL; @@ -2021,7 +2021,7 @@ int CDECL _ltow_s(__msvcrt_long value, wchar_t *str, size_t size, int radix) /********************************************************************* * _itoa_s (MSVCRT.@) */ -int CDECL _itoa_s(int value, char *str, size_t size, int radix) +int CDECL DECLSPEC_HOTPATCH _itoa_s(int value, char *str, size_t size, int radix) { return _ltoa_s(value, str, size, radix); } @@ -2029,7 +2029,7 @@ int CDECL _itoa_s(int value, char *str, size_t size, int radix) /********************************************************************* * _itoa (MSVCRT.@) */ -char* CDECL _itoa(int value, char *str, int radix) +char* CDECL DECLSPEC_HOTPATCH _itoa(int value, char *str, int radix) { return ltoa_helper(value, str, SIZE_MAX, radix) ? NULL : str; } @@ -2045,7 +2045,7 @@ char* CDECL _ltoa(__msvcrt_long value, char *str, int radix) /********************************************************************* * _itow_s (MSVCRT.@) */ -int CDECL _itow_s(int value, wchar_t *str, size_t size, int radix) +int CDECL DECLSPEC_HOTPATCH _itow_s(int value, wchar_t *str, size_t size, int radix) { return _ltow_s(value, str, size, radix); } @@ -2249,7 +2249,7 @@ wchar_t* CDECL _i64tow(__int64 value, wchar_t *str, int radix) /********************************************************************* * _ui64toa_s (MSVCRT.@) */ -int CDECL _ui64toa_s(unsigned __int64 value, char *str, +int CDECL DECLSPEC_HOTPATCH _ui64toa_s(unsigned __int64 value, char *str, size_t size, int radix) { char buffer[65], *pos; @@ -2288,7 +2288,7 @@ int CDECL _ui64toa_s(unsigned __int64 value, char *str, /********************************************************************* * _ui64tow_s (MSVCRT.@) */ -int CDECL _ui64tow_s( unsigned __int64 value, wchar_t *str, +int CDECL DECLSPEC_HOTPATCH _ui64tow_s( unsigned __int64 value, wchar_t *str, size_t size, int radix ) { wchar_t buffer[65], *pos; @@ -2326,7 +2326,7 @@ int CDECL _ui64tow_s( unsigned __int64 value, wchar_t *str, /********************************************************************* * _ultoa_s (MSVCRT.@) */ -int CDECL _ultoa_s(__msvcrt_ulong value, char *str, size_t size, int radix) +int CDECL DECLSPEC_HOTPATCH _ultoa_s(__msvcrt_ulong value, char *str, size_t size, int radix) { __msvcrt_ulong digit; char buffer[33], *pos; @@ -2380,7 +2380,7 @@ int CDECL _ultoa_s(__msvcrt_ulong value, char *str, size_t size, int radix) /********************************************************************* * _ultow_s (MSVCRT.@) */ -int CDECL _ultow_s(__msvcrt_ulong value, wchar_t *str, size_t size, int radix) +int CDECL DECLSPEC_HOTPATCH _ultow_s(__msvcrt_ulong value, wchar_t *str, size_t size, int radix) { __msvcrt_ulong digit; WCHAR buffer[33], *pos; @@ -2434,7 +2434,7 @@ int CDECL _ultow_s(__msvcrt_ulong value, wchar_t *str, size_t size, int radix) /********************************************************************* * _i64toa_s (MSVCRT.@) */ -int CDECL _i64toa_s(__int64 value, char *str, size_t size, int radix) +int CDECL DECLSPEC_HOTPATCH _i64toa_s(__int64 value, char *str, size_t size, int radix) { unsigned __int64 val; unsigned int digit; @@ -2509,7 +2509,7 @@ int CDECL _i64toa_s(__int64 value, char *str, size_t size, int radix) /********************************************************************* * _i64tow_s (MSVCRT.@) */ -int CDECL _i64tow_s(__int64 value, wchar_t *str, size_t size, int radix) +int CDECL DECLSPEC_HOTPATCH _i64tow_s(__int64 value, wchar_t *str, size_t size, int radix) { unsigned __int64 val; unsigned int digit; @@ -2605,7 +2605,7 @@ struct _I10_OUTPUT_DATA { * Native sets last byte of data->str to '0' or '9', I don't know what * it means. Current implementation sets it always to '0'. */ -int CDECL I10_OUTPUT(MSVCRT__LDOUBLE ld80, int prec, int flag, struct _I10_OUTPUT_DATA *data) +int CDECL DECLSPEC_HOTPATCH I10_OUTPUT(MSVCRT__LDOUBLE ld80, int prec, int flag, struct _I10_OUTPUT_DATA *data) { struct fpnum num; double d; @@ -2678,7 +2678,7 @@ int CDECL I10_OUTPUT(MSVCRT__LDOUBLE ld80, int prec, int flag, struct _I10_OUTPU /********************************************************************* * memcmp (MSVCRT.@) */ -int __cdecl memcmp(const void *ptr1, const void *ptr2, size_t n) +int __cdecl DECLSPEC_HOTPATCH memcmp(const void *ptr1, const void *ptr2, size_t n) { const unsigned char *p1, *p2;
@@ -2738,7 +2738,7 @@ int __cdecl memcmp(const void *ptr1, const void *ptr2, size_t n) __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") #endif
-void * __cdecl sse2_memmove(void *dst, const void *src, size_t n); +void * __cdecl DECLSPEC_HOTPATCH sse2_memmove(void *dst, const void *src, size_t n); __ASM_GLOBAL_FUNC( sse2_memmove, MEMMOVE_INIT "mov " DEST_REG ", " TMP_REG "\n\t" /* check copying direction */ @@ -2951,7 +2951,7 @@ __ASM_GLOBAL_FUNC( sse2_memmove, #else # define MERGE(w1, sh1, w2, sh2) ((w1 >> sh1) | (w2 << sh2)) #endif -void * __cdecl memmove(void *dst, const void *src, size_t n) +void * __cdecl DECLSPEC_HOTPATCH memmove(void *dst, const void *src, size_t n) { #ifdef __x86_64__ return sse2_memmove(dst, src, n); @@ -3059,7 +3059,7 @@ void * __cdecl memmove(void *dst, const void *src, size_t n) /********************************************************************* * memcpy (MSVCRT.@) */ -void * __cdecl memcpy(void *dst, const void *src, size_t n) +void * __cdecl DECLSPEC_HOTPATCH memcpy(void *dst, const void *src, size_t n) { return memmove(dst, src, n); } @@ -3092,7 +3092,7 @@ static inline void memset_aligned_32(unsigned char *d, uint64_t v, size_t n) /********************************************************************* * memset (MSVCRT.@) */ -void *__cdecl memset(void *dst, int c, size_t n) +void* __cdecl DECLSPEC_HOTPATCH memset(void *dst, int c, size_t n) { typedef uint64_t DECLSPEC_ALIGN(1) unaligned_ui64; typedef uint32_t DECLSPEC_ALIGN(1) unaligned_ui32; @@ -3148,7 +3148,7 @@ void *__cdecl memset(void *dst, int c, size_t n) /********************************************************************* * strchr (MSVCRT.@) */ -char* __cdecl strchr(const char *str, int c) +char* __cdecl DECLSPEC_HOTPATCH strchr(const char *str, int c) { do { @@ -3160,7 +3160,7 @@ char* __cdecl strchr(const char *str, int c) /********************************************************************* * strrchr (MSVCRT.@) */ -char* __cdecl strrchr(const char *str, int c) +char* __cdecl DECLSPEC_HOTPATCH strrchr(const char *str, int c) { char *ret = NULL; do { if (*str == (char)c) ret = (char*)str; } while (*str++); @@ -3170,7 +3170,7 @@ char* __cdecl strrchr(const char *str, int c) /********************************************************************* * memchr (MSVCRT.@) */ -void* __cdecl memchr(const void *ptr, int c, size_t n) +void* __cdecl DECLSPEC_HOTPATCH memchr(const void *ptr, int c, size_t n) { const unsigned char *p = ptr;
@@ -3181,7 +3181,7 @@ void* __cdecl memchr(const void *ptr, int c, size_t n) /********************************************************************* * strcmp (MSVCRT.@) */ -int __cdecl strcmp(const char *str1, const char *str2) +int __cdecl DECLSPEC_HOTPATCH strcmp(const char *str1, const char *str2) { while (*str1 && *str1 == *str2) { str1++; str2++; } if ((unsigned char)*str1 > (unsigned char)*str2) return 1; @@ -3192,7 +3192,7 @@ int __cdecl strcmp(const char *str1, const char *str2) /********************************************************************* * strncmp (MSVCRT.@) */ -int __cdecl strncmp(const char *str1, const char *str2, size_t len) +int __cdecl DECLSPEC_HOTPATCH strncmp(const char *str1, const char *str2, size_t len) { if (!len) return 0; while (--len && *str1 && *str1 == *str2) { str1++; str2++; } @@ -3202,7 +3202,7 @@ int __cdecl strncmp(const char *str1, const char *str2, size_t len) /********************************************************************* * _strnicmp_l (MSVCRT.@) */ -int __cdecl _strnicmp_l(const char *s1, const char *s2, +int __cdecl DECLSPEC_HOTPATCH _strnicmp_l(const char *s1, const char *s2, size_t count, _locale_t locale) { pthreadlocinfo locinfo; @@ -3242,7 +3242,7 @@ int __cdecl _strnicmp_l(const char *s1, const char *s2, /********************************************************************* * _stricmp_l (MSVCRT.@) */ -int __cdecl _stricmp_l(const char *s1, const char *s2, _locale_t locale) +int __cdecl DECLSPEC_HOTPATCH _stricmp_l(const char *s1, const char *s2, _locale_t locale) { return _strnicmp_l(s1, s2, -1, locale); } @@ -3250,7 +3250,7 @@ int __cdecl _stricmp_l(const char *s1, const char *s2, _locale_t locale) /********************************************************************* * _strnicmp (MSVCRT.@) */ -int __cdecl _strnicmp(const char *s1, const char *s2, size_t count) +int __cdecl DECLSPEC_HOTPATCH _strnicmp(const char *s1, const char *s2, size_t count) { return _strnicmp_l(s1, s2, count, NULL); } @@ -3258,7 +3258,7 @@ int __cdecl _strnicmp(const char *s1, const char *s2, size_t count) /********************************************************************* * _stricmp (MSVCRT.@) */ -int __cdecl _stricmp(const char *s1, const char *s2) +int __cdecl DECLSPEC_HOTPATCH _stricmp(const char *s1, const char *s2) { return _strnicmp_l(s1, s2, -1, NULL); } @@ -3266,7 +3266,7 @@ int __cdecl _stricmp(const char *s1, const char *s2) /********************************************************************* * strstr (MSVCRT.@) */ -char* __cdecl strstr(const char *haystack, const char *needle) +char* __cdecl DECLSPEC_HOTPATCH strstr(const char *haystack, const char *needle) { size_t i, j, len, needle_len, lps_len; BYTE lps[256]; @@ -3309,7 +3309,7 @@ char* __cdecl strstr(const char *haystack, const char *needle) /********************************************************************* * _memicmp_l (MSVCRT.@) */ -int __cdecl _memicmp_l(const void *v1, const void *v2, size_t len, _locale_t locale) +int __cdecl DECLSPEC_HOTPATCH _memicmp_l(const void *v1, const void *v2, size_t len, _locale_t locale) { const char *s1 = v1, *s2 = v2; int ret = 0; @@ -3336,7 +3336,7 @@ int __cdecl _memicmp_l(const void *v1, const void *v2, size_t len, _locale_t loc /********************************************************************* * _memicmp (MSVCRT.@) */ -int __cdecl _memicmp(const void *s1, const void *s2, size_t len) +int __cdecl DECLSPEC_HOTPATCH _memicmp(const void *s1, const void *s2, size_t len) { return _memicmp_l(s1, s2, len, NULL); } @@ -3344,7 +3344,7 @@ int __cdecl _memicmp(const void *s1, const void *s2, size_t len) /********************************************************************* * strcspn (MSVCRT.@) */ -size_t __cdecl strcspn(const char *str, const char *reject) +size_t __cdecl DECLSPEC_HOTPATCH strcspn(const char *str, const char *reject) { BOOL rejects[256]; const char *p; @@ -3376,7 +3376,7 @@ size_t __cdecl strspn(const char *str, const char *accept) /********************************************************************* * strpbrk (MSVCRT.@) */ -char* __cdecl strpbrk(const char *str, const char *accept) +char* __cdecl DECLSPEC_HOTPATCH strpbrk(const char *str, const char *accept) { for (; *str; str++) if (strchr( accept, *str )) return (char*)str; return NULL; @@ -3385,7 +3385,7 @@ char* __cdecl strpbrk(const char *str, const char *accept) /********************************************************************* * __strncnt (MSVCRT.@) */ -size_t __cdecl __strncnt(const char *str, size_t size) +size_t __cdecl DECLSPEC_HOTPATCH __strncnt(const char *str, size_t size) { size_t ret = 0;
@@ -3406,7 +3406,7 @@ size_t __cdecl __strncnt(const char *str, size_t size) /********************************************************************* * _strdec (CRTDLL.@) */ -char * CDECL _strdec(const char *str1, const char *str2) +char * CDECL DECLSPEC_HOTPATCH _strdec(const char *str1, const char *str2) { return (char *)(str2 - 1); } @@ -3414,7 +3414,7 @@ char * CDECL _strdec(const char *str1, const char *str2) /********************************************************************* * _strinc (CRTDLL.@) */ -char * CDECL _strinc(const char *str) +char * CDECL DECLSPEC_HOTPATCH _strinc(const char *str) { return (char *)(str + 1); } @@ -3422,7 +3422,7 @@ char * CDECL _strinc(const char *str) /********************************************************************* * _strnextc (CRTDLL.@) */ -unsigned int CDECL _strnextc(const char *str) +unsigned int CDECL DECLSPEC_HOTPATCH _strnextc(const char *str) { return (unsigned char)str[0]; } @@ -3430,7 +3430,7 @@ unsigned int CDECL _strnextc(const char *str) /********************************************************************* * _strninc (CRTDLL.@) */ -char * CDECL _strninc(const char *str, size_t len) +char * CDECL DECLSPEC_HOTPATCH _strninc(const char *str, size_t len) { return (char *)(str + len); } @@ -3438,7 +3438,7 @@ char * CDECL _strninc(const char *str, size_t len) /********************************************************************* * _strspnp (CRTDLL.@) */ -char * CDECL _strspnp( const char *str1, const char *str2) +char * CDECL DECLSPEC_HOTPATCH _strspnp( const char *str1, const char *str2) { str1 += strspn( str1, str2 ); return *str1 ? (char*)str1 : NULL;