Module: wine Branch: master Commit: 20b4cdde55cdd1462d97c30c9e72f128b7d24df4 URL: https://gitlab.winehq.org/wine/wine/-/commit/20b4cdde55cdd1462d97c30c9e72f12...
Author: Eric Pouech epouech@codeweavers.com Date: Tue Jan 2 11:50:58 2024 +0100
user32: Load dynamically wine_get_version().
Signed-off-by: Eric Pouech epouech@codeweavers.com
---
dlls/user32/nonclient.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index 00c7368c516..b28e9e258da 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -159,12 +159,16 @@ LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ) if (hmodule) { BOOL (WINAPI *aboutproc)(HWND, LPCSTR, LPCSTR, HICON); - extern const char * CDECL wine_get_version(void); + const char * (CDECL *p_wine_get_version)(void); char app[256];
- sprintf( app, "Wine %s", wine_get_version() ); + p_wine_get_version = (void *)GetProcAddress( GetModuleHandleW(L"ntdll.dll"), "wine_get_version" ); aboutproc = (void *)GetProcAddress( hmodule, "ShellAboutA" ); - if (aboutproc) aboutproc( hwnd, app, NULL, 0 ); + if (p_wine_get_version && aboutproc) + { + snprintf( app, ARRAY_SIZE(app), "Wine %s", p_wine_get_version() ); + aboutproc( hwnd, app, NULL, 0 ); + } FreeLibrary( hmodule ); } }