From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/make_opengl | 40 ++++++++++++++++++++++++++++++------- dlls/opengl32/unix_thunks.c | 27 ++----------------------- dlls/opengl32/unix_wgl.c | 35 ++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 32 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 9eff8e83bcc..f0cdd136bcf 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -167,6 +167,10 @@ my %manual_win_thunks = "wglGetProcAddress" => 1, "wglSwapBuffers" => 1, ); +my %manual_wow64_thunks = + ( + "glPathGlyphIndexRangeNV" => 1, + );
# # Used to convert some types @@ -258,7 +262,7 @@ sub generate_unix_thunk($$$) my $func_ret = get_func_ret( $func, 0 ); my $ret = "";
- $ret .= "static NTSTATUS $prefix_$name( void *args )\n"; + $ret .= "NTSTATUS $prefix_$name( void *args )\n"; $ret .= "{\n"; $ret .= " struct $name_params *params = args;\n" unless !$call_args && is_void_func( $func ); # special case for functions that take an HDC as first parameter @@ -1058,18 +1062,21 @@ foreach (sort keys %wgl_functions) { next if defined $manual_win_functions{$_}; next if needs_wrapper( $_, $wgl_functions{$_} ); + print OUT "static " unless defined $manual_wow64_thunks{$_}; print OUT generate_unix_thunk($_, $wgl_functions{$_}, "wgl"); } foreach (sort keys %norm_functions) { next if defined $manual_win_functions{$_}; next if needs_wrapper( $_, $norm_functions{$_} ); + print OUT "static " unless defined $manual_wow64_thunks{$_}; print OUT generate_unix_thunk($_, $norm_functions{$_}, "gl"); } foreach (sort keys %ext_functions) { next if defined $manual_win_functions{$_}; next if needs_wrapper( $_, $ext_functions{$_} ); + print OUT "static " unless defined $manual_wow64_thunks{$_}; print OUT generate_unix_thunk($_, $ext_functions{$_}, "ext"); }
@@ -1099,29 +1106,48 @@ print OUT "typedef ULONG PTR32;\n\n"; foreach (sort keys %wgl_functions) { next if defined $manual_win_functions{$_}; - next if !needs_wow64_thunk($_, $wgl_functions{$_}); + next if !needs_wow64_thunk($_, $wgl_functions{$_}) || defined $manual_wow64_thunks{$_}; print OUT generate_wow64_thunk($_, $wgl_functions{$_}, "wgl"); } foreach (sort keys %norm_functions) { next if defined $manual_win_functions{$_}; - next if !needs_wow64_thunk($_, $norm_functions{$_}); + next if !needs_wow64_thunk($_, $norm_functions{$_}) || defined $manual_wow64_thunks{$_}; print OUT generate_wow64_thunk($_, $norm_functions{$_}, "gl"); } foreach (sort keys %ext_functions) { next if defined $manual_win_functions{$_}; - next if !needs_wow64_thunk($_, $ext_functions{$_}); + next if !needs_wow64_thunk($_, $ext_functions{$_}) || defined $manual_wow64_thunks{$_}; print OUT generate_wow64_thunk($_, $ext_functions{$_}, "ext"); }
+foreach (sort keys %wgl_functions) +{ + next if defined $manual_win_functions{$_}; + next unless defined $manual_wow64_thunks{$_}; + print OUT "extern NTSTATUS wow64_wgl_$_( void *args ) DECLSPEC_HIDDEN;\n"; +} +foreach (sort keys %norm_functions) +{ + next if defined $manual_win_functions{$_}; + next unless defined $manual_wow64_thunks{$_}; + print OUT "extern NTSTATUS wow64_gl_$_( void *args ) DECLSPEC_HIDDEN;\n"; +} +foreach (sort keys %ext_functions) +{ + next if defined $manual_win_functions{$_}; + next unless defined $manual_wow64_thunks{$_}; + print OUT "extern NTSTATUS wow64_ext_$_( void *args ) DECLSPEC_HIDDEN;\n"; +} + print OUT "\nconst unixlib_entry_t __wine_unix_call_wow64_funcs[] =\n"; print OUT "{\n"; print OUT " &thread_attach,\n"; foreach (sort keys %wgl_functions) { next if defined $manual_win_functions{$_}; - if (needs_wow64_thunk($_, $wgl_functions{$_})) + if (needs_wow64_thunk($_, $wgl_functions{$_}) || defined $manual_wow64_thunks{$_}) { printf OUT " &wow64_wgl_%s,\n", $_; } @@ -1133,7 +1159,7 @@ foreach (sort keys %wgl_functions) foreach (sort keys %norm_functions) { next if defined $manual_win_functions{$_}; - if (needs_wow64_thunk($_, $norm_functions{$_})) + if (needs_wow64_thunk($_, $norm_functions{$_}) || defined $manual_wow64_thunks{$_}) { printf OUT " &wow64_gl_%s,\n", $_; } @@ -1145,7 +1171,7 @@ foreach (sort keys %norm_functions) foreach (sort keys %ext_functions) { next if defined $manual_win_functions{$_}; - if (needs_wow64_thunk($_, $ext_functions{$_})) + if (needs_wow64_thunk($_, $ext_functions{$_}) || defined $manual_wow64_thunks{$_}) { printf OUT " &wow64_ext_%s,\n", $_; } diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index c46618d4694..b424bac922b 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -14753,7 +14753,7 @@ static NTSTATUS ext_glPathGlyphIndexArrayNV( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glPathGlyphIndexRangeNV( void *args ) +NTSTATUS ext_glPathGlyphIndexRangeNV( void *args ) { struct glPathGlyphIndexRangeNV_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -48613,30 +48613,6 @@ static NTSTATUS wow64_ext_glPathGlyphIndexArrayNV( void *args ) return status; }
-static NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) -{ - struct - { - GLenum fontTarget; - PTR32 fontName; - GLbitfield fontStyle; - GLuint pathParameterTemplate; - GLfloat emScale; - PTR32 baseAndCount; - GLenum ret; - } *params32 = args; - struct glPathGlyphIndexRangeNV_params params = - { - .fontTarget = params32->fontTarget, - .fontName = ULongToPtr(params32->fontName), - .fontStyle = params32->fontStyle, - .pathParameterTemplate = params32->pathParameterTemplate, - .emScale = params32->emScale, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_glPathGlyphRangeNV( void *args ) { struct @@ -61112,6 +61088,7 @@ static NTSTATUS wow64_ext_wglSetPixelFormatWINE( void *args ) return status; }
+extern NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) DECLSPEC_HIDDEN;
const unixlib_entry_t __wine_unix_call_wow64_funcs[] = { diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 54f4b0709dd..0daaf597ff3 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1050,3 +1050,38 @@ NTSTATUS WINAPI thread_attach( void *args ) NtCurrentTeb()->glTable = &null_opengl_funcs; return STATUS_SUCCESS; } + +#ifdef _WIN64 + +typedef ULONG PTR32; + +extern NTSTATUS ext_glPathGlyphIndexRangeNV( void *args ) DECLSPEC_HIDDEN; + +NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) +{ + struct + { + GLenum fontTarget; + PTR32 fontName; + GLbitfield fontStyle; + GLuint pathParameterTemplate; + GLfloat emScale; + GLuint baseAndCount[2]; + GLenum ret; + } *params32 = args; + struct glPathGlyphIndexRangeNV_params params = + { + .fontTarget = params32->fontTarget, + .fontName = ULongToPtr(params32->fontName), + .fontStyle = params32->fontStyle, + .pathParameterTemplate = params32->pathParameterTemplate, + .emScale = params32->emScale, + .baseAndCount = {params32->baseAndCount[0], params32->baseAndCount[1]}, + }; + NTSTATUS status; + if ((status = ext_glPathGlyphIndexRangeNV( ¶ms ))) return status; + params32->ret = params.ret; + return status; +} + +#endif