aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winmultiwindowicons.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-11-23 19:47:43 +0000
committermarha <marha@users.sourceforge.net>2009-11-23 19:47:43 +0000
commit2b82d3a5e4cdf2b9af7c0ff65c713a792109bb91 (patch)
treece39dc66f9412a6d6d976197a2251038fecf840c /xorg-server/hw/xwin/winmultiwindowicons.c
parent4d4234ac0efdc2b76562ff336467449d41f9a379 (diff)
downloadvcxsrv-2b82d3a5e4cdf2b9af7c0ff65c713a792109bb91.tar.gz
vcxsrv-2b82d3a5e4cdf2b9af7c0ff65c713a792109bb91.tar.bz2
vcxsrv-2b82d3a5e4cdf2b9af7c0ff65c713a792109bb91.zip
Make sure that uninitilised members of ICONINFO are put to zero.1.7.99.3
Diffstat (limited to 'xorg-server/hw/xwin/winmultiwindowicons.c')
-rw-r--r--xorg-server/hw/xwin/winmultiwindowicons.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/xorg-server/hw/xwin/winmultiwindowicons.c b/xorg-server/hw/xwin/winmultiwindowicons.c
index 89acf72be..8dae068af 100644
--- a/xorg-server/hw/xwin/winmultiwindowicons.c
+++ b/xorg-server/hw/xwin/winmultiwindowicons.c
@@ -273,19 +273,21 @@ NetWMToWinIconAlpha(uint32_t *icon)
HICON result;
HDC hdc = GetDC(NULL);
uint32_t *DIB_pixels;
- ICONINFO ii = {TRUE};
- BITMAPV4HEADER bmh = {sizeof(bmh)};
+ ICONINFO ii;
+ BITMAPV5HEADER bmh;
/* Define an ARGB pixel format used for Color+Alpha icons */
- bmh.bV4Width = width;
- bmh.bV4Height = -height; /* Invert the image */
- bmh.bV4Planes = 1;
- bmh.bV4BitCount = 32;
- bmh.bV4V4Compression = BI_BITFIELDS;
- bmh.bV4AlphaMask = 0xFF000000;
- bmh.bV4RedMask = 0x00FF0000;
- bmh.bV4GreenMask = 0x0000FF00;
- bmh.bV4BlueMask = 0x000000FF;
+ ZeroMemory(&bmh,sizeof(bmh));
+ bmh.bV5Size = sizeof(bmh);
+ bmh.bV5Width = width;
+ bmh.bV5Height = -height; /* Invert the image */
+ bmh.bV5Planes = 1;
+ bmh.bV5BitCount = 32;
+ bmh.bV5Compression = BI_BITFIELDS;
+ bmh.bV5AlphaMask = 0xFF000000;
+ bmh.bV5RedMask = 0x00FF0000;
+ bmh.bV5GreenMask = 0x0000FF00;
+ bmh.bV5BlueMask = 0x000000FF;
ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO*)&bmh,
DIB_RGB_COLORS, (void**)&DIB_pixels, NULL, 0);
@@ -296,6 +298,9 @@ NetWMToWinIconAlpha(uint32_t *icon)
/* CreateIconIndirect() traditionally required DDBitmaps */
/* Systems from WinXP accept 32-bit ARGB DIBitmaps with full 8-bit alpha support */
/* The icon is created with a DIB + empty DDB mask (an MS example does the same) */
+ ii.fIcon = TRUE;
+ ii.xHotspot = 0;
+ ii.yHotspot = 0;
result = CreateIconIndirect(&ii);
DeleteObject(ii.hbmColor);
@@ -313,7 +318,7 @@ NetWMToWinIconThreshold(uint32_t *icon)
uint32_t *pixels = &icon[2];
int row, col;
HICON result;
- ICONINFO ii = {TRUE};
+ ICONINFO ii;
HDC hdc = GetDC(NULL);
HDC xorDC = CreateCompatibleDC(hdc);
@@ -341,6 +346,9 @@ NetWMToWinIconThreshold(uint32_t *icon)
DeleteDC(xorDC);
DeleteDC(andDC);
+ ii.fIcon = TRUE;
+ ii.xHotspot = 0;
+ ii.yHotspot = 0;
result = CreateIconIndirect(&ii);
DeleteObject(ii.hbmColor);