I tried to implement StrToInt64ExA/W as a reply to bug #27633 I also corrected the comment in functions FormatInt() and FormatDouble() because, according to MSDN, GetNumberFormat() returns the number of characters written (or required) and not the number of bytes emitted: http://msdn.microsoft.com/en-us/library/windows/desktop/dd318110%28v=vs.85%29. aspx I hope my first patch to WINE is correct and it could be useful. Sincerely, Carlo Bramini.
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
No cpp comments please. Also this comment is a bit redundant for a
function that small.
+ if (!lpiRet)
+ {
+ WARN("Invalid lpiRet would crash under Win32!\n");
+ return FALSE;
+ }
You don't need to WARN on that, especially with such message.This needs tests, take a look at shlwapi/tests for some examples.+ + bRes = StrToInt64ExA(lpszStr, dwFlags, &li.QuadPart); + if (bRes) + *lpiRet = li.u.LowPart; + + return bRes; +}