Re: comctl32: Don't crash when getting a bad image list handle. (try 2)

2011-09-19 Thread Nikolay Sivov
On 9/19/2011 20:45, Chris Robinson wrote: On Monday, September 19, 2011 4:09:29 PM Francois Gouget wrote: I prefer this construct as using IsBadReadPtr() would introduce a race in is_valid(). Of course calling is_valid() is in itself racy anyway. So I don't mind switching over if that's preferre

Re: comctl32: Don't crash when getting a bad image list handle. (try 2)

2011-09-19 Thread Chris Robinson
On Monday, September 19, 2011 4:09:29 PM Francois Gouget wrote: > I prefer this construct as using IsBadReadPtr() would introduce a race > in is_valid(). Of course calling is_valid() is in itself racy anyway. So > I don't mind switching over if that's preferred (the code would have > fewer lines).

Re: comctl32: Don't crash when getting a bad image list handle. (try 2)

2011-09-19 Thread Francois Gouget
On Mon, 19 Sep 2011, Nikolay Sivov wrote: [...] > > static inline BOOL is_valid(HIMAGELIST himl) > > { > > -return himl&& himl->lpVtbl ==&ImageListImpl_Vtbl; > > +BOOL valid; > > +__TRY > > +{ > > +valid = himl&& himl->lpVtbl ==&ImageListImpl_Vtbl; > > +} > > +

Re: comctl32: Don't crash when getting a bad image list handle. (try 2)

2011-09-19 Thread Nikolay Sivov
On 9/19/2011 17:32, Francois Gouget wrote: --- Don't return from inside the block this time. dlls/comctl32/imagelist.c | 13 - dlls/comctl32/tests/imagelist.c | 17 +++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/imagelis

Re: comctl32: Don't crash when getting a bad image list handle.

2011-09-19 Thread Alexandre Julliard
Francois Gouget writes: > @@ -3587,7 +3588,15 @@ static const IImageListVtbl ImageListImpl_Vtbl = { > > static inline BOOL is_valid(HIMAGELIST himl) > { > -return himl && himl->lpVtbl == &ImageListImpl_Vtbl; > +__TRY > +{ > +return himl && himl->lpVtbl == &ImageListImpl_Vt