[STOBJECT] Fully zero-out the full NOTIFYICONDATA structure (it wasn't zeroed out...
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 4 Feb 2018 00:54:55 +0000 (01:54 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 4 Feb 2018 00:57:02 +0000 (01:57 +0100)
dll/shellext/stobject/csystray.cpp
dll/shellext/stobject/hotplug.cpp

index 89bd5c5..f75f25d 100644 (file)
@@ -121,11 +121,12 @@ HRESULT CSysTray::ProcessIconMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, LR
 *--*/
 HRESULT CSysTray::NotifyIcon(INT code, UINT uId, HICON hIcon, LPCWSTR szTip, DWORD dwstate)
 {
-    NOTIFYICONDATA nim = { 0 };
+    NOTIFYICONDATA nim;
 
     TRACE("NotifyIcon code=%d, uId=%d, hIcon=%p, szTip=%S\n", code, uId, hIcon, szTip);
 
-    nim.cbSize = sizeof(NOTIFYICONDATA);
+    ZeroMemory(&nim, sizeof(nim));
+    nim.cbSize = sizeof(nim);
     nim.uFlags = NIF_MESSAGE | NIF_ICON | NIF_STATE | NIF_TIP;
     nim.hIcon = hIcon;
     nim.uID = uId;
index 5c6d309..9550d23 100644 (file)
@@ -100,8 +100,10 @@ HRESULT EnumHotpluggedDevices(CSimpleArray<DEVINST> &devList)
 *--*/
 HRESULT NotifyBalloon(CSysTray* pSysTray, LPCWSTR szTitle = NULL, LPCWSTR szInfo = NULL, UINT uId = ID_ICON_HOTPLUG)
 {
-    NOTIFYICONDATA nim = { 0 };
-    nim.cbSize = sizeof(NOTIFYICONDATA);
+    NOTIFYICONDATA nim;
+
+    ZeroMemory(&nim, sizeof(nim));
+    nim.cbSize = sizeof(nim);
     nim.uID = uId;
     nim.hWnd = pSysTray->GetHWnd();