Roderick Colenbrander : wgl: Fix wglGetProcAddress bug.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Dec 28 07:40:27 CST 2006


Module: wine
Branch: master
Commit: 402d2777654c068597f2f322f9323954865eb6c1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=402d2777654c068597f2f322f9323954865eb6c1

Author: Roderick Colenbrander <thunderbird2k at gmx.net>
Date:   Thu Dec 28 01:34:27 2006 +0100

wgl: Fix wglGetProcAddress bug.

---

 dlls/opengl32/wgl.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 684e935..e398a4d 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -223,6 +223,9 @@ PROC WINAPI wglGetProcAddress(LPCSTR  lp
 
   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  lp
   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 */




More information about the wine-cvs mailing list