diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index deb8a48..40e2ee9 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -804,6 +804,8 @@ @ stdcall StrStrNW(wstr wstr long) @ stdcall StrStrNIW(wstr wstr long) @ stdcall StrStrW(wstr wstr) +@ stdcall StrToInt64ExA(str long ptr) +@ stdcall StrToInt64ExW(wstr long ptr) @ stdcall StrToIntA(str) @ stdcall StrToIntExA(str long ptr) @ stdcall StrToIntExW(wstr long ptr) diff --git a/dlls/shlwapi/string.c b/dlls/shlwapi/string.c index 903c981..f2d3812 100644 --- a/dlls/shlwapi/string.c +++ b/dlls/shlwapi/string.c @@ -91,7 +91,7 @@ static void FillNumberFmt(NUMBERFMTW *fmt, LPWSTR decimal_buffer, int decimal_bu * Format an integer according to the current locale * * RETURNS - * The number of bytes written on success or 0 on failure + * The number of characters written on success or 0 on failure */ static int FormatInt(LONGLONG qdwValue, LPWSTR pszBuf, int cchBuf) { @@ -124,7 +124,7 @@ static int FormatInt(LONGLONG qdwValue, LPWSTR pszBuf, int cchBuf) * after the decimal point * * RETURNS - * The number of bytes written on success or 0 on failure + * The number of characters written on success or 0 on failure */ static int FormatDouble(double value, int decimals, LPWSTR pszBuf, int cchBuf) { @@ -855,8 +855,34 @@ int WINAPI StrToIntW(LPCWSTR lpszStr) */ BOOL WINAPI StrToIntExA(LPCSTR lpszStr, DWORD dwFlags, LPINT lpiRet) { + LARGE_INTEGER li; + BOOL bRes; + + TRACE("(%s,%08X,%p)\n", debugstr_a(lpszStr), dwFlags, lpiRet); + + // Test on lpszStr is done into StrToInt64ExA + if (!lpiRet) + { + WARN("Invalid lpiRet would crash under Win32!\n"); + return FALSE; + } + + bRes = StrToInt64ExA(lpszStr, dwFlags, &li.QuadPart); + if (bRes) + *lpiRet = li.u.LowPart; + + return bRes; +} + +/************************************************************************* + * StrToInt64ExA [SHLWAPI.@] + * + * See StrToIntExA. + */ +BOOL WINAPI StrToInt64ExA(LPCSTR lpszStr, DWORD dwFlags, LONGLONG *lpiRet) +{ BOOL bNegative = FALSE; - int iRet = 0; + LONGLONG iRet = 0; TRACE("(%s,%08X,%p)\n", debugstr_a(lpszStr), dwFlags, lpiRet); @@ -922,8 +948,34 @@ BOOL WINAPI StrToIntExA(LPCSTR lpszStr, DWORD dwFlags, LPINT lpiRet) */ BOOL WINAPI StrToIntExW(LPCWSTR lpszStr, DWORD dwFlags, LPINT lpiRet) { + LARGE_INTEGER li; + BOOL bRes; + + TRACE("(%s,%08X,%p)\n", debugstr_w(lpszStr), dwFlags, lpiRet); + + // Test on lpszStr is done into StrToInt64ExW + if (!lpiRet) + { + WARN("Invalid lpiRet would crash under Win32!\n"); + return FALSE; + } + + bRes = StrToInt64ExW(lpszStr, dwFlags, &li.QuadPart); + if (bRes) + *lpiRet = li.u.LowPart; + + return bRes; +} + +/************************************************************************* + * StrToInt64ExW [SHLWAPI.@] + * + * See StrToIntExA. + */ +BOOL WINAPI StrToInt64ExW(LPCWSTR lpszStr, DWORD dwFlags, LONGLONG *lpiRet) +{ BOOL bNegative = FALSE; - int iRet = 0; + LONGLONG iRet = 0; TRACE("(%s,%08X,%p)\n", debugstr_w(lpszStr), dwFlags, lpiRet);