From 05b052fee2fb6d6a6db83ec5855ad8971e100051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 22 Apr 2019 18:29:43 +0200 Subject: [PATCH] [OPENGL32] Fix the order of the specified callbacks for the DrvSetCallbackProcs() call. References: - https://github.com/OpenSWR/openswr/blob/master/ogldriver/wgl.cpp - https://github.com/Igalia/mesa/blob/master/src/gallium/state_trackers/wgl/stw_icd.h - "OpenGL Installable Client Driver, Version 1.101 -- Reference Guide" by Microsoft Corporation. --- dll/opengl/opengl32/icdload.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dll/opengl/opengl32/icdload.c b/dll/opengl/opengl32/icdload.c index 0f4c65a7820..fc86d863631 100644 --- a/dll/opengl/opengl32/icdload.c +++ b/dll/opengl/opengl32/icdload.c @@ -287,10 +287,11 @@ custom_end: DrvSetCallbackProcs = (void*)GetProcAddress(data->hModule, "DrvSetCallbackProcs"); if(DrvSetCallbackProcs) { - PROC callbacks[] = {(PROC)wglGetCurrentValue, + PROC callbacks[] = { (PROC)wglSetCurrentValue, + (PROC)wglGetCurrentValue, (PROC)wglGetDHGLRC}; - DrvSetCallbackProcs(3, callbacks); + DrvSetCallbackProcs(ARRAYSIZE(callbacks), callbacks); } /* Get the DLL exports */