Alistair Leslie-Hughes : dmloader: Stop after find first matching object.

Alexandre Julliard julliard at winehq.org
Mon Apr 20 15:01:51 CDT 2020


Module: wine
Branch: oldstable
Commit: 4e520837812af5f4d58d524d31009b0b027d3960
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=4e520837812af5f4d58d524d31009b0b027d3960

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Fri Nov 22 08:22:35 2019 +0000

dmloader: Stop after find first matching object.

This stops a crash in Legoland on startup when finding cached objects.
Placing a break in each of the if's causes the wrong object to be loaded.

The help states it looks at each type in order. So, we might have to loop
the cache multiple times to ensure that when an object has flag DMUS_OBJ_OBJECT,
it's preferred over a DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH match.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 4aee9ba5ad1c7df34a06fe2bbe39ae33fd8ffcee)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/dmloader/loader.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c
index 8b979da36a..0a3f62a111 100644
--- a/dlls/dmloader/loader.c
+++ b/dlls/dmloader/loader.c
@@ -208,6 +208,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac
 				TRACE(": not loaded yet\n");
 				pObjectEntry = pExistingEntry;
 			}
+			break;
 		}
 		else if ((pDesc->dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) &&
 				(pExistingEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) &&




More information about the wine-cvs mailing list