"Roderick Colenbrander" thunderbird2k@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.