user32/gdi32: Fix for a crash in create_alpha_bitmap()

Alexandre Julliard julliard at
Mon Jan 31 09:01:39 CST 2011

Peter Schlaile <peter at> writes:

> And: do you want to say, that there is a page fault handler within
> wine, that can handle *that* case above?

Yes, that's how DIBs work in Wine.

> In either way, I hope we can agree on the following:
> a) the app is *not* broken (at least not regarding it's usage of
>    CreateIconFromResourceEx() )
> b) wine code *is* broken here
> c) we can work around the problem within create_alpha_bitmap() or
> d) make StretchDIBits() a function a lot less surprising to call...

There's nothing surprising here. The page protection is transparent to
the app, and exceptions are handled by Wine. It's only because the app
breaks exception handling that you get problems.

> At least, they seem to install the handler in such a clever way, that
> no problems seem to occur within Windows (several different versions).
> That said: I'd have prefered, if they didn't do that, since it made my
> debugging session a lot longer...

They don't install it in a clever way, that's the whole problem. They
simply blindly override any other installed handler. The only way to fix
it apart from writing a DIB engine would be to add a special hack to
make the DIB exception handler take priority over the app broken

Alexandre Julliard
julliard at

More information about the wine-devel mailing list