user[2/5]: implement A version of SPI_GETDESKWALLPAPER

Dmitry Timoshkov dmitry at codeweavers.com
Mon Jul 10 12:19:27 CDT 2006


"Andrew Ziem" <ahziem1 at mailbolt.com> wrote:

> +    case SPI_GETDESKWALLPAPER:                  /*     115 */
> +    {
> +        WCHAR buffer[MAX_PATH];
> +        ret = SystemParametersInfoW( SPI_GETDESKWALLPAPER, uiParam, buffer, fuWinIni );
> +        if (!WideCharToMultiByte(CP_ACP, 0, buffer, -1, pvParam, uiParam, NULL, NULL))
> +           ret = FALSE;
> +        break;
> +    }

You need to check first whether the SystemParametersInfoW call succeeded or not,
otherwise it will end up translating garbage in WideCharToMultiByte.

-- 
Dmitry.



More information about the wine-devel mailing list