sync Shell_NotifyIconW with wine 1.1.7

svn path=/trunk/; revision=37017
This commit is contained in:
Christoph von Wittich 2008-10-27 09:49:27 +00:00
parent 7d97d478db
commit 09501bc1c2

View file

@ -104,6 +104,7 @@ BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW nid)
HWND tray;
COPYDATASTRUCT cds;
char *buffer = NULL;
BOOL ret;
TRACE("dwMessage = %d, nid->cbSize=%d\n", dwMessage, nid->cbSize);
@ -169,7 +170,11 @@ BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW nid)
GetBitmapBits(iconinfo.hbmMask, cbMaskBits, buffer);
buffer += cbMaskBits;
GetBitmapBits(iconinfo.hbmColor, cbColourBits, buffer);
buffer += cbColourBits;
/* Reset pointer to allocated block so it can be freed later.
* Note that cds.lpData cannot be passed to HeapFree since it
* points to nid when no icon info is found. */
buffer = cds.lpData;
DeleteObject(iconinfo.hbmMask);
DeleteObject(iconinfo.hbmColor);
@ -181,11 +186,11 @@ noicon:
cds.lpData = nid;
}
SendMessageW(tray, WM_COPYDATA, (WPARAM)nid->hWnd, (LPARAM)&cds);
ret = SendMessageW(tray, WM_COPYDATA, (WPARAM)nid->hWnd, (LPARAM)&cds);
/* FIXME: if statement only needed because we don't support interprocess
* icon handles */
HeapFree(GetProcessHeap(), 0, buffer);
return TRUE;
return ret;
}