From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 2 +- dlls/opengl32/unix_thunks.c | 20 +++++++++++++++++++- dlls/opengl32/unix_thunks.h | 3 +-- dlls/opengl32/unix_wgl.c | 34 +++------------------------------- 4 files changed, 24 insertions(+), 35 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index fabc11665c1..78d51dea8ea 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, - "glGetSynciv" => 1, "glIsSync" => 1, "glMapBuffer" => 1, "glMapBufferARB" => 1, @@ -249,6 +248,7 @@ my %manual_wow64_wrappers = "glClientWaitSync" => 1, "glDeleteSync" => 1, "glFenceSync" => 1, + "glGetSynciv" => 1, ); my %pointer_array_count = ( diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index a95c67213ae..4ab92a1bcd2 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -10799,7 +10799,7 @@ static NTSTATUS ext_glGetSubroutineUniformLocation( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_glGetSynciv( void *args ) +static NTSTATUS ext_glGetSynciv( void *args ) { struct glGetSynciv_params *params = args; const struct opengl_funcs *funcs = params->teb->glTable; @@ -49488,6 +49488,24 @@ static NTSTATUS wow64_ext_glGetSubroutineUniformLocation( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_ext_glGetSynciv( void *args ) +{ + struct + { + PTR32 teb; + PTR32 sync; + GLenum pname; + GLsizei count; + PTR32 length; + PTR32 values; + } *params = args; + TEB *teb = get_teb64( params->teb ); + pthread_mutex_lock( &wgl_lock ); + wow64_glGetSynciv( teb, ULongToPtr(params->sync), params->pname, params->count, ULongToPtr(params->length), ULongToPtr(params->values) ); + pthread_mutex_unlock( &wgl_lock ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_ext_glGetTexBumpParameterfvATI( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index bc30e3672b8..a2e4d2eca51 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -34,6 +34,7 @@ extern BOOL wrap_wglSetPbufferAttribARB( TEB *teb , HPBUFFERARB hPbuffer, const 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 ); +extern void wow64_glGetSynciv( TEB *teb , GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values ); #endif
extern NTSTATUS wgl_wglGetProcAddress( void *args ); @@ -50,8 +51,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_glGetSynciv( void *args ); -extern NTSTATUS wow64_ext_glGetSynciv( void *args ); extern NTSTATUS ext_glIsSync( void *args ); extern NTSTATUS wow64_ext_glIsSync( void *args ); extern NTSTATUS ext_glMapBuffer( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 54cd0bc6c88..f66e5340163 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1728,40 +1728,12 @@ GLsync wow64_glFenceSync( TEB *teb, GLenum condition, GLbitfield flags ) return handle; }
-NTSTATUS wow64_ext_glGetSynciv( void *args ) +void wow64_glGetSynciv( TEB *teb, GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values ) { + const struct opengl_funcs *funcs = teb->glTable; struct wgl_handle *handle; - struct - { - PTR32 teb; - PTR32 sync; - GLenum pname; - GLsizei count; - PTR32 length; - PTR32 values; - } *params32 = args; - NTSTATUS status;
- pthread_mutex_lock( &wgl_lock ); - - if (!(handle = get_handle_ptr( ULongToPtr(params32->sync) ))) - status = STATUS_INVALID_HANDLE; - else - { - struct glGetSynciv_params params = - { - .teb = get_teb64(params32->teb), - .sync = handle->u.sync, - .pname = params32->pname, - .count = params32->count, - .length = ULongToPtr(params32->length), - .values = ULongToPtr(params32->values), - }; - status = ext_glGetSynciv( ¶ms ); - } - - pthread_mutex_unlock( &wgl_lock ); - return status; + if ((handle = get_handle_ptr( sync ))) funcs->p_glGetSynciv( handle->u.sync, pname, count, length, values ); }
NTSTATUS wow64_ext_glIsSync( void *args )