shlwapi: Implemented StrToInt64ExA/W

Nikolay Sivov bunglehead at gmail.com
Sat Feb 25 11:04:27 CST 2012


On 2/25/2012 17:49, carlo.bramix at libero.it wrote:
> 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.
> +
> +  bRes = StrToInt64ExA(lpszStr, dwFlags,&li.QuadPart);
> +  if (bRes)
> +    *lpiRet = li.u.LowPart;
> +
> +  return bRes;
> +}
This needs tests, take a look at shlwapi/tests for some examples.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20120225/d9d1ed82/attachment.html>


More information about the wine-devel mailing list