[PATCH] oleaut32/tests: Correctly return interface pointer

Nikolay Sivov nsivov at codeweavers.com
Sun Feb 5 10:54:44 CST 2017


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/oleaut32/tests/olepicture.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c
index b716f25562..4a81e2e9b2 100644
--- a/dlls/oleaut32/tests/olepicture.c
+++ b/dlls/oleaut32/tests/olepicture.c
@@ -1391,14 +1391,9 @@ static HRESULT WINAPI NoStatStreamImpl_QueryInterface(
   NoStatStreamImpl* const This = impl_from_IStream(iface);
   if (ppvObject==0) return E_INVALIDARG;
   *ppvObject = 0;
-  if (IsEqualIID(&IID_IUnknown, riid))
-  {
-    *ppvObject = This;
-  }
-  else if (IsEqualIID(&IID_IStream, riid))
-  {
-    *ppvObject = This;
-  }
+
+  if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IStream, riid))
+    *ppvObject = &This->IStream_iface;
 
   if ((*ppvObject)==0)
     return E_NOINTERFACE;
-- 
2.11.0




More information about the wine-patches mailing list