Commit 3eb944c0 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

winex11.drv: Treat invalid icon as no icon in fetch_icon_data().

parent 39153c98
...@@ -598,6 +598,11 @@ failed: ...@@ -598,6 +598,11 @@ failed:
} }
static HICON get_icon_info( HICON icon, ICONINFO *ii )
{
return icon && NtUserGetIconInfo( icon, ii, NULL, NULL, NULL, 0 ) ? icon : NULL;
}
/*********************************************************************** /***********************************************************************
* fetch_icon_data * fetch_icon_data
*/ */
...@@ -612,21 +617,24 @@ static void fetch_icon_data( HWND hwnd, HICON icon_big, HICON icon_small ) ...@@ -612,21 +617,24 @@ static void fetch_icon_data( HWND hwnd, HICON icon_big, HICON icon_small )
if (!icon_big) if (!icon_big)
{ {
icon_big = (HICON)send_message( hwnd, WM_GETICON, ICON_BIG, 0 ); icon_big = get_icon_info( (HICON)send_message( hwnd, WM_GETICON, ICON_BIG, 0 ), &ii );
if (!icon_big) icon_big = (HICON)NtUserGetClassLongPtrW( hwnd, GCLP_HICON ); if (!icon_big)
if (!icon_big) icon_big = LoadIconW( 0, (LPWSTR)IDI_WINLOGO ); icon_big = get_icon_info( (HICON)NtUserGetClassLongPtrW( hwnd, GCLP_HICON ), &ii );
if (!icon_big)
icon_big = get_icon_info( LoadIconW( 0, (LPWSTR)IDI_WINLOGO ), &ii);
} }
if (!icon_small) if (!icon_small)
{ {
icon_small = (HICON)send_message( hwnd, WM_GETICON, ICON_SMALL, 0 ); icon_small = get_icon_info( (HICON)send_message( hwnd, WM_GETICON, ICON_SMALL, 0 ), &ii_small );
if (!icon_small) icon_small = (HICON)NtUserGetClassLongPtrW( hwnd, GCLP_HICONSM ); if (!icon_small)
icon_small = get_icon_info( (HICON)NtUserGetClassLongPtrW( hwnd, GCLP_HICONSM ), &ii_small );
} }
if (!NtUserGetIconInfo( icon_big, &ii, NULL, NULL, NULL, 0 )) return; if (!icon_big) return;
hDC = NtGdiCreateCompatibleDC(0); hDC = NtGdiCreateCompatibleDC(0);
bits = get_bitmap_argb( hDC, ii.hbmColor, ii.hbmMask, &size ); bits = get_bitmap_argb( hDC, ii.hbmColor, ii.hbmMask, &size );
if (bits && NtUserGetIconInfo( icon_small, &ii_small, NULL, NULL, NULL, 0 )) if (bits && icon_small)
{ {
unsigned int size_small; unsigned int size_small;
unsigned long *bits_small, *new; unsigned long *bits_small, *new;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment