From d20f982433b6c1fe735699f3172e67d2e0a6884b Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 28 Apr 2008 12:28:19 -0700 Subject: [PATCH] winmm: Do not unload drivers when the process is terminating. --- dlls/winmm/winmm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/winmm/winmm.c b/dlls/winmm/winmm.c index a6fec99bf0..8342c44206 100644 --- a/dlls/winmm/winmm.c +++ b/dlls/winmm/winmm.c @@ -193,8 +193,14 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad) /* close all opened MCI drivers */ MCI_SendCommand(MCI_ALL_DEVICE_ID, MCI_CLOSE, MCI_WAIT, 0L, TRUE); MMDRV_Exit(); - /* now unload all remaining drivers... */ - DRIVER_UnloadAll(); + /* There's no guarantee the drivers haven't already been unloaded on + * process shutdown. + */ + if (!fImpLoad) + { + /* now unload all remaining drivers... */ + DRIVER_UnloadAll(); + } WINMM_DeleteIData(); break; -- 2.32.0.93.g670b81a890