[PATCH] dmloader: Only use the GUID when looking for cached objects.

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Thu Nov 21 01:40:13 CST 2019


---
 dlls/dmloader/loader.c | 50 +-----------------------------------------
 1 file changed, 1 insertion(+), 49 deletions(-)

diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c
index 0da8323e7e5..c4c54412e12 100644
--- a/dlls/dmloader/loader.c
+++ b/dlls/dmloader/loader.c
@@ -208,55 +208,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac
 				TRACE(": not loaded yet\n");
 				pObjectEntry = pExistingEntry;
 			}
-		}
-		else if ((pDesc->dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) &&
-				(pExistingEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) &&
-				!wcsncmp (pDesc->wszFileName, pExistingEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) {
-			TRACE(": found it by fullpath filename\n");
-			if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) {
-				TRACE(": already loaded\n");
-				return IDirectMusicObject_QueryInterface (pExistingEntry->pObject, riid, ppv);
-			} else {
-				TRACE(": not loaded yet\n");
-				pObjectEntry = pExistingEntry;
-			}
-		}
-		else if ((pDesc->dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) &&
-				(pExistingEntry->Desc.dwValidData & (DMUS_OBJ_NAME | DMUS_OBJ_CATEGORY)) &&
-				!wcsncmp (pDesc->wszName, pExistingEntry->Desc.wszName, DMUS_MAX_NAME) &&
-				!wcsncmp (pDesc->wszCategory, pExistingEntry->Desc.wszCategory, DMUS_MAX_CATEGORY)) {
-			TRACE(": found it by name and category\n");
-			if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) {
-				TRACE(": already loaded\n");
-				return IDirectMusicObject_QueryInterface (pExistingEntry->pObject, riid, ppv);
-			} else {
-				TRACE(": not loaded yet\n");
-				pObjectEntry = pExistingEntry;
-			}
-		}
-		else if ((pDesc->dwValidData & DMUS_OBJ_NAME) &&
-				(pExistingEntry->Desc.dwValidData & DMUS_OBJ_NAME) &&
-				!wcsncmp (pDesc->wszName, pExistingEntry->Desc.wszName, DMUS_MAX_NAME)) {
-			TRACE(": found it by name\n");
-			if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) {
-				TRACE(": already loaded\n");
-				return IDirectMusicObject_QueryInterface (pExistingEntry->pObject, riid, ppv);
-			} else {
-				TRACE(": not loaded yet\n");
-				pObjectEntry = pExistingEntry;
-			}
-		}
-		else if ((pDesc->dwValidData & DMUS_OBJ_FILENAME) &&
-				(pExistingEntry->Desc.dwValidData & DMUS_OBJ_FILENAME) &&
-				!wcsncmp (pDesc->wszFileName, pExistingEntry->Desc.wszFileName, DMUS_MAX_FILENAME)) {
-			TRACE(": found it by filename\n");				
-			if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) {
-				TRACE(": already loaded\n");
-				return IDirectMusicObject_QueryInterface (pExistingEntry->pObject, riid, ppv);
-			} else {
-				TRACE(": not loaded yet\n");
-				pObjectEntry = pExistingEntry;
-			}
+			break;
 		}
 	}
 	
-- 
2.24.0




More information about the wine-devel mailing list