Hi Michael,
Can you try this out and let me know if it works please? To be honest, I don't like this solution at all, I'll try a different approach tonight, but in the meanwhile...
Hi Dimi,
On Wednesday 14 September 2005 14:24, Dimi Paun wrote:
Can you try this out and let me know if it works please?
Thanks, seems to work fine for me (no crash while browsing about 50 directories).
To be honest, I don't like this solution at all, I'll try a different approach tonight, but in the meanwhile...
I had a short discussion with Alexandre on IRC yesterday. He says that the basic problem is probably the passing around of the infoPtr to represent the listview instead of the handle. As far as I understood, we should probably change all functions to take a HWND instead of a LISTVIEW_INFO* parameter. We should then try to retrieve infoPtr via GetWindowLongPtrW as soon as we need it. And we should be aware that infoPtr might point to a free'd location after every SendMessage.
I've attached another patch, which fixes the crash in the file dialog applying this scheme. I've only changed as much as necessary to fix the problem, though.
Bye,
From: "Michael Jung" mjung@iss.tu-darmstadt.de
Thanks, seems to work fine for me (no crash while browsing about 50 directories).
Good, thanks.
I've attached another patch, which fixes the crash in the file dialog
applying
this scheme. I've only changed as much as necessary to fix the problem, though.
Yeah, this is one solution, but it pretty much means that after every function call we need to check the hwnd for validity. That's not really nice, to say the least. Give me a bit to get a chance to work on it.
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?
On Fri, 2005-09-16 at 08:12 -0400, Dimi Paun wrote:
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 [...]
Try this instead, I forgot you're not supposed to return directly out of a __TRY block.
Hi Dimi,
On Friday 16 September 2005 14:41, Dimi Paun wrote:
Try this instead, I forgot you're not supposed to return directly out of a __TRY block.
Seems to work fine for me (I had to add an ntdll import to the Makefile to get it to link). No crashes thus far.
Bye,
Is this one working for you? Sorry, not much tested here other than a quick compile, it's past 2:30am already...
Hi Dimi,
On Fri, 23 Sep 2005, Dimi Paun wrote:
Is this one working for you? Sorry, not much tested here other than a quick compile, it's past 2:30am already...
Sorry, I'm currently on vacation in Peru and won't be able to test this for the next three weeks.
Bye, -- Michael Jung mjung@iss.tu-darmstadt.de
On Mon, 2005-09-26 at 03:29 +0200, Michael Jung wrote:
Sorry, I'm currently on vacation in Peru and won't be able to test this for the next three weeks.
It's OK, I guess it can wait until you come back, or maybe Phil can take it for a spin in the meantime.
Dimi Paun wrote:
On Mon, 2005-09-26 at 03:29 +0200, Michael Jung wrote:
Sorry, I'm currently on vacation in Peru and won't be able to test this for the next three weeks.
It's OK, I guess it can wait until you come back, or maybe Phil can take it for a spin in the meantime.
It seems to fix the problem for me.
On Mon, 2005-09-26 at 08:22 -0700, Duane Clark wrote:
It seems to fix the problem for me.
Cool, thanks for the response, I'll submit a patch soon.
Dimi Paun dimi@lattica.com writes:
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.
IMO that's really ugly, and will cause no end of maintenance nightmares. You can't just jump out like that, you'll need to check every intermediate function to make sure it unwinds properly, frees allocated memory etc. In the end it's the same work as handling the error explicitly, but it makes the code much harder to follow.