[10/11] kernel32: Implement LCMAP_FULLWIDTH.

Alexandre Julliard julliard at winehq.org
Tue Sep 27 21:52:26 CDT 2016


Akihiro Sagawa <sagawa.aki at gmail.com> writes:

> @@ -3246,6 +3385,24 @@ INT WINAPI LCMapStringEx(LPCWSTR name, DWORD flags, LPCWSTR src, INT srclen, LPW
>          goto done;
>      }
>  
> +    if (flags & LCMAP_FULLWIDTH)
> +    {
> +        len = min(srclen, dstlen);
> +        buffer = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
> +        if (!buffer)
> +        {
> +            SetLastError(ERROR_NOT_ENOUGH_MEMORY);
> +            return 0;
> +        }
> +        srclen = map_to_fullwidth(src, srclen, buffer, len);
> +        if (!srclen)
> +        {
> +            HeapFree(GetProcessHeap(), 0, buffer);
> +            return 0;
> +        }
> +        src = buffer;
> +    }

It seems to me that you should be able to do this without allocating an
intermediate buffer.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list