-- v2: localspl: Avoid crash when driver_load fails.
From: Etaash Mathamsetty etaash.mathamsetty@gmail.com
--- dlls/localspl/provider.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c index e318736e09a..62c9ae6789a 100644 --- a/dlls/localspl/provider.c +++ b/dlls/localspl/provider.c @@ -2044,16 +2044,18 @@ static BOOL myAddPrinterDriverEx(DWORD level, LPBYTE pDriverInfo, DWORD dwFileCo
RegCloseKey(hdrv); hui = driver_load(env, di.pConfigFile); - pDrvDriverEvent = (void *)GetProcAddress(hui, "DrvDriverEvent"); - if (hui && pDrvDriverEvent) { - - /* Support for DrvDriverEvent is optional */ - TRACE("DRIVER_EVENT_INITIALIZE for %s (%s)\n", debugstr_w(di.pName), debugstr_w(di.pConfigFile)); - /* MSDN: level for DRIVER_INFO is 1 to 3 */ - res = pDrvDriverEvent(DRIVER_EVENT_INITIALIZE, 3, (LPBYTE) &di, 0); - TRACE("got %d from DRIVER_EVENT_INITIALIZE\n", res); + if (hui) { + pDrvDriverEvent = (void *)GetProcAddress(hui, "DrvDriverEvent"); + if (pDrvDriverEvent) { + + /* Support for DrvDriverEvent is optional */ + TRACE("DRIVER_EVENT_INITIALIZE for %s (%s)\n", debugstr_w(di.pName), debugstr_w(di.pConfigFile)); + /* MSDN: level for DRIVER_INFO is 1 to 3 */ + res = pDrvDriverEvent(DRIVER_EVENT_INITIALIZE, 3, (LPBYTE) &di, 0); + TRACE("got %d from DRIVER_EVENT_INITIALIZE\n", res); + } + FreeLibrary(hui); } - FreeLibrary(hui);
TRACE("=> TRUE with %lu\n", GetLastError()); return TRUE;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=148555
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 000000000198010C, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032
winmm: mci: Timeout