https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b7c3398f95d0aa54f2b5bd1acae0bef496af7e29

commit b7c3398f95d0aa54f2b5bd1acae0bef496af7e29
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Sun Feb 4 01:54:55 2018 +0100
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sun Feb 4 01:57:02 2018 +0100

    [STOBJECT] Fully zero-out the full NOTIFYICONDATA structure (it wasn't 
zeroed out correctly in MSVC build).
---
 dll/shellext/stobject/csystray.cpp | 5 +++--
 dll/shellext/stobject/hotplug.cpp  | 6 ++++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/dll/shellext/stobject/csystray.cpp 
b/dll/shellext/stobject/csystray.cpp
index 89bd5c5ac0..f75f25d54c 100644
--- a/dll/shellext/stobject/csystray.cpp
+++ b/dll/shellext/stobject/csystray.cpp
@@ -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;
diff --git a/dll/shellext/stobject/hotplug.cpp 
b/dll/shellext/stobject/hotplug.cpp
index 5c6d3099a8..9550d23960 100644
--- a/dll/shellext/stobject/hotplug.cpp
+++ b/dll/shellext/stobject/hotplug.cpp
@@ -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();
 

Reply via email to