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@hotmail.com>
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2019-11-22 08:22:35 +00:00 committed by Alexandre Julliard
parent b909b2c5cf
commit 4aee9ba5ad
1 changed files with 1 additions and 0 deletions

View File

@ -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)) &&