From 1bd5f9a9818eaa9d58bf913a56f42b0cca4ac49c Mon Sep 17 00:00:00 2001 From: Gregor Anich Date: Sat, 17 Jul 2004 15:13:37 +0000 Subject: [PATCH] Handle return value 0 from ExtEscape as special case (means to use the default driver) svn path=/trunk/; revision=10177 --- reactos/lib/opengl32/wgl.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/reactos/lib/opengl32/wgl.c b/reactos/lib/opengl32/wgl.c index d506c3a64fd..549a4207937 100644 --- a/reactos/lib/opengl32/wgl.c +++ b/reactos/lib/opengl32/wgl.c @@ -291,17 +291,20 @@ ROSGL_ICDForHDC( HDC hdc ) /* get driver name */ ret = ExtEscape( hdc, EXT_GET_DRIVERINFO, sizeof (dwInput), (LPCSTR)&dwInput, sizeof (EXTDRIVERINFO), (LPSTR)&info ); - if (ret < 0) + if (ret <= 0) { HKEY hKey; DWORD type, size; - DBGPRINT( "Warning: ExtEscape to get the drivername failed!!! (%d)", GetLastError() ); - if (MessageBox( WindowFromDC( hdc ), L"Couldn't get installable client driver name!\nUsing default driver.", - L"OPENGL32.dll: Warning", MB_OKCANCEL | MB_ICONWARNING ) == IDCANCEL) + if (ret < 0) { - SetLastError( ret ); - return NULL; + DBGPRINT( "Warning: ExtEscape to get the drivername failed!!! (%d)", GetLastError() ); + if (MessageBox( WindowFromDC( hdc ), L"Couldn't get installable client driver name!\nUsing default driver.", + L"OPENGL32.dll: Warning", MB_OKCANCEL | MB_ICONWARNING ) == IDCANCEL) + { + SetLastError( 0 ); + return NULL; + } } /* open registry key */