Zhiyi Zhang (@zhiyi) commented about dlls/comctl32/treeview.c:
}
static BOOL -TREEVIEW_SendSimpleNotify(const TREEVIEW_INFO *infoPtr, UINT code) +TREEVIEW_SendSimpleNotify(const TREEVIEW_INFO *infoPtr, UINT code, BOOL *result) { NMHDR hdr;
- return TREEVIEW_SendRealNotify(infoPtr, code, &hdr);
- HWND hwnd;
- hwnd = infoPtr->hwnd; /* save hwnd before after TREEVIEW_SendRealNotify(), the window could be already destroyed after sending notifications */
- if (result)
*result = TREEVIEW_SendRealNotify(infoPtr, code, &hdr);
This is wrong. TREEVIEW_SendRealNotify() only gets called when `result` is not NULL. So things like `TREEVIEW_SendSimpleNotify(infoPtr, NM_RETURN, NULL);` basically do nothing. You should store the result in an intermediate variable, then assign it to `result` if it's not NULL.