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 | 29 ++++------------------------- 4 files changed, 22 insertions(+), 29 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 78d51dea8ea..73a1a4cf846 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -220,7 +220,6 @@ my %manual_wow64_thunks = "glGetNamedBufferPointervEXT" => 1, "glGetString" => 1, "glGetStringi" => 1, - "glIsSync" => 1, "glMapBuffer" => 1, "glMapBufferARB" => 1, "glMapBufferRange" => 1, @@ -249,6 +248,7 @@ my %manual_wow64_wrappers = "glDeleteSync" => 1, "glFenceSync" => 1, "glGetSynciv" => 1, + "glIsSync" => 1, ); my %pointer_array_count = ( diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 4ab92a1bcd2..ce0410a2414 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -12593,7 +12593,7 @@ static NTSTATUS ext_glIsStateNV( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_glIsSync( void *args ) +static NTSTATUS ext_glIsSync( void *args ) { struct glIsSync_params *params = args; const struct opengl_funcs *funcs = params->teb->glTable; @@ -52862,6 +52862,21 @@ static NTSTATUS wow64_ext_glIsStateNV( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_ext_glIsSync( void *args ) +{ + struct + { + PTR32 teb; + PTR32 sync; + GLboolean ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + pthread_mutex_lock( &wgl_lock ); + params->ret = wow64_glIsSync( teb, ULongToPtr(params->sync) ); + pthread_mutex_unlock( &wgl_lock ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_ext_glIsTextureEXT( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index a2e4d2eca51..0e7195d6e35 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -35,6 +35,7 @@ extern GLenum wow64_glClientWaitSync( TEB *teb , GLsync sync, GLbitfield flags, extern void wow64_glDeleteSync( TEB *teb , GLsync sync ); extern GLsync wow64_glFenceSync( TEB *teb , GLenum condition, GLbitfield flags ); extern void wow64_glGetSynciv( TEB *teb , GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values ); +extern GLboolean wow64_glIsSync( TEB *teb , GLsync sync ); #endif
extern NTSTATUS wgl_wglGetProcAddress( void *args ); @@ -51,8 +52,6 @@ extern NTSTATUS ext_glGetNamedBufferPointervEXT( void *args ); extern NTSTATUS wow64_ext_glGetNamedBufferPointervEXT( void *args ); extern NTSTATUS ext_glGetStringi( void *args ); extern NTSTATUS wow64_ext_glGetStringi( void *args ); -extern NTSTATUS ext_glIsSync( void *args ); -extern NTSTATUS wow64_ext_glIsSync( void *args ); extern NTSTATUS ext_glMapBuffer( void *args ); extern NTSTATUS wow64_ext_glMapBuffer( void *args ); extern NTSTATUS ext_glMapBufferARB( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index f66e5340163..5e196914be7 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1736,34 +1736,13 @@ void wow64_glGetSynciv( TEB *teb, GLsync sync, GLenum pname, GLsizei count, GLsi if ((handle = get_handle_ptr( sync ))) funcs->p_glGetSynciv( handle->u.sync, pname, count, length, values ); }
-NTSTATUS wow64_ext_glIsSync( void *args ) +GLboolean wow64_glIsSync( TEB *teb, GLsync sync ) { + const struct opengl_funcs *funcs = teb->glTable; struct wgl_handle *handle; - struct - { - PTR32 teb; - PTR32 sync; - GLboolean ret; - } *params32 = args; - NTSTATUS status; - - pthread_mutex_lock( &wgl_lock ); - - if (!(handle = get_handle_ptr( ULongToPtr(params32->sync) ))) - status = STATUS_INVALID_HANDLE; - else - { - struct glIsSync_params params = - { - .teb = get_teb64(params32->teb), - .sync = handle->u.sync, - }; - status = ext_glIsSync( ¶ms ); - params32->ret = params.ret; - }
- pthread_mutex_unlock( &wgl_lock ); - return status; + if (!(handle = get_handle_ptr( sync ))) return FALSE; + return funcs->p_glIsSync( handle->u.sync ); }
NTSTATUS wow64_ext_glWaitSync( void *args )