From 422c4fbf71079ca6e3940bb9b53e5a74f78651c1 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 28 Oct 2019 22:35:15 +0100 Subject: [PATCH] dmband: Simplify DllGetClassObject. Signed-off-by: Alistair Leslie-Hughes Signed-off-by: Michael Stefaniuc Signed-off-by: Alexandre Julliard --- dlls/dmband/dmband_main.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/dlls/dmband/dmband_main.c b/dlls/dmband/dmband_main.c index f72b41570b7..e63678c831d 100644 --- a/dlls/dmband/dmband_main.c +++ b/dlls/dmband/dmband_main.c @@ -145,16 +145,11 @@ 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)) + return IClassFactory_QueryInterface(&Band_CF.IClassFactory_iface, riid, ppv); + else if (IsEqualCLSID(rclsid, &CLSID_DirectMusicBandTrack)) + return IClassFactory_QueryInterface(&BandTrack_CF.IClassFactory_iface, riid, ppv); + WARN("(%s, %s, %p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv); return CLASS_E_CLASSNOTAVAILABLE; } -- 2.11.4.GIT