From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 1 - dlls/opengl32/unix_thunks.c | 21 ++++++++++++++++++++- dlls/opengl32/unix_thunks.h | 2 -- dlls/opengl32/unix_wgl.c | 23 ----------------------- 4 files changed, 20 insertions(+), 27 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 3da5e0b5074..204e226922c 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -238,7 +238,6 @@ my %manual_wow64_thunks = "glUnmapNamedBuffer" => 1, "glUnmapNamedBufferEXT" => 1, "glWaitSync" => 1, - "wglCreateContextAttribsARB" => 1, "wglCreatePbufferARB" => 1, "wglGetExtensionsStringARB" => 1, "wglGetExtensionsStringEXT" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 8df8c9eb2f4..f544d723739 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -26658,7 +26658,7 @@ static NTSTATUS ext_wglChoosePixelFormatARB( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_wglCreateContextAttribsARB( void *args ) +static NTSTATUS ext_wglCreateContextAttribsARB( void *args ) { struct wglCreateContextAttribsARB_params *params = args; const struct opengl_funcs *funcs = get_dc_funcs( params->hDC ); @@ -78222,6 +78222,25 @@ static NTSTATUS wow64_ext_wglChoosePixelFormatARB( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) +{ + struct + { + PTR32 teb; + PTR32 hDC; + PTR32 hShareContext; + PTR32 attribList; + PTR32 ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + const struct opengl_funcs *funcs = get_dc_funcs( ULongToPtr(params->hDC) ); + if (!funcs || !funcs->p_wglCreateContextAttribsARB) return STATUS_NOT_IMPLEMENTED; + pthread_mutex_lock( &wgl_lock ); + params->ret = (UINT_PTR)wrap_wglCreateContextAttribsARB( teb, ULongToPtr(params->hDC), ULongToPtr(params->hShareContext), ULongToPtr(params->attribList) ); + pthread_mutex_unlock( &wgl_lock ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_ext_wglDestroyPbufferARB( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index f83025c2830..5b91de1ee20 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -82,8 +82,6 @@ extern NTSTATUS ext_glUnmapNamedBufferEXT( void *args ); extern NTSTATUS wow64_ext_glUnmapNamedBufferEXT( void *args ); extern NTSTATUS ext_glWaitSync( void *args ); extern NTSTATUS wow64_ext_glWaitSync( void *args ); -extern NTSTATUS ext_wglCreateContextAttribsARB( void *args ); -extern NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ); extern NTSTATUS ext_wglCreatePbufferARB( void *args ); extern NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ); extern NTSTATUS ext_wglGetExtensionsStringARB( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 5809d61ed0b..6560b0f3082 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1440,29 +1440,6 @@ static PTR32 find_wow64_string( const char *str, PTR32 wow64_str ) return wow64_str; }
-NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) -{ - struct - { - PTR32 teb; - PTR32 hDC; - PTR32 hShareContext; - PTR32 attribList; - PTR32 ret; - } *params32 = args; - struct wglCreateContextAttribsARB_params params = - { - .teb = get_teb64(params32->teb), - .hDC = ULongToPtr(params32->hDC), - .hShareContext = ULongToPtr(params32->hShareContext), - .attribList = ULongToPtr(params32->attribList), - }; - NTSTATUS status; - if ((status = ext_wglCreateContextAttribsARB( ¶ms ))) return status; - params32->ret = (UINT_PTR)params.ret; - return STATUS_SUCCESS; -} - NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) { struct