kernel32: MultiByteToWideChar: MB_USEGLYPHCHARS & incorrectGetLastError() codes fix

Dmitry Timoshkov dmitry at codeweavers.com
Fri May 4 02:03:20 CDT 2007


"Andrew O. Shadoura" <bugzilla at tut.by> wrote:

> This patch implements MB_USEGLYPHCHARS flag in MultiByteToWideChar function
> and fixes incorrect error codes (in case of CP_SYMBOL charset non-zero dwFlags
> should give ERROR_INVALID_FLAGS, not ERROR_INVALID_PARAMETER, almost the same
> with CP_UTF8, but "dwFlags must be set to either 0 or MB_ERR_INVALID_CHARS"
> according to MSDN: http://msdn2.microsoft.com/en-us/library/ms776413.aspx
> Also, test case is added.

Please follow the existing code style of the files you're changing (indentation,
braces, spaces), don't mix tabs and spaces.

> +    for (i=0; i!=length; i++) {
> +        if (str[i]<0x20) str[i]=glyph_xlat[str[i]];
> +    }

This is rather an unusual style of breaking out of the loop, 'i < length'
is less confusing IMO.

-- 
Dmitry.



More information about the wine-devel mailing list