From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/unix_wgl.c | 74 +++++++++++----------------------------- 1 file changed, 20 insertions(+), 54 deletions(-)
diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index f7eaaa54336..3d9017ade3c 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1411,11 +1411,17 @@ struct wow64_string_entry static struct wow64_string_entry *wow64_strings; static SIZE_T wow64_strings_count;
-static PTR32 find_wow64_string( const char *str, PTR32 wow64_str ) +static NTSTATUS return_wow64_string( const void *str, PTR32 *wow64_str ) { void *tmp; SIZE_T i;
+ if (!str) + { + *wow64_str = 0; + return STATUS_SUCCESS; + } + pthread_mutex_lock( &wgl_lock );
for (i = 0; i < wow64_strings_count; i++) if (wow64_strings[i].str == str) break; @@ -1428,16 +1434,18 @@ static PTR32 find_wow64_string( const char *str, PTR32 wow64_str ) }
if (i == wow64_strings_count) ERR( "Failed to allocate memory for wow64 strings\n" ); - else if (wow64_strings[i].wow64_str) wow64_str = wow64_strings[i].wow64_str; - else if (wow64_str) + else if (wow64_strings[i].wow64_str) *wow64_str = wow64_strings[i].wow64_str; + else if (*wow64_str) { - strcpy( UlongToPtr(wow64_str), (char *)str ); - wow64_strings[i].wow64_str = wow64_str; + strcpy( UlongToPtr(*wow64_str), str ); + wow64_strings[i].wow64_str = *wow64_str; }
pthread_mutex_unlock( &wgl_lock );
- return wow64_str; + if (*wow64_str) return STATUS_SUCCESS; + *wow64_str = strlen( str ) + 1; + return STATUS_BUFFER_TOO_SMALL; }
NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) @@ -1521,14 +1529,7 @@ NTSTATUS wow64_gl_glGetString( void *args ) NTSTATUS status;
if ((status = gl_glGetString( ¶ms ))) return status; - - if (!(params32->ret = find_wow64_string( (char *)params.ret, params32->ret ))) - { - params32->ret = strlen( (char *)params.ret ) + 1; - return STATUS_BUFFER_TOO_SMALL; - } - - return STATUS_SUCCESS; + return return_wow64_string( params.ret, ¶ms32->ret ); }
NTSTATUS wow64_ext_glGetStringi( void *args ) @@ -1549,14 +1550,7 @@ NTSTATUS wow64_ext_glGetStringi( void *args ) NTSTATUS status;
if ((status = ext_glGetStringi( ¶ms ))) return status; - - if (!(params32->ret = find_wow64_string( (char *)params.ret, params32->ret ))) - { - params32->ret = strlen( (char *)params.ret ) + 1; - return STATUS_BUFFER_TOO_SMALL; - } - - return STATUS_SUCCESS; + return return_wow64_string( params.ret, ¶ms32->ret ); }
NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) @@ -1604,14 +1598,7 @@ NTSTATUS wow64_ext_wglGetExtensionsStringARB( void *args ) NTSTATUS status;
if ((status = ext_wglGetExtensionsStringARB( ¶ms ))) return status; - - if (!(params32->ret = find_wow64_string( params.ret, params32->ret ))) - { - params32->ret = strlen( params.ret ) + 1; - return STATUS_BUFFER_TOO_SMALL; - } - - return STATUS_SUCCESS; + return return_wow64_string( params.ret, ¶ms32->ret ); }
NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ) @@ -1628,14 +1615,7 @@ NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ) NTSTATUS status;
if ((status = ext_wglGetExtensionsStringEXT( ¶ms ))) return status; - - if (!(params32->ret = find_wow64_string( params.ret, params32->ret ))) - { - params32->ret = strlen( params.ret ) + 1; - return STATUS_BUFFER_TOO_SMALL; - } - - return STATUS_SUCCESS; + return return_wow64_string( params.ret, ¶ms32->ret ); }
NTSTATUS wow64_ext_wglQueryCurrentRendererStringWINE( void *args ) @@ -1654,14 +1634,7 @@ NTSTATUS wow64_ext_wglQueryCurrentRendererStringWINE( void *args ) NTSTATUS status;
if ((status = ext_wglQueryCurrentRendererStringWINE( ¶ms ))) return status; - - if (!(params32->ret = find_wow64_string( params.ret, params32->ret ))) - { - params32->ret = strlen( params.ret ) + 1; - return STATUS_BUFFER_TOO_SMALL; - } - - return STATUS_SUCCESS; + return return_wow64_string( params.ret, ¶ms32->ret ); }
NTSTATUS wow64_ext_wglQueryRendererStringWINE( void *args ) @@ -1684,14 +1657,7 @@ NTSTATUS wow64_ext_wglQueryRendererStringWINE( void *args ) NTSTATUS status;
if ((status = ext_wglQueryRendererStringWINE( ¶ms ))) return status; - - if (!(params32->ret = find_wow64_string( params.ret, params32->ret ))) - { - params32->ret = strlen( params.ret ) + 1; - return STATUS_BUFFER_TOO_SMALL; - } - - return STATUS_SUCCESS; + return return_wow64_string( params.ret, ¶ms32->ret ); }
GLenum wow64_glClientWaitSync( TEB *teb, GLsync sync, GLbitfield flags, GLuint64 timeout )
From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 29 +++++++++++++++++++---------- dlls/opengl32/unix_private.h | 6 ++++++ dlls/opengl32/unix_thunks.c | 18 +++++++++++++++--- dlls/opengl32/unix_thunks.h | 3 +-- dlls/opengl32/unix_wgl.c | 23 +---------------------- 5 files changed, 42 insertions(+), 37 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index c8b1a865314..e54cd5dd783 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -218,7 +218,6 @@ my %manual_wow64_thunks = "glGetBufferPointervARB" => 1, "glGetNamedBufferPointerv" => 1, "glGetNamedBufferPointervEXT" => 1, - "glGetString" => 1, "glGetStringi" => 1, "glMapBuffer" => 1, "glMapBufferARB" => 1, @@ -370,9 +369,11 @@ sub generate_unix_thunk($$$$) my $need_wrap = $manual_wow64_wrapper || needs_wrapper( $name, $func ); my $need_lock = $func_ret =~ /HGLRC|HPBUFFERARB/; my $teb = $is_wow64 ? "teb" : "params->teb"; + my $ret_stat = "return STATUS_SUCCESS;"; my $input_conv = ""; my $output_conv = ""; my $call_args = ""; + my $ret_expr = ""; my $use_dc = 0; my $ret = "";
@@ -390,6 +391,7 @@ sub generate_unix_thunk($$$$) # special case for functions that take an HDC as first parameter $use_dc = @{$func->[1]} && get_arg_type( ${$func->[1]}[0] ) eq "HDC" && $name !~ /wglMake(Context)?Current/;
+ $ret_expr = "params->ret = " if !is_void_func( $func ); $call_args .= " $teb," if $need_wrap; if ($is_wow64) { @@ -443,11 +445,23 @@ sub generate_unix_thunk($$$$) } if (!is_void_func($func)) { + my $ret_type = get_arg_type( $func->[0] ); my $ptype = get_wow64_arg_type( $func->[0] ); $ret .= " $ptype ret;\n"; + if ($ret_type eq "const GLubyte *" || $ret_type eq "const char *" || $ret_type eq "const GLchar *") + { + $input_conv .= " " . $ret_type . "ret;\n"; + $ret_expr = "ret = "; + $ret_stat = "return return_wow64_string( ret, ¶ms->ret );"; + } + elsif ($ptype eq "PTR32") + { + $ret_expr .= "(UINT_PTR)"; + $need_manual_thunk = 1 if $ret_type =~ /(GLsync|PROC|GLintptr|*)/; + } } $ret .= " } *params = args;\n"; - if (!$need_wrap && ($need_manual_thunk || $func->[0]->textContent() =~ /(GLsync|PROC|GLintptr|*)/)) + if (!$need_wrap && $need_manual_thunk) { $ret .= " FIXME( "params %p stub!\n", params );\n"; $ret .= " return STATUS_NOT_IMPLEMENTED;\n"; @@ -486,12 +500,7 @@ sub generate_unix_thunk($$$$) $ret .= " const struct opengl_funcs *funcs = $teb->glTable;\n"; } $ret .= " pthread_mutex_lock( &wgl_lock );\n" if $need_lock; - $ret .= " "; - if (!is_void_func( $func )) - { - $ret .= "params->ret = "; - $ret .= "(UINT_PTR)" if $is_wow64 && get_wow64_arg_type( $func->[0] ) =~ /PTR32/; - } + $ret .= " $ret_expr"; $call_args =~ s/,$/ /; if ($manual_wow64_wrapper) { @@ -525,7 +534,7 @@ sub generate_unix_thunk($$$$) $ret .= " set_context_attribute( $teb, -1 /* unsupported */, NULL, 0 );\n"; } $ret .= $output_conv; - $ret .= " return STATUS_SUCCESS;\n"; + $ret .= " $ret_stat\n"; $ret .= "}\n\n";
return $ret; @@ -1309,6 +1318,7 @@ foreach (sort keys %ext_functions) }
print OUT "\n#ifdef _WIN64\n"; +print OUT "typedef ULONG PTR32;\n";
foreach (sort keys %wgl_functions) { @@ -1425,7 +1435,6 @@ print OUT "};\n\n"; print OUT "C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == funcs_count);\n\n";
print OUT "#ifdef _WIN64\n\n"; -print OUT "typedef ULONG PTR32;\n\n"; print OUT "extern NTSTATUS wow64_thread_attach( void *args );\n"; print OUT "extern NTSTATUS wow64_process_detach( void *args );\n"; print OUT "extern NTSTATUS wow64_get_pixel_formats( void *args );\n\n"; diff --git a/dlls/opengl32/unix_private.h b/dlls/opengl32/unix_private.h index e83b7f35c02..26f21d6843a 100644 --- a/dlls/opengl32/unix_private.h +++ b/dlls/opengl32/unix_private.h @@ -53,6 +53,8 @@ static inline const struct opengl_funcs *get_dc_funcs( HDC hdc ) return funcs; }
+#ifdef _WIN64 + static inline void *copy_wow64_ptr32s( UINT_PTR address, ULONG count ) { ULONG *ptrs = (ULONG *)address; @@ -69,6 +71,10 @@ static inline TEB *get_teb64( ULONG teb32 ) return (TEB *)((char *)teb32_ptr + teb32_ptr->WowTebOffset); }
+extern NTSTATUS return_wow64_string( const void *str, PTR32 *wow64_str ); + +#endif + extern pthread_mutex_t wgl_lock;
extern NTSTATUS process_attach( void *args ); diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 78bdf652b1e..0cb7ad4a11a 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -1133,7 +1133,7 @@ static NTSTATUS gl_glGetPolygonStipple( void *args ) return STATUS_SUCCESS; }
-NTSTATUS gl_glGetString( void *args ) +static NTSTATUS gl_glGetString( void *args ) { struct glGetString_params *params = args; params->ret = wrap_glGetString( params->teb, params->name ); @@ -29895,8 +29895,6 @@ C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == funcs_count);
#ifdef _WIN64
-typedef ULONG PTR32; - extern NTSTATUS wow64_thread_attach( void *args ); extern NTSTATUS wow64_process_detach( void *args ); extern NTSTATUS wow64_get_pixel_formats( void *args ); @@ -31795,6 +31793,20 @@ static NTSTATUS wow64_gl_glGetPolygonStipple( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_gl_glGetString( void *args ) +{ + struct + { + PTR32 teb; + GLenum name; + PTR32 ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + const GLubyte *ret; + ret = wrap_glGetString( teb, params->name ); + return return_wow64_string( ret, ¶ms->ret ); +} + static NTSTATUS wow64_gl_glGetTexEnvfv( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index 76fcb67e689..0e887057a73 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -31,6 +31,7 @@ extern BOOL wrap_wglReleaseTexImageARB( TEB *teb , HPBUFFERARB hPbuffer, int iBu extern BOOL wrap_wglSetPbufferAttribARB( TEB *teb , HPBUFFERARB hPbuffer, const int *piAttribList );
#ifdef _WIN64 +typedef ULONG PTR32; 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 ); @@ -41,8 +42,6 @@ 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 gl_glGetString( void *args ); -extern NTSTATUS wow64_gl_glGetString( void *args ); extern NTSTATUS ext_glGetBufferPointerv( void *args ); extern NTSTATUS wow64_ext_glGetBufferPointerv( void *args ); extern NTSTATUS ext_glGetBufferPointervARB( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 3d9017ade3c..965fa488145 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1401,8 +1401,6 @@ NTSTATUS get_pixel_formats( void *args )
#ifdef _WIN64
-typedef ULONG PTR32; - struct wow64_string_entry { const char *str; @@ -1411,7 +1409,7 @@ struct wow64_string_entry static struct wow64_string_entry *wow64_strings; static SIZE_T wow64_strings_count;
-static NTSTATUS return_wow64_string( const void *str, PTR32 *wow64_str ) +NTSTATUS return_wow64_string( const void *str, PTR32 *wow64_str ) { void *tmp; SIZE_T i; @@ -1513,25 +1511,6 @@ NTSTATUS wow64_wgl_wglGetProcAddress( void *args ) return STATUS_SUCCESS; }
-NTSTATUS wow64_gl_glGetString( void *args ) -{ - struct - { - PTR32 teb; - GLenum name; - PTR32 ret; - } *params32 = args; - struct glGetString_params params = - { - .teb = get_teb64(params32->teb), - .name = params32->name, - }; - NTSTATUS status; - - if ((status = gl_glGetString( ¶ms ))) return status; - return return_wow64_string( params.ret, ¶ms32->ret ); -} - NTSTATUS wow64_ext_glGetStringi( 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 | 21 --------------------- 4 files changed, 16 insertions(+), 25 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index e54cd5dd783..b5663438266 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -218,7 +218,6 @@ my %manual_wow64_thunks = "glGetBufferPointervARB" => 1, "glGetNamedBufferPointerv" => 1, "glGetNamedBufferPointervEXT" => 1, - "glGetStringi" => 1, "glMapBuffer" => 1, "glMapBufferARB" => 1, "glMapBufferRange" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 0cb7ad4a11a..c042af5870e 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -10776,7 +10776,7 @@ static NTSTATUS ext_glGetStageIndexNV( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_glGetStringi( void *args ) +static NTSTATUS ext_glGetStringi( void *args ) { struct glGetStringi_params *params = args; params->ret = wrap_glGetStringi( params->teb, params->name, params->index ); @@ -49468,6 +49468,21 @@ static NTSTATUS wow64_ext_glGetStageIndexNV( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_ext_glGetStringi( void *args ) +{ + struct + { + PTR32 teb; + GLenum name; + GLuint index; + PTR32 ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + const GLubyte *ret; + ret = wrap_glGetStringi( teb, params->name, params->index ); + return return_wow64_string( ret, ¶ms->ret ); +} + static NTSTATUS wow64_ext_glGetSubroutineIndex( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index 0e887057a73..ddd20e693e5 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -50,8 +50,6 @@ extern NTSTATUS ext_glGetNamedBufferPointerv( void *args ); extern NTSTATUS wow64_ext_glGetNamedBufferPointerv( void *args ); 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_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 965fa488145..369c8f0a992 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1511,27 +1511,6 @@ NTSTATUS wow64_wgl_wglGetProcAddress( void *args ) return STATUS_SUCCESS; }
-NTSTATUS wow64_ext_glGetStringi( void *args ) -{ - struct - { - PTR32 teb; - GLenum name; - GLuint index; - PTR32 ret; - } *params32 = args; - struct glGetStringi_params params = - { - .teb = get_teb64(params32->teb), - .name = params32->name, - .index = params32->index, - }; - NTSTATUS status; - - if ((status = ext_glGetStringi( ¶ms ))) return status; - return return_wow64_string( params.ret, ¶ms32->ret ); -} - NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( 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 b5663438266..f3ce26e77ad 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -231,7 +231,6 @@ my %manual_wow64_thunks = "glUnmapNamedBuffer" => 1, "glUnmapNamedBufferEXT" => 1, "wglCreatePbufferARB" => 1, - "wglGetExtensionsStringARB" => 1, "wglGetExtensionsStringEXT" => 1, "wglGetPbufferDCARB" => 1, "wglGetProcAddress" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index c042af5870e..1df390a2c65 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -26697,7 +26697,7 @@ static NTSTATUS ext_wglFreeMemoryNV( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_wglGetExtensionsStringARB( void *args ) +static NTSTATUS ext_wglGetExtensionsStringARB( void *args ) { struct wglGetExtensionsStringARB_params *params = args; const struct opengl_funcs *funcs = get_dc_funcs( params->hdc ); @@ -78394,6 +78394,21 @@ static NTSTATUS wow64_ext_wglFreeMemoryNV( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_ext_wglGetExtensionsStringARB( void *args ) +{ + struct + { + PTR32 teb; + PTR32 hdc; + PTR32 ret; + } *params = args; + const char *ret; + const struct opengl_funcs *funcs = get_dc_funcs( ULongToPtr(params->hdc) ); + if (!funcs || !funcs->p_wglGetExtensionsStringARB) return STATUS_NOT_IMPLEMENTED; + ret = funcs->p_wglGetExtensionsStringARB( ULongToPtr(params->hdc) ); + return return_wow64_string( ret, ¶ms->ret ); +} + static NTSTATUS wow64_ext_wglGetPixelFormatAttribfvARB( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index ddd20e693e5..4568018ee09 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -76,8 +76,6 @@ extern NTSTATUS ext_glUnmapNamedBufferEXT( void *args ); extern NTSTATUS wow64_ext_glUnmapNamedBufferEXT( void *args ); extern NTSTATUS ext_wglCreatePbufferARB( void *args ); extern NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ); -extern NTSTATUS ext_wglGetExtensionsStringARB( void *args ); -extern NTSTATUS wow64_ext_wglGetExtensionsStringARB( void *args ); extern NTSTATUS ext_wglGetExtensionsStringEXT( void *args ); extern NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ); extern NTSTATUS ext_wglGetPbufferDCARB( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 369c8f0a992..7b9ad090b35 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1540,25 +1540,6 @@ NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) return status; }
-NTSTATUS wow64_ext_wglGetExtensionsStringARB( void *args ) -{ - struct - { - PTR32 teb; - PTR32 hdc; - PTR32 ret; - } *params32 = args; - struct wglGetExtensionsStringARB_params params = - { - .teb = get_teb64(params32->teb), - .hdc = ULongToPtr(params32->hdc), - }; - NTSTATUS status; - - if ((status = ext_wglGetExtensionsStringARB( ¶ms ))) return status; - return return_wow64_string( params.ret, ¶ms32->ret ); -} - NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ) { struct
From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 1 - dlls/opengl32/unix_thunks.c | 16 +++++++++++++++- dlls/opengl32/unix_thunks.h | 2 -- dlls/opengl32/unix_wgl.c | 17 ----------------- 4 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index f3ce26e77ad..d88385c63ea 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -231,7 +231,6 @@ my %manual_wow64_thunks = "glUnmapNamedBuffer" => 1, "glUnmapNamedBufferEXT" => 1, "wglCreatePbufferARB" => 1, - "wglGetExtensionsStringEXT" => 1, "wglGetPbufferDCARB" => 1, "wglGetProcAddress" => 1, "wglGetProcAddress" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 1df390a2c65..10c6975d9ec 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -26706,7 +26706,7 @@ static NTSTATUS ext_wglGetExtensionsStringARB( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_wglGetExtensionsStringEXT( void *args ) +static NTSTATUS ext_wglGetExtensionsStringEXT( void *args ) { struct wglGetExtensionsStringEXT_params *params = args; const struct opengl_funcs *funcs = params->teb->glTable; @@ -78409,6 +78409,20 @@ static NTSTATUS wow64_ext_wglGetExtensionsStringARB( void *args ) return return_wow64_string( ret, ¶ms->ret ); }
+static NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ) +{ + struct + { + PTR32 teb; + PTR32 ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + const char *ret; + const struct opengl_funcs *funcs = teb->glTable; + ret = funcs->p_wglGetExtensionsStringEXT(); + return return_wow64_string( ret, ¶ms->ret ); +} + static NTSTATUS wow64_ext_wglGetPixelFormatAttribfvARB( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index 4568018ee09..57de518e9ec 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -76,8 +76,6 @@ extern NTSTATUS ext_glUnmapNamedBufferEXT( void *args ); extern NTSTATUS wow64_ext_glUnmapNamedBufferEXT( void *args ); extern NTSTATUS ext_wglCreatePbufferARB( void *args ); extern NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ); -extern NTSTATUS ext_wglGetExtensionsStringEXT( void *args ); -extern NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ); extern NTSTATUS ext_wglGetPbufferDCARB( void *args ); extern NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ); extern NTSTATUS ext_wglQueryCurrentRendererStringWINE( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 7b9ad090b35..68abe019ac0 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1540,23 +1540,6 @@ NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) return status; }
-NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ) -{ - struct - { - PTR32 teb; - PTR32 ret; - } *params32 = args; - struct wglGetExtensionsStringEXT_params params = - { - .teb = get_teb64(params32->teb), - }; - NTSTATUS status; - - if ((status = ext_wglGetExtensionsStringEXT( ¶ms ))) return status; - return return_wow64_string( params.ret, ¶ms32->ret ); -} - NTSTATUS wow64_ext_wglQueryCurrentRendererStringWINE( 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 d88385c63ea..46adda28787 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -234,7 +234,6 @@ my %manual_wow64_thunks = "wglGetPbufferDCARB" => 1, "wglGetProcAddress" => 1, "wglGetProcAddress" => 1, - "wglQueryCurrentRendererStringWINE" => 1, "wglQueryRendererStringWINE" => 1, ); my %manual_wow64_wrappers = diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 10c6975d9ec..62560aaf4ba 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -26766,7 +26766,7 @@ static NTSTATUS ext_wglQueryCurrentRendererIntegerWINE( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_wglQueryCurrentRendererStringWINE( void *args ) +static NTSTATUS ext_wglQueryCurrentRendererStringWINE( void *args ) { struct wglQueryCurrentRendererStringWINE_params *params = args; const struct opengl_funcs *funcs = params->teb->glTable; @@ -78506,6 +78506,21 @@ static NTSTATUS wow64_ext_wglQueryCurrentRendererIntegerWINE( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_ext_wglQueryCurrentRendererStringWINE( void *args ) +{ + struct + { + PTR32 teb; + GLenum attribute; + PTR32 ret; + } *params = args; + TEB *teb = get_teb64( params->teb ); + const GLchar *ret; + const struct opengl_funcs *funcs = teb->glTable; + ret = funcs->p_wglQueryCurrentRendererStringWINE( params->attribute ); + return return_wow64_string( ret, ¶ms->ret ); +} + static NTSTATUS wow64_ext_wglQueryPbufferARB( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index 57de518e9ec..1f349514e6f 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -78,7 +78,5 @@ 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 ); -extern NTSTATUS ext_wglQueryCurrentRendererStringWINE( void *args ); -extern NTSTATUS wow64_ext_wglQueryCurrentRendererStringWINE( void *args ); extern NTSTATUS ext_wglQueryRendererStringWINE( void *args ); extern NTSTATUS wow64_ext_wglQueryRendererStringWINE( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 68abe019ac0..5f9050d8f4d 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1540,25 +1540,6 @@ NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) return status; }
-NTSTATUS wow64_ext_wglQueryCurrentRendererStringWINE( void *args ) -{ - struct - { - PTR32 teb; - GLenum attribute; - PTR32 ret; - } *params32 = args; - struct wglQueryCurrentRendererStringWINE_params params = - { - .teb = get_teb64(params32->teb), - .attribute = params32->attribute, - }; - NTSTATUS status; - - if ((status = ext_wglQueryCurrentRendererStringWINE( ¶ms ))) return status; - return return_wow64_string( params.ret, ¶ms32->ret ); -} - NTSTATUS wow64_ext_wglQueryRendererStringWINE( void *args ) { struct
From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 1 - dlls/opengl32/unix_thunks.c | 19 ++++++++++++++++++- dlls/opengl32/unix_thunks.h | 2 -- dlls/opengl32/unix_wgl.c | 23 ----------------------- 4 files changed, 18 insertions(+), 27 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 46adda28787..cc0b3248f91 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -234,7 +234,6 @@ my %manual_wow64_thunks = "wglGetPbufferDCARB" => 1, "wglGetProcAddress" => 1, "wglGetProcAddress" => 1, - "wglQueryRendererStringWINE" => 1, ); my %manual_wow64_wrappers = ( diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 62560aaf4ba..257685179d3 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -26792,7 +26792,7 @@ static NTSTATUS ext_wglQueryRendererIntegerWINE( void *args ) return STATUS_SUCCESS; }
-NTSTATUS ext_wglQueryRendererStringWINE( void *args ) +static NTSTATUS ext_wglQueryRendererStringWINE( void *args ) { struct wglQueryRendererStringWINE_params *params = args; const struct opengl_funcs *funcs = get_dc_funcs( params->dc ); @@ -78555,6 +78555,23 @@ static NTSTATUS wow64_ext_wglQueryRendererIntegerWINE( void *args ) return STATUS_SUCCESS; }
+static NTSTATUS wow64_ext_wglQueryRendererStringWINE( void *args ) +{ + struct + { + PTR32 teb; + PTR32 dc; + GLint renderer; + GLenum attribute; + PTR32 ret; + } *params = args; + const GLchar *ret; + const struct opengl_funcs *funcs = get_dc_funcs( ULongToPtr(params->dc) ); + if (!funcs || !funcs->p_wglQueryRendererStringWINE) return STATUS_NOT_IMPLEMENTED; + ret = funcs->p_wglQueryRendererStringWINE( ULongToPtr(params->dc), params->renderer, params->attribute ); + return return_wow64_string( ret, ¶ms->ret ); +} + static NTSTATUS wow64_ext_wglReleasePbufferDCARB( void *args ) { struct diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index 1f349514e6f..4042faaf162 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -78,5 +78,3 @@ 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 ); -extern NTSTATUS ext_wglQueryRendererStringWINE( void *args ); -extern NTSTATUS wow64_ext_wglQueryRendererStringWINE( void *args ); diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 5f9050d8f4d..62008cce91d 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1540,29 +1540,6 @@ NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) return status; }
-NTSTATUS wow64_ext_wglQueryRendererStringWINE( void *args ) -{ - struct - { - PTR32 teb; - PTR32 dc; - GLint renderer; - GLenum attribute; - PTR32 ret; - } *params32 = args; - struct wglQueryRendererStringWINE_params params = - { - .teb = get_teb64(params32->teb), - .dc = ULongToPtr(params32->dc), - .renderer = params32->renderer, - .attribute = params32->attribute, - }; - NTSTATUS status; - - if ((status = ext_wglQueryRendererStringWINE( ¶ms ))) return status; - return return_wow64_string( params.ret, ¶ms32->ret ); -} - GLenum wow64_glClientWaitSync( TEB *teb, GLsync sync, GLbitfield flags, GLuint64 timeout ) { const struct opengl_funcs *funcs = teb->glTable;