listview: infoPtr might be invalid after WM_NOTIFY

Robert Shearman rob at
Tue Sep 20 16:20:50 CDT 2005

Michael Jung wrote:

>Hello Alexandre, Dimi and Phil,
>This is a patch for the infoPtr problem in comctl32's listview.c. I guess it 
>matches your suggestion on IRC? I've only changed the minimum necessary to 
>get rid of the file dialog crash. If that's the correct approach in your 
>opinion, I will continue to work on this. I will be on vacation for three 
>weeks, though, starting from Friday.
>Dimi, if you think this is ugly, or if you are working on a better solution, 
>please do protest. 
>	infoPtr might be invalid after a WM_NOTIFY message was sent, since the 
>application might have destroyed the listview. Pass around hwnd instead and 
>call GetWindowLongPtr, if we have to access the listview instance data. 
>Spotted by Phil Krylov.

Since this was a behaviour in our file open dialog, did we even verify 
that this was a listview bug or is it that destroying the listview in 
the middle of a notification is something that you shouldn't do? If the 
latter, then one could easily modify the file dialog to post a message 
to itself to destroy the listview after the listview has finished 
processing the message that caused the notification.

Rob Shearman

More information about the wine-devel mailing list