kernel32: MultiByteToWideChar: MB_USEGLYPHCHARS &
incorrectGetLastError() codes fix
Dmitry Timoshkov
dmitry at codeweavers.com
Wed May 9 22:55:59 CDT 2007
"Andrew O. Shadoura" <bugzilla at tut.by> wrote:
> if (!src || (!dst && dstlen))
> {
> @@ -1774,18 +1773,12 @@ INT WINAPI MultiByteToWideChar( UINT page, DWORD flags, LPCSTR src, INT srclen,
>
> if (srclen < 0) srclen = strlen(src) + 1;
>
> - if (!once && (flags & MB_USEGLYPHCHARS))
> - {
> - once = 1;
> - FIXME("MB_USEGLYPHCHARS not supported\n");
> - }
> -
> switch(page)
> {
> case CP_SYMBOL:
> - if( flags)
> + if(flags)
> {
If you decided to fix the formatting it would be better to send it as a separate
patch, and follow the style of 'if' statements above.
> case CP_UTF8:
> + if (flags & (~MB_ERR_INVALID_CHARS))
> + {
> + SetLastError( ERROR_INVALID_FLAGS );
> + return 0;
> + }
Mixed tabs/spaces.
> --- a/dlls/kernel32/tests/locale.c
> +++ b/dlls/kernel32/tests/locale.c
> @@ -2255,6 +2255,42 @@ static void test_GetCPInfo(void)
> ok(cpinfo.MaxCharSize == 4, "expected 5, got 0x%x\n", cpinfo.MaxCharSize);
> }
>
> +static void test_MultiByteToWideChar(void)
This test belongs to dlls/kernel32/tests/codepage.c.
> + else
> + res = mbstowcs_sbcs_decompose( &table->sbcs, src, srclen, dst, dstlen );
> + if (flags & MB_USEGLYPHCHARS) add_glyphs( dst, dstlen );
> + return res;
Mixed tabs/spaces.
> - return mbstowcs_dbcs_decompose( &table->dbcs, src, srclen, dst, dstlen );
> + res = mbstowcs_dbcs_decompose( &table->dbcs, src, srclen, dst, dstlen );
> + if (flags & MB_USEGLYPHCHARS) add_glyphs( dst, dstlen );
> + return res;
Again mixed tabs/spaces.
--
Dmitry.
More information about the wine-devel
mailing list