From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 1 - dlls/opengl32/unix_thunks.c | 19 ++++++++++++++++++- dlls/opengl32/unix_thunks.h | 2 -- dlls/opengl32/unix_wgl.c | 27 ++------------------------- 4 files changed, 20 insertions(+), 29 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index bd8bbb120d4..cbb7e4c0bc8 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -247,7 +247,6 @@ my %manual_wow64_thunks = "wglGetPbufferDCARB" => 1, "wglGetProcAddress" => 1, "wglGetProcAddress" => 1, - "wglMakeContextCurrentARB" => 1, "wglQueryCurrentRendererStringWINE" => 1, "wglQueryRendererStringWINE" => 1, ); diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 19aa9084a7a..cb8cfe2dc0d 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -26757,7 +26757,7 @@ static NTSTATUS ext_wglGetSwapIntervalEXT( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_wglMakeContextCurrentARB( void *args ) +static NTSTATUS ext_wglMakeContextCurrentARB( void *args ) { struct wglMakeContextCurrentARB_params *params = args; pthread_mutex_lock( &wgl_lock ); @@ -78289,6 +78289,23 @@ static NTSTATUS wow64_ext_wglGetSwapIntervalEXT( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ) +{ + struct + { + PTR32 teb; + PTR32 hDrawDC; + PTR32 hReadDC; + PTR32 hglrc; + BOOL ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + pthread_mutex_lock( &wgl_lock ); + params->ret = wrap_wglMakeContextCurrentARB( teb, ULongToPtr(params->hDrawDC), ULongToPtr(params->hReadDC), ULongToPtr(params->hglrc) ); + pthread_mutex_unlock( &wgl_lock ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_ext_wglQueryCurrentRendererIntegerWINE( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index 4171b0ca8e3..2384f6f5cab 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -96,8 +96,6 @@ extern NTSTATUS ext_wglGetExtensionsStringEXT( void *args ); extern NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ); extern NTSTATUS ext_wglGetPbufferDCARB( void *args ); extern NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ); -extern NTSTATUS ext_wglMakeContextCurrentARB( void *args ); -extern NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ); extern NTSTATUS ext_wglQueryCurrentRendererStringWINE( void *args ); extern NTSTATUS wow64_ext_wglQueryCurrentRendererStringWINE( void *args ); extern NTSTATUS ext_wglQueryRendererStringWINE( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 61643a9e0ac..ea50bac6bab 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1254,15 +1254,15 @@ BOOL wrap_wglMakeContextCurrentARB( TEB *teb, HDC draw_hdc, HDC read_hdc, HGLRC teb->glReserved1[1] = read_hdc; teb->glCurrentRC = hglrc; teb->glTable = (void *)funcs; - return TRUE; } - if (prev) + else if (prev) { if (!funcs->p_wglMakeCurrent( 0, NULL )) return FALSE; prev->tid = 0; teb->glCurrentRC = 0; teb->glTable = &null_opengl_funcs; } + update_teb32_context( teb ); return TRUE; }
@@ -1528,29 +1528,6 @@ NTSTATUS wow64_wgl_wglDeleteContext( void *args ) return status; }
-NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ) -{ - struct - { - PTR32 teb; - PTR32 hDrawDC; - PTR32 hReadDC; - PTR32 hglrc; - BOOL ret; - } *params32 = args; - struct wglMakeContextCurrentARB_params params = - { - .teb = get_teb64(params32->teb), - .hDrawDC = ULongToPtr(params32->hDrawDC), - .hReadDC = ULongToPtr(params32->hReadDC), - .hglrc = ULongToPtr(params32->hglrc), - }; - NTSTATUS status; - if (!(status = ext_wglMakeContextCurrentARB( ¶ms ))) update_teb32_context( params.teb ); - params32->ret = params.ret; - return status; -} - NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ) { struct