[ros-diffs] [cwittich] 37017: sync Shell_NotifyIconW with wine 1.1.7

cwittich at svn.reactos.org cwittich at svn.reactos.org
Mon Oct 27 10:49:28 CET 2008


Author: cwittich
Date: Mon Oct 27 04:49:27 2008
New Revision: 37017

URL: http://svn.reactos.org/svn/reactos?rev=37017&view=rev
Log:
sync Shell_NotifyIconW with wine 1.1.7

Modified:
    trunk/reactos/dll/win32/shell32/systray.c

Modified: trunk/reactos/dll/win32/shell32/systray.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/systray.c?rev=37017&r1=37016&r2=37017&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/systray.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/systray.c [iso-8859-1] Mon Oct 27 04:49:27 2008
@@ -104,6 +104,7 @@
     HWND tray;
     COPYDATASTRUCT cds;
     char *buffer = NULL;
+    BOOL ret;
 
     TRACE("dwMessage = %d, nid->cbSize=%d\n", dwMessage, nid->cbSize);
 
@@ -169,7 +170,11 @@
         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 @@
         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;
 }



More information about the Ros-diffs mailing list