diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index 4b76f325f66..e44d2b9fa7c 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -111,25 +111,6 @@ static HRESULT DMUSIC_CopyDescriptor(DMUS_OBJECTDESC *pDst, DMUS_OBJECTDESC *pSr return S_OK; } - -static BOOL DMUSIC_IsValidLoadableClass (REFCLSID pClassID) { - if (IsEqualCLSID(pClassID, &CLSID_DirectMusicAudioPathConfig) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicBand) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicContainer) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicCollection) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicChordMap) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicSegment) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicScript) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicSong) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicStyle) || - IsEqualCLSID(pClassID, &CLSID_DirectMusicGraph) || - IsEqualCLSID(pClassID, &CLSID_DirectSoundWave) || - IsEqualCLSID(pClassID, &GUID_DirectMusicAllTypes)) - return TRUE; - else - return FALSE; -} - /***************************************************************************** * IDirectMusicLoaderImpl implementation */ @@ -599,7 +580,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ScanDirectory(IDirectMusicLoader8 * HRESULT result; TRACE("(%p, %s, %s, %s)\n", This, debugstr_dmguid(rguidClass), debugstr_w(pwzFileExtension), debugstr_w(pwzScanFileName)); - if (IsEqualGUID (rguidClass, &GUID_DirectMusicAllTypes) || !DMUSIC_IsValidLoadableClass(rguidClass)) { + if (index_from_class(rguidClass) <= 0) { ERR(": rguidClass invalid CLSID\n"); return REGDB_E_CLASSNOTREG; } diff --git a/dlls/dmloader/tests/loader.c b/dlls/dmloader/tests/loader.c index 5d5cff46887..ff084b6e4b7 100644 --- a/dlls/dmloader/tests/loader.c +++ b/dlls/dmloader/tests/loader.c @@ -87,6 +87,8 @@ static void test_directory(void) IDirectMusicLoader_SetSearchDirectory(loader, NULL, path, 0); /* Crashes on Windows */ hr = IDirectMusicLoader_SetSearchDirectory(loader, &IID_IDirectMusicLoader8, path, 0); ok(hr == S_OK, "SetSearchDirectory failed with %#x\n", hr); + hr = IDirectMusicLoader_ScanDirectory(loader, &GUID_DirectMusicAllTypes, con, NULL); + ok(hr == REGDB_E_CLASSNOTREG, "ScanDirectory failed, received %#x\n", hr); /* NULL extension is not an error */ hr = IDirectMusicLoader_ScanDirectory(loader, &CLSID_DirectSoundWave, NULL, NULL);