From 402d2777654c068597f2f322f9323954865eb6c1 Mon Sep 17 00:00:00 2001 From: Roderick Colenbrander Date: Thu, 28 Dec 2006 01:34:27 +0100 Subject: [PATCH] wgl: Fix wglGetProcAddress bug. --- dlls/opengl32/wgl.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 684e935ba86..e398a4de0b4 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -223,6 +223,9 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) { TRACE("(%s)\n", lpszProc); + if(lpszProc == NULL); + return NULL; + /* First, look if it's not already defined in the 'standard' OpenGL functions */ if ((local_func = GetProcAddress(opengl32_handle, lpszProc)) != NULL) { TRACE(" found function in 'standard' OpenGL functions (%p)\n", local_func); @@ -234,10 +237,14 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) { ext_ret = (const OpenGL_extension *) bsearch(&ext, extension_registry, extension_registry_size, sizeof(OpenGL_extension), compar); - /* If nothing was found, we are looking for a WGL extension */ + /* If nothing was found, we are looking for a WGL extension or an unknown GL extension. */ if (ext_ret == NULL) { + /* If the function name starts with a w it is a WGL extension */ + if(lpszProc[0] == 'w') + return wine_wgl.p_wglGetProcAddress(lpszProc); + + /* We are dealing with an unknown GL extension. */ WARN("Extension '%s' not defined in opengl32.dll's function table!\n", lpszProc); - return wine_wgl.p_wglGetProcAddress(lpszProc); } else { /* We are looking for an OpenGL extension */ /* Check if the GL extension required by the function is available */