Module: wine Branch: master Commit: e9c065e590133d5c19365c77b48eda99b7be367e URL: https://gitlab.winehq.org/wine/wine/-/commit/e9c065e590133d5c19365c77b48eda9...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Nov 25 10:14:36 2022 +0100
opengl32: Use the Unix call helpers.
---
dlls/opengl32/make_opengl | 3 +-- dlls/opengl32/unixlib.h | 3 +-- dlls/opengl32/wgl.c | 12 ++---------- 3 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 5d995495abd..5564b4b8526 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -1054,8 +1054,7 @@ print OUT " GLsizei length;\n"; print OUT " const GLchar *message;\n"; print OUT "};\n\n";
-print OUT "extern unixlib_handle_t unixlib_handle DECLSPEC_HIDDEN;\n"; -print OUT "#define UNIX_CALL( func, params ) __wine_unix_call( unixlib_handle, unix_ ## func, params )\n\n"; +print OUT "#define UNIX_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params )\n\n";
print OUT "#endif /* __WINE_OPENGL32_UNIXLIB_H */\n"; close OUT; diff --git a/dlls/opengl32/unixlib.h b/dlls/opengl32/unixlib.h index e7f21383f86..59f75b93c54 100644 --- a/dlls/opengl32/unixlib.h +++ b/dlls/opengl32/unixlib.h @@ -25351,7 +25351,6 @@ struct wine_gl_debug_message_params const GLchar *message; };
-extern unixlib_handle_t unixlib_handle DECLSPEC_HIDDEN; -#define UNIX_CALL( func, params ) __wine_unix_call( unixlib_handle, unix_ ## func, params ) +#define UNIX_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params )
#endif /* __WINE_OPENGL32_UNIXLIB_H */ diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 27efa6df745..1e7767374d5 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -39,8 +39,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(opengl); WINE_DECLARE_DEBUG_CHANNEL(fps);
-unixlib_handle_t unixlib_handle = 0; - static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} };
#ifndef _WIN64 @@ -1257,8 +1255,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) switch(reason) { case DLL_PROCESS_ATTACH: - if ((status = NtQueryVirtualMemory( GetCurrentProcess(), hinst, MemoryWineUnixFuncs, - &unixlib_handle, sizeof(unixlib_handle), NULL ))) + if ((status = __wine_init_unix_call())) { ERR( "Failed to load unixlib, status %#lx\n", status ); return FALSE; @@ -1276,12 +1273,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) break;
case DLL_PROCESS_DETACH: - if (!unixlib_handle) return TRUE; - if ((status = UNIX_CALL( process_detach, NULL ))) - { - WARN( "Failed to detach opengl32 unixlib, status %#lx\n", status ); - return FALSE; - } + UNIX_CALL( process_detach, NULL ); #ifndef _WIN64 cleanup_wow64_strings(); #endif