Made wine_glGetString() return NULL on null gl context

Massimo Del Fedele max at veneto.com
Sun Jun 29 09:53:54 CDT 2008


Accordingly to Mr.Focht analysis, that one solves the glGetString() 
problem when called from a secondary thread with no context.

 From 6ec70816aa5aec48f4ff1a719c7887c121cf666e Mon Sep 17 00:00:00 2001
From: Massimo <massimo at micio-hp.(none)>
Date: Sun, 29 Jun 2008 16:42:57 +0200
Subject: Made wine_glGetString() return NULL on null gl context
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1.5.4.3"

This is a multi-part message in MIME format.
--------------1.5.4.3
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit

---
  dlls/opengl32/wgl.c |    6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)
--------------1.5.4.3
Content-Type: text/x-patch; 
name="6ec70816aa5aec48f4ff1a719c7887c121cf666e.diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; 
filename="6ec70816aa5aec48f4ff1a719c7887c121cf666e.diff"

diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 6fbdeb4..79d43f2 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -632,6 +632,12 @@ const GLubyte * WINAPI wine_glGetString( GLenum name )
    const GLubyte *ret;
    const char* GL_Extensions = NULL;

+  /* this is for buggy nvidia driver, crashing if called from a different
+     thread with no context... we just check for a valid context, and
+     return NULL if none */
+  if(NtCurrentTeb()->glContext == NULL)
+    return NULL;
+
    if (GL_EXTENSIONS != name) {
      ENTER_GL();
      ret = glGetString(name);

--------------1.5.4.3--




More information about the wine-patches mailing list