From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 1 - dlls/opengl32/unix_thunks.c | 23 ++++++++++++++++++++++- dlls/opengl32/unix_thunks.h | 2 -- dlls/opengl32/unix_wgl.c | 27 --------------------------- 4 files changed, 22 insertions(+), 31 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 089a14835a5..a58973576c1 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -214,7 +214,6 @@ my %manual_unix_thunks = ); my %manual_wow64_thunks = ( - "wglCreatePbufferARB" => 1, "wglGetPbufferDCARB" => 1, "wglGetProcAddress" => 1, "wglGetProcAddress" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index afdcddd4117..1bdfba1d840 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -26669,7 +26669,7 @@ static NTSTATUS ext_wglCreateContextAttribsARB( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_wglCreatePbufferARB( void *args ) +static NTSTATUS ext_wglCreatePbufferARB( void *args ) { struct wglCreatePbufferARB_params *params = args; const struct opengl_funcs *funcs = get_dc_funcs( params->hDC ); @@ -78620,6 +78620,27 @@ static NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) +{ + struct + { + PTR32 teb; + PTR32 hDC; + int iPixelFormat; + int iWidth; + int iHeight; + PTR32 piAttribList; + PTR32 ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + const struct opengl_funcs *funcs = get_dc_funcs( ULongToPtr(params->hDC) ); + if (!funcs || !funcs->p_wglCreatePbufferARB) return STATUS_NOT_IMPLEMENTED; + pthread_mutex_lock( &wgl_lock ); + params->ret = (UINT_PTR)wrap_wglCreatePbufferARB( teb, ULongToPtr(params->hDC), params->iPixelFormat, params->iWidth, params->iHeight, ULongToPtr(params->piAttribList) ); + pthread_mutex_unlock( &wgl_lock ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_ext_wglDestroyPbufferARB( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index feaf5d34b7d..dcd31e96a42 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -57,7 +57,5 @@ extern void wow64_glWaitSync( TEB *teb, GLsync sync, GLbitfield flags, GLuint64
extern NTSTATUS wgl_wglGetProcAddress( void *args ); extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ); -extern NTSTATUS ext_wglCreatePbufferARB( void *args ); -extern NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ); extern NTSTATUS ext_wglGetPbufferDCARB( void *args ); extern NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 1aea9765b8a..d12edf4a268 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1446,33 +1446,6 @@ NTSTATUS return_wow64_string( const void *str, PTR32 *wow64_str ) return STATUS_BUFFER_TOO_SMALL; }
-NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) -{ - struct - { - PTR32 teb; - PTR32 hDC; - GLint iPixelFormat; - GLint iWidth; - GLint iHeight; - PTR32 piAttribList; - PTR32 ret; - } *params32 = args; - struct wglCreatePbufferARB_params params = - { - .teb = get_teb64(params32->teb), - .hDC = ULongToPtr(params32->hDC), - .iPixelFormat = params32->iPixelFormat, - .iWidth = params32->iWidth, - .iHeight = params32->iHeight, - .piAttribList = ULongToPtr(params32->piAttribList), - }; - NTSTATUS status; - if ((status = ext_wglCreatePbufferARB( ¶ms ))) return status; - params32->ret = (UINT_PTR)params.ret; - return STATUS_SUCCESS; -} - NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ) { struct
From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 1 - dlls/opengl32/unix_thunks.c | 17 ++++++++++++++++- dlls/opengl32/unix_thunks.h | 2 -- dlls/opengl32/unix_wgl.c | 19 ------------------- 4 files changed, 16 insertions(+), 23 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index a58973576c1..8f246823839 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -214,7 +214,6 @@ my %manual_unix_thunks = ); my %manual_wow64_thunks = ( - "wglGetPbufferDCARB" => 1, "wglGetProcAddress" => 1, "wglGetProcAddress" => 1, ); diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 1bdfba1d840..cf4d07e2a34 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -26714,7 +26714,7 @@ static NTSTATUS ext_wglGetExtensionsStringEXT( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_wglGetPbufferDCARB( void *args ) +static NTSTATUS ext_wglGetPbufferDCARB( void *args ) { struct wglGetPbufferDCARB_params *params = args; pthread_mutex_lock( &wgl_lock ); @@ -78698,6 +78698,21 @@ static NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ) return return_wow64_string( ret, ¶ms->ret ); }
+static NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ) +{ + struct + { + PTR32 teb; + PTR32 hPbuffer; + PTR32 ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + pthread_mutex_lock( &wgl_lock ); + params->ret = (UINT_PTR)wrap_wglGetPbufferDCARB( teb, ULongToPtr(params->hPbuffer) ); + pthread_mutex_unlock( &wgl_lock ); + return STATUS_SUCCESS; +} + static NTSTATUS wow64_ext_wglGetPixelFormatAttribfvARB( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index dcd31e96a42..8f9d9f9e210 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -57,5 +57,3 @@ extern void wow64_glWaitSync( TEB *teb, GLsync sync, GLbitfield flags, GLuint64
extern NTSTATUS wgl_wglGetProcAddress( void *args ); extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ); -extern NTSTATUS ext_wglGetPbufferDCARB( void *args ); -extern NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index d12edf4a268..78dc25ffd72 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_ext_wglGetPbufferDCARB( void *args ) -{ - struct - { - PTR32 teb; - PTR32 hPbuffer; - PTR32 ret; - } *params32 = args; - struct wglGetPbufferDCARB_params params = - { - .teb = get_teb64(params32->teb), - .hPbuffer = (HPBUFFERARB)ULongToPtr(params32->hPbuffer), - }; - NTSTATUS status; - if ((status = ext_wglGetPbufferDCARB( ¶ms ))) return status; - params32->ret = (UINT_PTR)params.ret; - return STATUS_SUCCESS; -} - NTSTATUS wow64_wgl_wglGetProcAddress( void *args ) { struct
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;