[PATCH 1/3] opengl32: add wrapper for wglCreateContext

Stefan Riesenberger stefan.riesenberger at gmail.com
Fri Feb 22 13:17:37 CST 2019


This prevents a stack overflow when using Reshade, which hooks these functions.

Signed-off-by: Stefan Riesenberger <stefan.riesenberger at gmail.com>
---
 dlls/opengl32/wgl.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 92410053d5..1d1a944bae 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -398,9 +398,9 @@ HDC WINAPI wglGetCurrentDC(void)
 }
 
 /***********************************************************************
- *		wglCreateContext (OPENGL32.@)
+ *		wgl_create_context wrapper for hooking
  */
-HGLRC WINAPI wglCreateContext(HDC hdc)
+HGLRC wgl_create_context(HDC hdc)
 {
     HGLRC ret = 0;
     struct wgl_context *drv_ctx;
@@ -419,6 +419,14 @@ HGLRC WINAPI wglCreateContext(HDC hdc)
     return ret;
 }
 
+/***********************************************************************
+ *		wglCreateContext (OPENGL32.@)
+ */
+HGLRC WINAPI wglCreateContext(HDC hdc)
+{
+    return wgl_create_context(hdc);
+}
+
 /***********************************************************************
  *		wglGetCurrentContext (OPENGL32.@)
  */
@@ -667,7 +675,7 @@ HGLRC WINAPI wglCreateLayerContext(HDC hdc,
   TRACE("(%p,%d)\n", hdc, iLayerPlane);
 
   if (iLayerPlane == 0) {
-      return wglCreateContext(hdc);
+      return wgl_create_context(hdc);
   }
   FIXME("no handler for layer %d\n", iLayerPlane);
 
-- 
2.20.1




More information about the wine-devel mailing list