From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 37 ++----------------------------------- dlls/opengl32/unix_thunks.c | 15 ++++++++++++++- dlls/opengl32/unix_thunks.h | 3 --- dlls/opengl32/unix_wgl.c | 19 ------------------- 4 files changed, 16 insertions(+), 58 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 8f246823839..821441361ee 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -212,11 +212,6 @@ my %manual_unix_thunks = "wglGetProcAddress" => 1, "wglSwapBuffers" => 1, ); -my %manual_wow64_thunks = - ( - "wglGetProcAddress" => 1, - "wglGetProcAddress" => 1, - ); my %manual_wow64_wrappers = ( "glClientWaitSync" => 0, @@ -374,8 +369,7 @@ sub generate_unix_thunk($$$$) $need_lock = 1 if $arg->textContent() =~ /HGLRC|HPBUFFERARB/; }
- $ret .= "static " unless !$is_wow64 && defined $manual_wow64_thunks{$name}; - $ret .= "NTSTATUS "; + $ret .= "static NTSTATUS "; $ret .= "wow64_" if $is_wow64; $ret .= "$prefix_$name( void *args )\n"; $ret .= "{\n"; @@ -1350,31 +1344,7 @@ foreach (sort keys %ext_functions) print OUT generate_wrapper_declaration($_, $ext_functions{$_}, 1); }
-print OUT "#endif\n\n"; - -foreach (sort keys %wgl_functions) -{ - next if defined $manual_win_functions{$_}; - next unless defined $manual_wow64_thunks{$_}; - print OUT "extern NTSTATUS wgl_$_( void *args );\n"; - print OUT "extern NTSTATUS wow64_wgl_$_( void *args );\n"; -} -foreach (sort keys %norm_functions) -{ - next if defined $manual_win_functions{$_}; - next unless defined $manual_wow64_thunks{$_}; - print OUT "extern NTSTATUS gl_$_( void *args );\n"; - print OUT "extern NTSTATUS wow64_gl_$_( void *args );\n"; -} -foreach (sort keys %ext_functions) -{ - next if $_ =~ /^egl/; # unix-side only API - next if defined $manual_win_functions{$_}; - next unless defined $manual_wow64_thunks{$_}; - print OUT "extern NTSTATUS ext_$_( void *args );\n"; - print OUT "extern NTSTATUS wow64_ext_$_( void *args );\n"; -} - +print OUT "#endif\n"; close OUT;
# @@ -1455,20 +1425,17 @@ print OUT "extern NTSTATUS wow64_get_pixel_formats( void *args );\n\n"; foreach (sort keys %wgl_functions) { next if defined $manual_win_functions{$_}; - next if defined $manual_wow64_thunks{$_}; print OUT generate_unix_thunk($_, $wgl_functions{$_}, 1, "wgl"); } foreach (sort keys %norm_functions) { next if defined $manual_win_functions{$_}; - next if defined $manual_wow64_thunks{$_}; print OUT generate_unix_thunk($_, $norm_functions{$_}, 1, "gl"); } foreach (sort keys %ext_functions) { next if $_ =~ /^egl/; # unix-side only API next if defined $manual_win_functions{$_}; - next if defined $manual_wow64_thunks{$_}; print OUT generate_unix_thunk($_, $ext_functions{$_}, 1, "ext"); }
diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index cf4d07e2a34..5ed52f35655 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -61,7 +61,7 @@ static NTSTATUS wgl_wglGetPixelFormat( void *args ) return STATUS_SUCCESS; }
-NTSTATUS wgl_wglGetProcAddress( void *args ) +static NTSTATUS wgl_wglGetProcAddress( void *args ) { struct wglGetProcAddress_params *params = args; params->ret = wrap_wglGetProcAddress( params->teb, params->lpszProc ); @@ -29962,6 +29962,19 @@ static NTSTATUS wow64_wgl_wglGetPixelFormat( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_wgl_wglGetProcAddress( void *args ) +{ + struct + { + PTR32 teb; + PTR32 lpszProc; + PTR32 ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + params->ret = (UINT_PTR)wrap_wglGetProcAddress( teb, ULongToPtr(params->lpszProc) ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_wgl_wglMakeCurrent( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index 8f9d9f9e210..66db65cd155 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -54,6 +54,3 @@ extern GLboolean wow64_glUnmapNamedBuffer( TEB *teb, GLuint buffer, PTR32 *clien extern GLboolean wow64_glUnmapNamedBufferEXT( TEB *teb, GLuint buffer, PTR32 *client_ptr ); extern void wow64_glWaitSync( TEB *teb, GLsync sync, GLbitfield flags, GLuint64 timeout ); #endif - -extern NTSTATUS wgl_wglGetProcAddress( void *args ); -extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 78dc25ffd72..8d6be13eb1e 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1446,25 +1446,6 @@ NTSTATUS return_wow64_string( const void *str, PTR32 *wow64_str ) return STATUS_BUFFER_TOO_SMALL; }
-NTSTATUS wow64_wgl_wglGetProcAddress( void *args ) -{ - struct - { - PTR32 teb; - PTR32 lpszProc; - PTR32 ret; - } *params32 = args; - struct wglGetProcAddress_params params = - { - .teb = get_teb64(params32->teb), - .lpszProc = ULongToPtr(params32->lpszProc), - }; - NTSTATUS status; - if ((status = wgl_wglGetProcAddress( ¶ms ))) return status; - params32->ret = (UINT_PTR)params.ret; - return STATUS_SUCCESS; -} - GLenum wow64_glClientWaitSync( TEB *teb, GLsync sync, GLbitfield flags, GLuint64 timeout ) { const struct opengl_funcs *funcs = teb->glTable;