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).
Would it be feasible to keep a list or array of all pertinent HIMAGELIST objects, and just look up the handle in that list for validation? If it's kept sorted, you can even do a binary search for it instead of linear.