user[3/5]: handle special cases for SPI_SETDESKWALLPAPER (FIXED)

Andrey Turkin pancha at Mail.nnov.ru
Sun Jun 11 02:32:51 CDT 2006


Andrew Ziem wrote:
> Please use this patch instead of previous "user3.patch".  Thanks to 
> Andrey Turkin for catching the uninitialized variable.
>
> changelog:
> user: handle special cases for SPI_SETDESKWALLPAPER
>
> The special cases remove the wallpaper or set it to default.  
> Previously, these cases were ignored, so Wine would crash.
>
>
>
> ------------------------------------------------------------------------
>
>
>  
> -    if (filename == (LPSTR)-1)
> +    if ((LPCSTR)SETWALLPAPER_DEFAULT == filename || (LPCSTR)NULL == filename || '\0' == filename[0])
>      {
> -	GetProfileStringA( "desktop", "WallPaper", "(None)", buffer, 256 );
> -	filename = buffer;
> +       /* set default wallpaper or remove wallpaper*/
> +       if (hbitmapWallPaper)
> +           DeleteObject( hbitmapWallPaper );
> +       return TRUE;
>      }
>      hdc = GetDC( 0 );

According to MSDN, if
  - pvParam==SETWALLPAPER_DEFAUL || pvParam==NULL, then wallpaper will 
be set to default one
 - pvParam[0]=='\0', then wallpaper will be removed.
I cannot see any signs of such distinction in your code :)



More information about the wine-devel mailing list