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 that?
Anyway, can you please give it a try and tell me if it works OK for you?