Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Remove IID_IClassFactory checks Cast to a IUnknown pointer.
dlls/dmband/dmband_main.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/dmband/dmband_main.c b/dlls/dmband/dmband_main.c index f72b41570b..0a5a5c066e 100644 --- a/dlls/dmband/dmband_main.c +++ b/dlls/dmband/dmband_main.c @@ -145,16 +145,16 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
- if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBand) && IsEqualIID (riid, &IID_IClassFactory)) { - *ppv = &Band_CF; - IClassFactory_AddRef((IClassFactory*)*ppv); - return S_OK; - } else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBandTrack) && IsEqualIID (riid, &IID_IClassFactory)) { - *ppv = &BandTrack_CF; - IClassFactory_AddRef((IClassFactory*)*ppv); - return S_OK; - } - + if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBand)) + *ppv = &Band_CF; + else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBandTrack)) + *ppv = &BandTrack_CF; + + if (*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv); return CLASS_E_CLASSNOTAVAILABLE; }