From a4c82de831fcd928e5b91cbf1f3bc51bf27e5ae9 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 8 Dec 2014 17:10:02 +0000 Subject: [PATCH] [Shell32] - Use a timeout to send WM_COPYDATA. - Recall reading, while being sent to a thread that is hung indefinitely or blocked, it will not return properly. This seems to be the case for CORE-8779. Play it safe and use a timeout. svn path=/trunk/; revision=65589 --- reactos/dll/win32/shell32/systray.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/shell32/systray.cpp b/reactos/dll/win32/shell32/systray.cpp index 6fc578f0e58..ddf569fb8d9 100644 --- a/reactos/dll/win32/shell32/systray.cpp +++ b/reactos/dll/win32/shell32/systray.cpp @@ -50,8 +50,8 @@ static BOOL SHELL_NotifyIcon(DWORD dwMessage, void* pnid, HWND nid_hwnd, DWORD n data.lpData = pnotify_data; for(hwnd = 0; (hwnd = FindWindowExW(0, hwnd, L"Shell_TrayWnd", NULL)); ) - if ((unicode ? SendMessageW : SendMessageA)(hwnd, WM_COPYDATA, (WPARAM)nid_hwnd, (LPARAM)&data)) - ret = TRUE; + if ((unicode ? SendMessageTimeoutW : SendMessageTimeoutA)(hwnd, WM_COPYDATA, (WPARAM)nid_hwnd, (LPARAM)&data, SMTO_BLOCK|SMTO_ABORTIFHUNG, 4000, (PDWORD_PTR)&ret)) + return ret; return ret; }