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

commit 4207397963f4adaa3c19104e075646a9c3b956e2
Author:     Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org>
AuthorDate: Sun Feb 4 17:21:58 2018 +0100
Commit:     Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org>
CommitDate: Sun Feb 4 18:11:49 2018 +0100

    [STOBJECT] Don't hardcode variable type in sizeof.
---
 dll/shellext/stobject/csystray.cpp | 2 +-
 dll/shellext/stobject/hotplug.cpp  | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dll/shellext/stobject/csystray.cpp 
b/dll/shellext/stobject/csystray.cpp
index 89bd5c5ac0..d1e51c116e 100644
--- a/dll/shellext/stobject/csystray.cpp
+++ b/dll/shellext/stobject/csystray.cpp
@@ -125,7 +125,7 @@ HRESULT CSysTray::NotifyIcon(INT code, UINT uId, HICON 
hIcon, LPCWSTR szTip, DWO
 
     TRACE("NotifyIcon code=%d, uId=%d, hIcon=%p, szTip=%S\n", code, uId, 
hIcon, szTip);
 
-    nim.cbSize = sizeof(NOTIFYICONDATA);
+    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..9af5eef972 100644
--- a/dll/shellext/stobject/hotplug.cpp
+++ b/dll/shellext/stobject/hotplug.cpp
@@ -101,7 +101,8 @@ 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);
+
+    nim.cbSize = sizeof(nim);
     nim.uID = uId;
     nim.hWnd = pSysTray->GetHWnd();
 

Reply via email to