[STOBJECT] Don't hardcode variable type in sizeof.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 4 Feb 2018 16:21:58 +0000 (17:21 +0100)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 4 Feb 2018 17:11:49 +0000 (18:11 +0100)
dll/shellext/stobject/csystray.cpp
dll/shellext/stobject/hotplug.cpp

index 89bd5c5..d1e51c1 100644 (file)
@@ -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;
index 5c6d309..9af5eef 100644 (file)
@@ -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();