Hi, My hope that was for Wine 1.0 we could add error handling for missing dlls and functions that made sense to the user rather than just silent failed or spewed messages to the console. If you have an application that depends on a dll such as OUTLOOK.EXE depending on OUTLIB.DLL you will get a message like this:
err:module:import_dll Library OUTLLIB.dll (which is needed by L"Z:\\home\\sedwards\\.wine\\drive_c\\Program Files\\Microsoft Office\\OFFICE11\\OUTLOOK.EXE") not found err:module:LdrInitializeThunk Main exe initialization for L"Z:\\home\\sedwards\\.wine\\drive_c\\Program Files\\Microsoft Office\\OFFICE11\\OUTLOOK.EXE" failed, status c0000135 So instead how about throwing a nice message box? I started working on this but don't quite know how to properly pass the information to the MessageBoxW or maybe fill in the MessageBoxIndirect structure to display the error in a human readable format. I just don't really know. Of course once its done this would need to be broken out in to a helper function, its just a proof of concept.... Anyone want to help? -- Steven Edwards "There is one thing stronger than all the armies in the world, and that is an idea whose time has come." - Victor Hugo
From 9161f10f89019cc8fb99efae8f3f6f1f2f7a6449 Mon Sep 17 00:00:00 2001 From: Steven Edwards <[EMAIL PROTECTED]> Date: Thu, 24 Apr 2008 02:21:08 -0400 Subject: [PATCH] Started hacking on adding a MessageBox error for missing dlls --- dlls/ntdll/loader.c | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index b0000b8..0b34dfd 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -514,8 +514,30 @@ static WINE_MODREF *import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *d if (status) { if (status == STATUS_DLL_NOT_FOUND) + { + UNICODE_STRING wstr; + ANSI_STRING str; + HMODULE hdll; + NTSTATUS nts,nts2; + FARPROC pMessageBoxW; + WCHAR user32[] = {'u','s','e','r','3','2','.','d','l','l',0}; + + RtlInitUnicodeString( &wstr, user32 ); + nts = LdrLoadDll(0, 0, &wstr, &hdll); + if (nts != STATUS_SUCCESS) + ERR("couldn't load user32 to display error\n"); + + RtlInitAnsiString( &str, "MessageBoxW" ); + nts2 = LdrGetProcedureAddress( hdll, &str, 0, (void**)&pMessageBoxW ); + if (nts2 != STATUS_SUCCESS) + ERR("Couldn't import MessageBoxW\n"); + + pMessageBoxW(NULL,"Library %s (which is needed by %s) not found\n", + name, debugstr_w(current_modref->ldr.FullDllName.Buffer),NULL,NULL); + ERR("Library %s (which is needed by %s) not found\n", name, debugstr_w(current_modref->ldr.FullDllName.Buffer)); + } else ERR("Loading library %s (which is needed by %s) failed (error %x).\n", name, debugstr_w(current_modref->ldr.FullDllName.Buffer), status); -- 1.5.3.7