From 20b4cdde55cdd1462d97c30c9e72f128b7d24df4 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Tue, 2 Jan 2024 11:50:58 +0100 Subject: [PATCH] user32: Load dynamically wine_get_version(). Signed-off-by: Eric Pouech --- 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 ); } }