From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 19 +++----------- dlls/opengl32/thunks.c | 40 +++++++++++++++++++++++++--- dlls/opengl32/unix_thunks.c | 12 +++------ dlls/opengl32/unix_thunks.h | 8 +++--- dlls/opengl32/unix_wgl.c | 8 +++--- dlls/opengl32/unixlib.h | 12 --------- dlls/opengl32/wgl.c | 52 ------------------------------------- 7 files changed, 52 insertions(+), 99 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index ed75fa8634f..cf38747eae5 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -173,10 +173,6 @@ my %manual_win_thunks = ( "glGetString" => 1, "glGetStringi" => 1, - "glUnmapBuffer" => 1, - "glUnmapBufferARB" => 1, - "glUnmapNamedBuffer" => 1, - "glUnmapNamedBufferEXT" => 1, "wglChoosePixelFormatARB" => 1, "wglGetExtensionsStringARB" => 1, "wglGetExtensionsStringEXT" => 1, @@ -298,10 +294,10 @@ my %manual_wow64_wrappers = "glMapNamedBufferEXT" => 0, "glMapNamedBufferRange" => 0, "glMapNamedBufferRangeEXT" => 0, - "glUnmapBuffer" => 1, - "glUnmapBufferARB" => 1, - "glUnmapNamedBuffer" => 1, - "glUnmapNamedBufferEXT" => 1, + "glUnmapBuffer" => 0, + "glUnmapBufferARB" => 0, + "glUnmapNamedBuffer" => 0, + "glUnmapNamedBufferEXT" => 0, "glWaitSync" => 0, ); my %wow64_invalidate_buffer = @@ -529,11 +525,6 @@ sub generate_unix_thunk($$$$) $need_manual_thunk = 1 if $ret_type =~ /(GLsync|PROC|GLintptr|*)/; } } - if ($manual_wow64_wrappers{$name}) - { - $ret .= " PTR32 client_ptr;\n"; - $call_args .= " ¶ms->client_ptr,"; - } $ret .= " } *params = args;\n"; if (!$need_wrap && $need_manual_thunk) { @@ -653,7 +644,6 @@ sub generate_wrapper_declaration($$$) } $ret .= " " . $arg->textContent() . ","; } - $ret .= " PTR32 *client_ptr," if $manual_wow64_wrappers{$name}; $ret =~ s/,$/ /; $ret .= ");\n"; return $ret; @@ -758,7 +748,6 @@ sub generate_func_params($$) $ret .= sprintf " %s;\n", $arg->textContent(); } $ret .= sprintf " %sret;\n", $func->[0]->textContent() unless is_void_func($func); - $ret .= "#ifndef _WIN64\n void *client_ptr;\n#endif\n" if $manual_wow64_wrappers{$name}; $ret .= "};\n\n"; return $ret; } diff --git a/dlls/opengl32/thunks.c b/dlls/opengl32/thunks.c index 94f2df1878e..9872b11ceca 100644 --- a/dlls/opengl32/thunks.c +++ b/dlls/opengl32/thunks.c @@ -20723,6 +20723,42 @@ static void WINAPI glUnlockArraysEXT(void) if ((status = UNIX_CALL( glUnlockArraysEXT, &args ))) WARN( "glUnlockArraysEXT returned %#lx\n", status ); }
+static GLboolean WINAPI glUnmapBuffer( GLenum target ) +{ + struct glUnmapBuffer_params args = { .teb = NtCurrentTeb(), .target = target }; + NTSTATUS status; + TRACE( "target %d\n", target ); + if ((status = UNIX_CALL( glUnmapBuffer, &args ))) WARN( "glUnmapBuffer returned %#lx\n", status ); + return args.ret; +} + +static GLboolean WINAPI glUnmapBufferARB( GLenum target ) +{ + struct glUnmapBufferARB_params args = { .teb = NtCurrentTeb(), .target = target }; + NTSTATUS status; + TRACE( "target %d\n", target ); + if ((status = UNIX_CALL( glUnmapBufferARB, &args ))) WARN( "glUnmapBufferARB returned %#lx\n", status ); + return args.ret; +} + +static GLboolean WINAPI glUnmapNamedBuffer( GLuint buffer ) +{ + struct glUnmapNamedBuffer_params args = { .teb = NtCurrentTeb(), .buffer = buffer }; + NTSTATUS status; + TRACE( "buffer %d\n", buffer ); + if ((status = UNIX_CALL( glUnmapNamedBuffer, &args ))) WARN( "glUnmapNamedBuffer returned %#lx\n", status ); + return args.ret; +} + +static GLboolean WINAPI glUnmapNamedBufferEXT( GLuint buffer ) +{ + struct glUnmapNamedBufferEXT_params args = { .teb = NtCurrentTeb(), .buffer = buffer }; + NTSTATUS status; + TRACE( "buffer %d\n", buffer ); + if ((status = UNIX_CALL( glUnmapNamedBufferEXT, &args ))) WARN( "glUnmapNamedBufferEXT returned %#lx\n", status ); + return args.ret; +} + static void WINAPI glUnmapObjectBufferATI( GLuint buffer ) { struct glUnmapObjectBufferATI_params args = { .teb = NtCurrentTeb(), .buffer = buffer }; @@ -24361,10 +24397,6 @@ static BOOL WINAPI wglSwapIntervalEXT( int interval ) }
extern const GLubyte * WINAPI glGetStringi( GLenum name, GLuint index ); -extern GLboolean WINAPI glUnmapBuffer( GLenum target ); -extern GLboolean WINAPI glUnmapBufferARB( GLenum target ); -extern GLboolean WINAPI glUnmapNamedBuffer( GLuint buffer ); -extern GLboolean WINAPI glUnmapNamedBufferEXT( GLuint buffer ); extern BOOL WINAPI wglChoosePixelFormatARB( HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats ); extern HDC WINAPI wglGetCurrentReadDCARB(void); extern const char * WINAPI wglGetExtensionsStringARB( HDC hdc ); diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 6c2be9b763c..727df735759 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -71801,10 +71801,9 @@ static NTSTATUS wow64_ext_glUnmapBuffer( void *args ) PTR32 teb; GLenum target; GLboolean ret; - PTR32 client_ptr; } *params = args; TEB *teb = get_teb64( params->teb ); - params->ret = wow64_glUnmapBuffer( teb, params->target, ¶ms->client_ptr ); + params->ret = wow64_glUnmapBuffer( teb, params->target ); set_context_attribute( teb, -1 /* unsupported */, NULL, 0 ); return STATUS_SUCCESS; } @@ -71816,10 +71815,9 @@ static NTSTATUS wow64_ext_glUnmapBufferARB( void *args ) PTR32 teb; GLenum target; GLboolean ret; - PTR32 client_ptr; } *params = args; TEB *teb = get_teb64( params->teb ); - params->ret = wow64_glUnmapBufferARB( teb, params->target, ¶ms->client_ptr ); + params->ret = wow64_glUnmapBufferARB( teb, params->target ); set_context_attribute( teb, -1 /* unsupported */, NULL, 0 ); return STATUS_SUCCESS; } @@ -71831,10 +71829,9 @@ static NTSTATUS wow64_ext_glUnmapNamedBuffer( void *args ) PTR32 teb; GLuint buffer; GLboolean ret; - PTR32 client_ptr; } *params = args; TEB *teb = get_teb64( params->teb ); - params->ret = wow64_glUnmapNamedBuffer( teb, params->buffer, ¶ms->client_ptr ); + params->ret = wow64_glUnmapNamedBuffer( teb, params->buffer ); set_context_attribute( teb, -1 /* unsupported */, NULL, 0 ); return STATUS_SUCCESS; } @@ -71846,10 +71843,9 @@ static NTSTATUS wow64_ext_glUnmapNamedBufferEXT( void *args ) PTR32 teb; GLuint buffer; GLboolean ret; - PTR32 client_ptr; } *params = args; TEB *teb = get_teb64( params->teb ); - params->ret = wow64_glUnmapNamedBufferEXT( teb, params->buffer, ¶ms->client_ptr ); + params->ret = wow64_glUnmapNamedBufferEXT( teb, params->buffer ); set_context_attribute( teb, -1 /* unsupported */, NULL, 0 ); return STATUS_SUCCESS; } diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index f032722bbc1..f3084ed237d 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -64,9 +64,9 @@ extern PTR32 wow64_glMapNamedBuffer( TEB *teb, GLuint buffer, GLenum access ); extern PTR32 wow64_glMapNamedBufferEXT( TEB *teb, GLuint buffer, GLenum access ); extern PTR32 wow64_glMapNamedBufferRange( TEB *teb, GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ); extern PTR32 wow64_glMapNamedBufferRangeEXT( TEB *teb, GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ); -extern GLboolean wow64_glUnmapBuffer( TEB *teb, GLenum target, PTR32 *client_ptr ); -extern GLboolean wow64_glUnmapBufferARB( TEB *teb, GLenum target, PTR32 *client_ptr ); -extern GLboolean wow64_glUnmapNamedBuffer( TEB *teb, GLuint buffer, PTR32 *client_ptr ); -extern GLboolean wow64_glUnmapNamedBufferEXT( TEB *teb, GLuint buffer, PTR32 *client_ptr ); +extern GLboolean wow64_glUnmapBuffer( TEB *teb, GLenum target ); +extern GLboolean wow64_glUnmapBufferARB( TEB *teb, GLenum target ); +extern GLboolean wow64_glUnmapNamedBuffer( TEB *teb, GLuint buffer ); +extern GLboolean wow64_glUnmapNamedBufferEXT( TEB *teb, GLuint buffer ); extern void wow64_glWaitSync( TEB *teb, GLsync sync, GLbitfield flags, GLuint64 timeout ); #endif diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 01071f4dced..bd37d661ce6 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -2454,13 +2454,13 @@ static GLboolean wow64_unmap_target_buffer( TEB *teb, GLenum target, PFN_glUnmap return ret; }
-GLboolean wow64_glUnmapBuffer( TEB *teb, GLenum target, PTR32 *client_ptr ) +GLboolean wow64_glUnmapBuffer( TEB *teb, GLenum target ) { const struct opengl_funcs *funcs = teb->glTable; return wow64_unmap_target_buffer( teb, target, funcs->p_glUnmapBuffer ); }
-GLboolean wow64_glUnmapBufferARB( TEB *teb, GLenum target, PTR32 *client_ptr ) +GLboolean wow64_glUnmapBufferARB( TEB *teb, GLenum target ) { const struct opengl_funcs *funcs = teb->glTable; return wow64_unmap_target_buffer( teb, target, funcs->p_glUnmapBufferARB ); @@ -2478,13 +2478,13 @@ static GLboolean wow64_gl_unmap_named_buffer( TEB *teb, GLuint name, PFN_glUnmap return ret; }
-GLboolean wow64_glUnmapNamedBuffer( TEB *teb, GLuint buffer, PTR32 *client_ptr ) +GLboolean wow64_glUnmapNamedBuffer( TEB *teb, GLuint buffer ) { const struct opengl_funcs *funcs = teb->glTable; return wow64_gl_unmap_named_buffer( teb, buffer, funcs->p_glUnmapNamedBuffer ); }
-GLboolean wow64_glUnmapNamedBufferEXT( TEB *teb, GLuint buffer, PTR32 *client_ptr ) +GLboolean wow64_glUnmapNamedBufferEXT( TEB *teb, GLuint buffer ) { const struct opengl_funcs *funcs = teb->glTable; return wow64_gl_unmap_named_buffer( teb, buffer, funcs->p_glUnmapNamedBufferEXT ); diff --git a/dlls/opengl32/unixlib.h b/dlls/opengl32/unixlib.h index 649d7e8b3b8..a232b737dd3 100644 --- a/dlls/opengl32/unixlib.h +++ b/dlls/opengl32/unixlib.h @@ -21712,9 +21712,6 @@ struct glUnmapBuffer_params TEB *teb; GLenum target; GLboolean ret; -#ifndef _WIN64 - void *client_ptr; -#endif };
struct glUnmapBufferARB_params @@ -21722,9 +21719,6 @@ struct glUnmapBufferARB_params TEB *teb; GLenum target; GLboolean ret; -#ifndef _WIN64 - void *client_ptr; -#endif };
struct glUnmapNamedBuffer_params @@ -21732,9 +21726,6 @@ struct glUnmapNamedBuffer_params TEB *teb; GLuint buffer; GLboolean ret; -#ifndef _WIN64 - void *client_ptr; -#endif };
struct glUnmapNamedBufferEXT_params @@ -21742,9 +21733,6 @@ struct glUnmapNamedBufferEXT_params TEB *teb; GLuint buffer; GLboolean ret; -#ifndef _WIN64 - void *client_ptr; -#endif };
struct glUnmapObjectBufferATI_params diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index a9ef28ec85d..6125d9a4574 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -1690,58 +1690,6 @@ const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum return args.ret; }
-static GLboolean gl_unmap_buffer( enum unix_funcs code, GLenum target ) -{ - struct glUnmapBuffer_params args = - { - .teb = NtCurrentTeb(), - .target = target, - }; - NTSTATUS status; - - TRACE( "target %d\n", target ); - - status = WINE_UNIX_CALL( code, &args ); - if (status) WARN( "glUnmapBuffer returned %#lx\n", status ); - return args.ret; -} - -GLboolean WINAPI glUnmapBuffer( GLenum target ) -{ - return gl_unmap_buffer( unix_glUnmapBuffer, target ); -} - -GLboolean WINAPI glUnmapBufferARB( GLenum target ) -{ - return gl_unmap_buffer( unix_glUnmapBufferARB, target ); -} - -static GLboolean gl_unmap_named_buffer( enum unix_funcs code, GLuint buffer ) -{ - struct glUnmapNamedBuffer_params args = - { - .teb = NtCurrentTeb(), - .buffer = buffer, - }; - NTSTATUS status; - - TRACE( "buffer %d\n", buffer ); - - status = WINE_UNIX_CALL( code, &args ); - if (status) WARN( "glUnmapNamedBuffer returned %#lx\n", status ); - return args.ret; -} - -GLboolean WINAPI glUnmapNamedBuffer( GLuint buffer ) -{ - return gl_unmap_named_buffer( unix_glUnmapNamedBuffer, buffer ); -} - -GLboolean WINAPI glUnmapNamedBufferEXT( GLuint buffer ) -{ - return gl_unmap_named_buffer( unix_glUnmapNamedBufferEXT, buffer ); -} - typedef void (WINAPI *gl_debug_message)(GLenum, GLenum, GLuint, GLenum, GLsizei, const GLchar *, const void *);
static NTSTATUS WINAPI call_gl_debug_message_callback( void *args, ULONG size )