Currently trying to dlopen winealsa.so, without having the matching libasound.so.2 installed, fails silently. This should make users aware of the missing dependency.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57206
-- v2: mmdevapi: Add error if no driver could be initialized. ntdll: Add warning if dlopen of unixlib failed. winecoreaudio.drv: Add warning if loading unixlib failed. wineoss.drv: Add warning if loading unixlib failed. winealsa.drv: Add warning if loading unixlib failed. winepulse.drv: Add warning if loading unixlib failed.
From: Bernhard Übelacker bernhardu@mailbox.org
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57206 --- dlls/winepulse.drv/mmdevdrv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 0617c5977c9..152ba446cd4 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -51,6 +51,7 @@ #include "../mmdevapi/mmdevdrv.h"
WINE_DEFAULT_DEBUG_CHANNEL(pulse); +WINE_DECLARE_DEBUG_CHANNEL(module);
#define MAX_PULSE_NAME_LEN 256
@@ -74,13 +75,17 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) { WCHAR buf[MAX_PATH]; WCHAR *filename; + NTSTATUS status;
switch (reason) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(dll); - if (__wine_init_unix_call()) + status = __wine_init_unix_call(); + if (status) { + WARN_(module)("Failed to load unixlib, status %#lx\n", status); return FALSE; + }
GetModuleFileNameW(dll, buf, ARRAY_SIZE(buf));
From: Bernhard Übelacker bernhardu@mailbox.org
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57206 --- dlls/winealsa.drv/mmdevdrv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index ee80aa7c09d..1035d2b49ba 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -50,6 +50,7 @@ #include "../mmdevapi/mmdevdrv.h"
WINE_DEFAULT_DEBUG_CHANNEL(alsa); +WINE_DECLARE_DEBUG_CHANNEL(module);
static WCHAR drv_key_devicesW[256]; static const WCHAR guidW[] = {'g','u','i','d',0}; @@ -62,8 +63,13 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) { WCHAR buf[MAX_PATH]; WCHAR *filename; + NTSTATUS status;
- if(__wine_init_unix_call()) return FALSE; + status = __wine_init_unix_call(); + if (status) { + WARN_(module)("Failed to load unixlib, status %#lx\n", status); + return FALSE; + }
GetModuleFileNameW(dll, buf, ARRAY_SIZE(buf));
From: Bernhard Übelacker bernhardu@mailbox.org
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57206 --- dlls/wineoss.drv/mmdevdrv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index 7b7d426d1df..b39e1dda3ed 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -47,6 +47,7 @@ #include "../mmdevapi/mmdevdrv.h"
WINE_DEFAULT_DEBUG_CHANNEL(oss); +WINE_DECLARE_DEBUG_CHANNEL(module);
typedef struct _OSSDevice { struct list entry; @@ -68,8 +69,13 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) { WCHAR buf[MAX_PATH]; WCHAR *filename; + NTSTATUS status;
- if(__wine_init_unix_call()) return FALSE; + status = __wine_init_unix_call(); + if (status) { + WARN_(module)("Failed to load unixlib, status %#lx\n", status); + return FALSE; + }
GetModuleFileNameW(dll, buf, ARRAY_SIZE(buf));
From: Bernhard Übelacker bernhardu@mailbox.org
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57206 --- dlls/winecoreaudio.drv/mmdevdrv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index 65e965c5556..996b1d8732b 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -44,6 +44,7 @@ #include "../mmdevapi/mmdevdrv.h"
WINE_DEFAULT_DEBUG_CHANNEL(coreaudio); +WINE_DECLARE_DEBUG_CHANNEL(module);
static WCHAR drv_key_devicesW[256];
@@ -55,10 +56,14 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) { WCHAR buf[MAX_PATH]; WCHAR *filename; + NTSTATUS status;
DisableThreadLibraryCalls(dll); - if (__wine_init_unix_call()) + status = __wine_init_unix_call(); + if (status) { + WARN_(module)("Failed to load unixlib, status %#lx\n", status); return FALSE; + }
GetModuleFileNameW(dll, buf, ARRAY_SIZE(buf));
From: Bernhard Übelacker bernhardu@mailbox.org
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57206 --- dlls/ntdll/unix/virtual.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index e168eed8c37..1ffda3c50e0 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -650,8 +650,13 @@ static NTSTATUS get_builtin_unix_funcs( void *module, BOOL wow, const void **fun LIST_FOR_EACH_ENTRY( builtin, &builtin_modules, struct builtin_module, entry ) { if (builtin->module != module) continue; - if (builtin->unix_path && !builtin->unix_handle) + if (builtin->unix_path && !builtin->unix_handle) { builtin->unix_handle = dlopen( builtin->unix_path, RTLD_NOW ); + if (!builtin->unix_handle) { + char* filename = strrchr(builtin->unix_path, '/') + 1; + WARN_(module)( "failed to load .so lib %s: %s\n", filename, dlerror()); + } + } if (builtin->unix_handle) { *funcs = dlsym( builtin->unix_handle, ptr_name );
From: Bernhard Übelacker bernhardu@mailbox.org
Currently there is no logging if all drivers could not be loaded. This could make users aware of missing dependencies.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57206 --- dlls/mmdevapi/main.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/mmdevapi/main.c b/dlls/mmdevapi/main.c index 36c94908d67..74643572348 100644 --- a/dlls/mmdevapi/main.c +++ b/dlls/mmdevapi/main.c @@ -179,6 +179,11 @@ static BOOL WINAPI init_driver(INIT_ONCE *once, void *param, void **context) load_driver_devices(eCapture); }
+ if (drvs.module == 0) + ERR("No driver from %s could be initialized. " + "Maybe check dependencies with WINEDEBUG=warn+module.\n", + wine_dbgstr_w(driver_list)); + return drvs.module != 0; }
v2: - This changes the previous ERR to a WARN, should therefore by default not be visible. - Also adds a WARN to each of the audio driver, also by default silent. - And puts an ERR to mmdevapi, this is the only one, which would be visible by default.
The warnings in DllMain of the drivers seem redundant, we already display a module warning on dll attach failure.