gdi32: Check the current context in wglMakeCurrent().

This commit is contained in:
Rico Schüller 2009-09-19 15:52:36 +02:00 committed by Alexandre Julliard
parent 8c414df17f
commit 43ce10d168
1 changed files with 8 additions and 0 deletions

View File

@ -193,7 +193,15 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
/* When the context hglrc is NULL, the HDC is ignored and can be NULL.
* In that case use the global hDC to get access to the driver. */
if(hglrc == NULL)
{
if( hdc == NULL && !wglGetCurrentContext() )
{
WARN( "Current context is NULL\n");
SetLastError( ERROR_INVALID_HANDLE );
return FALSE;
}
dc = OPENGL_GetDefaultDC();
}
else
dc = get_dc_ptr( hdc );