listview crash fix

Dimi Paun dimi at
Fri Sep 16 07:12:39 CDT 2005

On Wed, 2005-09-14 at 15:16 +0200, Michael Jung wrote:
> > To be honest, I don't like this solution at all, I'll try
> > a different approach tonight, but in the meanwhile...

OK, here it is, using exceptions instead of cluttering the
code with tests all over the place. Obviously, it is much
cleaner then other methods, but we've I know we've been 
hesitant to use exceptions in Wine unless absolutely 
necessary due to the cost of __TRY.

I've done some benchmarking and on my 3GHz CPU it takes
about 0.5us for a __TRY. Or about the equivalent of only
3 calls to GetWindowLongPtrW() or IsWindow(). In other
words, the cost is very low for our purpose here, and
certainly smaller then any other method. 

In fact, we can make this even faster by relying on the 
access violation exception instead of doing the IsWindow()
test after each notification, but I was afraid we'd cover
up other bugs (but there are ways around that too).

The only thing that I didn't know how to do is how to
come up with a custom exception code. How does one do

Anyway, can you please give it a try and tell me if it
works OK for you?

Dimi Paun <dimi at>
Lattica, Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: listview-non-window-B.diff
Type: text/x-patch
Size: 2269 bytes
Desc: not available
Url :

More information about the wine-devel mailing list