[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
This commit is contained in:
James Tabor 2014-12-08 17:10:02 +00:00
parent f9e8e07d32
commit a4c82de831

View file

@ -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;
}