windows/clipboard.c: Get rid of W->A calls

Dmitry Timoshkov dmitry at baikal.ru
Sat Jan 8 05:42:56 CST 2005


"Jacek Caban" <jack at itma.pwr.wroc.pl> wrote:

> @@ -310,15 +335,24 @@ static void intern_atoms(void)
>      names = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*names) );
>      atoms = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*atoms) );
>  
> -    for (format = ClipFormats, i = 0; format; format = format->NextFormat)
> -        if (!format->drvData) names[i++] = format->Name;
> +    for (format = ClipFormats, i = 0; format; format = format->NextFormat) {
> +        if (!format->drvData) {
> +            len = WideCharToMultiByte(CP_ACP, 0, format->Name, -1, NULL, -1, 0, 0);
> +            names[i] = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
> +            WideCharToMultiByte(CP_ACP, 0, format->Name, -1, names[i++], len, 0, 0);

You have to use CP_UNIXCP to convert unicode strings in order to pass
them to the X11/unix system (here and everywhere else).

-- 
Dmitry.




More information about the wine-devel mailing list