From: Ken Thomases Subject: opengl32: Fix get_current_context_type() to not shift the type bits down. Message-Id: <26625FFA-17DB-4CC2-AD20-95BE7BACCC72@codeweavers.com> Date: Mon, 2 Feb 2015 15:51:42 -0600 The result is compared directly with handle type values like HANDLE_CONTEXT whose meaningful values are in the high nibble. Fixes a crash on OS X due to the OpenGL 3.x path being taken for a 2.x context. --- dlls/opengl32/wgl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index cb91699..6ff54f0 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -165,7 +165,7 @@ static void free_handle_ptr( struct wgl_handle *ptr ) static inline enum wgl_handle_type get_current_context_type(void) { if (!NtCurrentTeb()->glCurrentRC) return HANDLE_CONTEXT; - return (LOWORD(NtCurrentTeb()->glCurrentRC) & HANDLE_TYPE_MASK) >> 12; + return LOWORD(NtCurrentTeb()->glCurrentRC) & HANDLE_TYPE_MASK; } /***********************************************************************