WGL: wglDeleteContext should fail on garbage handles [attempt2]

Alexandre Julliard julliard at winehq.org
Mon Feb 25 13:34:46 CST 2008

"Roderick Colenbrander" <thunderbird2k at gmx.net> writes:

> Subject: [PATCH] wglDeleteContext should fail on a garbage hglrc. When
> we receive garbage ctx->hdc is invalid which leads to a
> crash. Retrieve a default DC and use it to pass hglrc to the display
> driver. Luckily the opengl code maintains a list of valid opengl
> contexts, so it can detect whether the hglrc is valid or not. :)

If we are going to go in this direction, then the context should be made
opaque in gdi32, and all calls should use the default DC. The
alternative is to make the context a proper GDI handle, and have GDI
check it for validity first.

Alexandre Julliard
julliard at winehq.org

More information about the wine-devel mailing list