From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 2 +- dlls/opengl32/unix_thunks.c | 17 ++++++++++++++++- dlls/opengl32/unix_thunks.h | 3 +-- dlls/opengl32/unix_wgl.c | 25 ++++--------------------- 4 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 74b5f4a53d6..fabc11665c1 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -214,7 +214,6 @@ my %manual_unix_thunks = ); my %manual_wow64_thunks = ( - "glDeleteSync" => 1, "glGetBufferPointerv" => 1, "glGetBufferPointervARB" => 1, "glGetNamedBufferPointerv" => 1, @@ -248,6 +247,7 @@ my %manual_wow64_thunks = my %manual_wow64_wrappers = ( "glClientWaitSync" => 1, + "glDeleteSync" => 1, "glFenceSync" => 1, ); my %pointer_array_count = diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index dbd2ed47b8b..a95c67213ae 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -6493,7 +6493,7 @@ static NTSTATUS ext_glDeleteStatesNV( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_glDeleteSync( void *args ) +static NTSTATUS ext_glDeleteSync( void *args ) { struct glDeleteSync_params *params = args; const struct opengl_funcs *funcs = params->teb->glTable; @@ -41582,6 +41582,21 @@ static NTSTATUS wow64_ext_glDeleteStatesNV( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_ext_glDeleteSync( void *args ) +{ + struct + { + PTR32 teb; + PTR32 sync; + } *params = args; + TEB *teb = get_teb64( params->teb ); + pthread_mutex_lock( &wgl_lock ); + wow64_glDeleteSync( teb, ULongToPtr(params->sync) ); + pthread_mutex_unlock( &wgl_lock ); + set_context_attribute( teb, -1 /* unsupported */, NULL, 0 ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_ext_glDeleteTexturesEXT( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index f76dbe410f9..bc30e3672b8 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -32,6 +32,7 @@ extern BOOL wrap_wglSetPbufferAttribARB( TEB *teb , HPBUFFERARB hPbuffer, const
#ifdef _WIN64 extern GLenum wow64_glClientWaitSync( TEB *teb , GLsync sync, GLbitfield flags, GLuint64 timeout ); +extern void wow64_glDeleteSync( TEB *teb , GLsync sync ); extern GLsync wow64_glFenceSync( TEB *teb , GLenum condition, GLbitfield flags ); #endif
@@ -39,8 +40,6 @@ extern NTSTATUS wgl_wglGetProcAddress( void *args ); extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ); extern NTSTATUS gl_glGetString( void *args ); extern NTSTATUS wow64_gl_glGetString( void *args ); -extern NTSTATUS ext_glDeleteSync( void *args ); -extern NTSTATUS wow64_ext_glDeleteSync( void *args ); extern NTSTATUS ext_glGetBufferPointerv( void *args ); extern NTSTATUS wow64_ext_glGetBufferPointerv( void *args ); extern NTSTATUS ext_glGetBufferPointervARB( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 25c82bec6c8..54cd0bc6c88 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1703,33 +1703,16 @@ GLenum wow64_glClientWaitSync( TEB *teb, GLsync sync, GLbitfield flags, GLuint64 return funcs->p_glClientWaitSync( handle->u.sync, flags, timeout ); }
-NTSTATUS wow64_ext_glDeleteSync( void *args ) +void wow64_glDeleteSync( TEB *teb, GLsync sync ) { + const struct opengl_funcs *funcs = teb->glTable; struct wgl_handle *handle; - struct - { - PTR32 teb; - PTR32 sync; - } *params32 = args; - NTSTATUS status;
- pthread_mutex_lock( &wgl_lock ); - - if (!(handle = get_handle_ptr( ULongToPtr(params32->sync) ))) - status = STATUS_INVALID_HANDLE; - else + if ((handle = get_handle_ptr( sync ))) { - struct glDeleteSync_params params = - { - .teb = get_teb64(params32->teb), - .sync = handle->u.sync, - }; - status = ext_glDeleteSync( ¶ms ); + funcs->p_glDeleteSync( handle->u.sync ); free_handle_ptr( handle ); } - - pthread_mutex_unlock( &wgl_lock ); - return status; }
GLsync wow64_glFenceSync( TEB *teb, GLenum condition, GLbitfield flags )