]> git.saurik.com Git - wxWidgets.git/commitdiff
hack to _really_ fix crashes in comctl32.dll when processing HDN_GETDISPINFO
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 23 Sep 2004 09:59:24 +0000 (09:59 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 23 Sep 2004 09:59:24 +0000 (09:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29274 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/listctrl.cpp

index 3c08663e15bf4dbd2d00fd0329db714b9c04b8ff..7c420ac16adf7c2782c42e9ca15d64f8ab3deee9 100644 (file)
@@ -1772,20 +1772,15 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
                 break;
 
             case HDN_GETDISPINFOW:
-                {
-                    LPNMHDDISPINFOW info = (LPNMHDDISPINFOW) lParam;
-                    // This is a fix for a strange bug under XP.
-                    // Normally, info->iItem is a valid index, but
-                    // sometimes this is a silly (large) number
-                    // and when we return false via wxControl::MSWOnNotify
-                    // to indicate that it hasn't yet been processed,
-                    // there's a GPF in Windows.
-                    // By returning true here, we avoid further processing
-                    // of this strange message.
-                    if ( (unsigned)info->iItem >= (unsigned)GetColumnCount() )
-                        return true;
-                }
-                // fall through
+                // letting Windows XP handle this message results in mysterious
+                // crashes in comctl32.dll seemingly because of bad message
+                // parameters
+                //
+                // I have no idea what is the real cause of the bug (which is,
+                // just to make things interesting, is impossible to reproduce
+                // reliably) but ignoring all these messages does fix it and
+                // doesn't seem to have any negative consequences
+                return true;
 
             default:
                 return wxControl::MSWOnNotify(idCtrl, lParam, result);