-- v3: opengl32: Move thunks declarations to generated header. opengl32: Move manual wow64 thunks declarations to generated header.
From: Jacek Caban jacek@codeweavers.com
--- .gitattributes | 1 + dlls/opengl32/make_opengl | 50 +++++++++++++++++++++--------------- dlls/opengl32/unix_private.h | 1 + dlls/opengl32/unix_thunks.c | 36 -------------------------- dlls/opengl32/unix_thunks.h | 42 ++++++++++++++++++++++++++++++ 5 files changed, 74 insertions(+), 56 deletions(-) create mode 100644 dlls/opengl32/unix_thunks.h
diff --git a/.gitattributes b/.gitattributes index b2a904cf5e6..72b0af7640e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18,6 +18,7 @@ dlls/opencl/unixlib.h generated dlls/opengl32/opengl32.spec generated dlls/opengl32/thunks.c generated dlls/opengl32/unix_thunks.c generated +dlls/opengl32/unix_thunks.h generated dlls/opengl32/unixlib.h generated include/wine/wgl.h generated
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 4d3cc0562cc..7fa17fd1ac9 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -1270,6 +1270,36 @@ print OUT "};\n";
close OUT;
+# +# Generate the unix_thunks.h file +# +open OUT, ">unix_thunks.h" or die "cannot create unix_thunks.h"; +print OUT "/* Automatically generated from http://www.opengl.org/registry files; DO NOT EDIT! */\n\n"; +print OUT "#ifdef _WIN64\n\n"; + +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 );\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 );\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 wow64_ext_$_( void *args );\n"; +} + +print OUT "\n#endif\n"; +close OUT; + # # Generate the unix_thunks.c file # @@ -1369,26 +1399,6 @@ foreach (sort keys %ext_functions) 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 );\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 );\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 wow64_ext_$_( void *args );\n"; -} - print OUT "\nconst unixlib_entry_t __wine_unix_call_wow64_funcs[] =\n"; print OUT "{\n"; print OUT " process_attach,\n"; diff --git a/dlls/opengl32/unix_private.h b/dlls/opengl32/unix_private.h index e51ae08161c..46b30c33d80 100644 --- a/dlls/opengl32/unix_private.h +++ b/dlls/opengl32/unix_private.h @@ -32,6 +32,7 @@ #include "ntgdi.h"
#include "wine/opengl_driver.h" +#include "unix_thunks.h"
struct registry_entry { diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index a3c0c5aa817..7c6d56372de 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -94915,42 +94915,6 @@ static NTSTATUS wow64_ext_wglSwapIntervalEXT( void *args ) return status; }
-extern NTSTATUS wow64_wgl_wglCreateContext( void *args ); -extern NTSTATUS wow64_wgl_wglDeleteContext( void *args ); -extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ); -extern NTSTATUS wow64_wgl_wglMakeCurrent( void *args ); -extern NTSTATUS wow64_gl_glGetString( void *args ); -extern NTSTATUS wow64_ext_glClientWaitSync( void *args ); -extern NTSTATUS wow64_ext_glDeleteSync( void *args ); -extern NTSTATUS wow64_ext_glFenceSync( void *args ); -extern NTSTATUS wow64_ext_glGetBufferPointerv( void *args ); -extern NTSTATUS wow64_ext_glGetBufferPointervARB( void *args ); -extern NTSTATUS wow64_ext_glGetNamedBufferPointerv( void *args ); -extern NTSTATUS wow64_ext_glGetNamedBufferPointervEXT( void *args ); -extern NTSTATUS wow64_ext_glGetStringi( void *args ); -extern NTSTATUS wow64_ext_glGetSynciv( void *args ); -extern NTSTATUS wow64_ext_glIsSync( void *args ); -extern NTSTATUS wow64_ext_glMapBuffer( void *args ); -extern NTSTATUS wow64_ext_glMapBufferARB( void *args ); -extern NTSTATUS wow64_ext_glMapBufferRange( void *args ); -extern NTSTATUS wow64_ext_glMapNamedBuffer( void *args ); -extern NTSTATUS wow64_ext_glMapNamedBufferEXT( void *args ); -extern NTSTATUS wow64_ext_glMapNamedBufferRange( void *args ); -extern NTSTATUS wow64_ext_glMapNamedBufferRangeEXT( void *args ); -extern NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ); -extern NTSTATUS wow64_ext_glUnmapBuffer( void *args ); -extern NTSTATUS wow64_ext_glUnmapBufferARB( void *args ); -extern NTSTATUS wow64_ext_glUnmapNamedBuffer( void *args ); -extern NTSTATUS wow64_ext_glUnmapNamedBufferEXT( void *args ); -extern NTSTATUS wow64_ext_glWaitSync( void *args ); -extern NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ); -extern NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ); -extern NTSTATUS wow64_ext_wglGetExtensionsStringARB( void *args ); -extern NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ); -extern NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ); -extern NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ); -extern NTSTATUS wow64_ext_wglQueryCurrentRendererStringWINE( void *args ); -extern NTSTATUS wow64_ext_wglQueryRendererStringWINE( void *args );
const unixlib_entry_t __wine_unix_call_wow64_funcs[] = { diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h new file mode 100644 index 00000000000..8e2ac49d847 --- /dev/null +++ b/dlls/opengl32/unix_thunks.h @@ -0,0 +1,42 @@ +/* Automatically generated from http://www.opengl.org/registry files; DO NOT EDIT! */ + +#ifdef _WIN64 + +extern NTSTATUS wow64_wgl_wglCreateContext( void *args ); +extern NTSTATUS wow64_wgl_wglDeleteContext( void *args ); +extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ); +extern NTSTATUS wow64_wgl_wglMakeCurrent( void *args ); +extern NTSTATUS wow64_gl_glGetString( void *args ); +extern NTSTATUS wow64_ext_glClientWaitSync( void *args ); +extern NTSTATUS wow64_ext_glDeleteSync( void *args ); +extern NTSTATUS wow64_ext_glFenceSync( void *args ); +extern NTSTATUS wow64_ext_glGetBufferPointerv( void *args ); +extern NTSTATUS wow64_ext_glGetBufferPointervARB( void *args ); +extern NTSTATUS wow64_ext_glGetNamedBufferPointerv( void *args ); +extern NTSTATUS wow64_ext_glGetNamedBufferPointervEXT( void *args ); +extern NTSTATUS wow64_ext_glGetStringi( void *args ); +extern NTSTATUS wow64_ext_glGetSynciv( void *args ); +extern NTSTATUS wow64_ext_glIsSync( void *args ); +extern NTSTATUS wow64_ext_glMapBuffer( void *args ); +extern NTSTATUS wow64_ext_glMapBufferARB( void *args ); +extern NTSTATUS wow64_ext_glMapBufferRange( void *args ); +extern NTSTATUS wow64_ext_glMapNamedBuffer( void *args ); +extern NTSTATUS wow64_ext_glMapNamedBufferEXT( void *args ); +extern NTSTATUS wow64_ext_glMapNamedBufferRange( void *args ); +extern NTSTATUS wow64_ext_glMapNamedBufferRangeEXT( void *args ); +extern NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ); +extern NTSTATUS wow64_ext_glUnmapBuffer( void *args ); +extern NTSTATUS wow64_ext_glUnmapBufferARB( void *args ); +extern NTSTATUS wow64_ext_glUnmapNamedBuffer( void *args ); +extern NTSTATUS wow64_ext_glUnmapNamedBufferEXT( void *args ); +extern NTSTATUS wow64_ext_glWaitSync( void *args ); +extern NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ); +extern NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ); +extern NTSTATUS wow64_ext_wglGetExtensionsStringARB( void *args ); +extern NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ); +extern NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ); +extern NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ); +extern NTSTATUS wow64_ext_wglQueryCurrentRendererStringWINE( void *args ); +extern NTSTATUS wow64_ext_wglQueryRendererStringWINE( void *args ); + +#endif
From: Jacek Caban jacek@codeweavers.com
--- dlls/opengl32/make_opengl | 1 + dlls/opengl32/unix_thunks.h | 31 +++++++++++++++++++++++++++++++ dlls/opengl32/unix_wgl.c | 29 ----------------------------- 3 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 7fa17fd1ac9..63ab5924694 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -1294,6 +1294,7 @@ 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"; }
diff --git a/dlls/opengl32/unix_thunks.h b/dlls/opengl32/unix_thunks.h index 8e2ac49d847..d893d015597 100644 --- a/dlls/opengl32/unix_thunks.h +++ b/dlls/opengl32/unix_thunks.h @@ -7,36 +7,67 @@ extern NTSTATUS wow64_wgl_wglDeleteContext( void *args ); extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ); extern NTSTATUS wow64_wgl_wglMakeCurrent( void *args ); extern NTSTATUS wow64_gl_glGetString( void *args ); +extern NTSTATUS ext_glClientWaitSync( void *args ); extern NTSTATUS wow64_ext_glClientWaitSync( void *args ); +extern NTSTATUS ext_glDeleteSync( void *args ); extern NTSTATUS wow64_ext_glDeleteSync( void *args ); +extern NTSTATUS ext_glFenceSync( void *args ); extern NTSTATUS wow64_ext_glFenceSync( void *args ); +extern NTSTATUS ext_glGetBufferPointerv( void *args ); extern NTSTATUS wow64_ext_glGetBufferPointerv( void *args ); +extern NTSTATUS ext_glGetBufferPointervARB( void *args ); extern NTSTATUS wow64_ext_glGetBufferPointervARB( void *args ); +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_glGetSynciv( void *args ); extern NTSTATUS wow64_ext_glGetSynciv( void *args ); +extern NTSTATUS ext_glIsSync( void *args ); extern NTSTATUS wow64_ext_glIsSync( void *args ); +extern NTSTATUS ext_glMapBuffer( void *args ); extern NTSTATUS wow64_ext_glMapBuffer( void *args ); +extern NTSTATUS ext_glMapBufferARB( void *args ); extern NTSTATUS wow64_ext_glMapBufferARB( void *args ); +extern NTSTATUS ext_glMapBufferRange( void *args ); extern NTSTATUS wow64_ext_glMapBufferRange( void *args ); +extern NTSTATUS ext_glMapNamedBuffer( void *args ); extern NTSTATUS wow64_ext_glMapNamedBuffer( void *args ); +extern NTSTATUS ext_glMapNamedBufferEXT( void *args ); extern NTSTATUS wow64_ext_glMapNamedBufferEXT( void *args ); +extern NTSTATUS ext_glMapNamedBufferRange( void *args ); extern NTSTATUS wow64_ext_glMapNamedBufferRange( void *args ); +extern NTSTATUS ext_glMapNamedBufferRangeEXT( void *args ); extern NTSTATUS wow64_ext_glMapNamedBufferRangeEXT( void *args ); +extern NTSTATUS ext_glPathGlyphIndexRangeNV( void *args ); extern NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ); +extern NTSTATUS ext_glUnmapBuffer( void *args ); extern NTSTATUS wow64_ext_glUnmapBuffer( void *args ); +extern NTSTATUS ext_glUnmapBufferARB( void *args ); extern NTSTATUS wow64_ext_glUnmapBufferARB( void *args ); +extern NTSTATUS ext_glUnmapNamedBuffer( void *args ); extern NTSTATUS wow64_ext_glUnmapNamedBuffer( void *args ); +extern NTSTATUS ext_glUnmapNamedBufferEXT( void *args ); extern NTSTATUS wow64_ext_glUnmapNamedBufferEXT( void *args ); +extern NTSTATUS ext_glWaitSync( void *args ); extern NTSTATUS wow64_ext_glWaitSync( void *args ); +extern NTSTATUS ext_wglCreateContextAttribsARB( void *args ); extern NTSTATUS wow64_ext_wglCreateContextAttribsARB( 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 ); extern NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ); +extern NTSTATUS ext_wglMakeContextCurrentARB( void *args ); extern NTSTATUS wow64_ext_wglMakeContextCurrentARB( 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 );
#endif diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 471eb4b9003..c9af47f50d0 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1389,35 +1389,6 @@ NTSTATUS get_pixel_formats( void *args )
typedef ULONG PTR32;
-extern NTSTATUS ext_glClientWaitSync( void *args ); -extern NTSTATUS ext_glDeleteSync( void *args ); -extern NTSTATUS ext_glFenceSync( void *args ); -extern NTSTATUS ext_glGetBufferPointerv( void *args ); -extern NTSTATUS ext_glGetBufferPointervARB( void *args ); -extern NTSTATUS ext_glGetNamedBufferPointerv( void *args ); -extern NTSTATUS ext_glGetNamedBufferPointervEXT( void *args ); -extern NTSTATUS ext_glGetSynciv( void *args ); -extern NTSTATUS ext_glIsSync( void *args ); -extern NTSTATUS ext_glMapBuffer( void *args ); - -extern NTSTATUS ext_glUnmapBuffer( void *args ); -extern NTSTATUS ext_glUnmapBufferARB( void *args ); -extern NTSTATUS ext_glUnmapNamedBuffer( void *args ); -extern NTSTATUS ext_glUnmapNamedBufferEXT( void *args ); - -extern NTSTATUS ext_glMapBufferARB( void *args ); -extern NTSTATUS ext_glMapBufferRange( void *args ); -extern NTSTATUS ext_glMapNamedBuffer( void *args ); -extern NTSTATUS ext_glMapNamedBufferEXT( void *args ); -extern NTSTATUS ext_glMapNamedBufferRange( void *args ); -extern NTSTATUS ext_glMapNamedBufferRangeEXT( void *args ); -extern NTSTATUS ext_glPathGlyphIndexRangeNV( void *args ); -extern NTSTATUS ext_glWaitSync( void *args ); -extern NTSTATUS ext_wglGetExtensionsStringARB( void *args ); -extern NTSTATUS ext_wglGetExtensionsStringEXT( void *args ); -extern NTSTATUS ext_wglQueryCurrentRendererStringWINE( void *args ); -extern NTSTATUS ext_wglQueryRendererStringWINE( void *args ); - struct wow64_string_entry { const char *str;
On Mon Jul 28 19:42:15 2025 +0000, Jacek Caban wrote:
changed this line in [version 3 of the diff](/wine/wine/-/merge_requests/8658/diffs?diff_id=195883&start_sha=af301f1f7535b978886a5b87a5774d9e338fe8dc#24139dae656713ba861751fb2c2ac38839349a7a_15_15)
Good catch, thanks.