(resend)imm: implement ImmGetIMEFileNameW and ImmGetIMEFileNameA correct registry lookups

Alexandre Julliard julliard at winehq.org
Mon Mar 24 15:20:09 CDT 2008


Aric Stewart <aric at codeweavers.com> writes:

> +    if (rc > 0)
> +    {
> +        if (uBufLen && lpszFileName)
> +            rc = WideCharToMultiByte(CP_ACP, 0, bufW, uBufLen, lpszFileName,
> +                                 uBufLen, NULL, NULL);
> +        else /* get the length */
> +            rc = WideCharToMultiByte(CP_ACP, 0, bufW, wBufLen, NULL, 0, NULL,
> +                                     NULL);

The source length should be -1, you don't want to convert the whole
buffer.

> +    static CHAR KeyboardKey[] = "System\\CurrentControlSet\\Control\\Keyboard Layouts";
> +    static WCHAR szImeFileW[] = {'I','m','e',' ','F','i','l','e',0};
> +
> +    HKEY keyboardKey;
> +    DWORD length;
> +    DWORD rc;
> +    CHAR regKey[sizeof(KeyboardKey) + 11];
> +
> +    wsprintfA( regKey, "%s\\%08x", KeyboardKey, (unsigned)hKL );
> +    rc = RegOpenKeyA( HKEY_LOCAL_MACHINE, regKey, &keyboardKey);

This should use Unicode like the rest of the function.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list