Lei Zhang : quartz: Set *ppvObject to NULL if QueryInterface fails.

Alexandre Julliard julliard at winehq.org
Thu Dec 13 08:23:16 CST 2007


Module: wine
Branch: master
Commit: f5075f73564c0956a22fa4f914da7187d91410c2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f5075f73564c0956a22fa4f914da7187d91410c2

Author: Lei Zhang <thestig at google.com>
Date:   Thu Dec 13 03:14:56 2007 -0800

quartz: Set *ppvObject to NULL if QueryInterface fails.

---

 dlls/quartz/enummoniker.c          |    1 +
 dlls/quartz/main.c                 |    1 +
 dlls/quartz/systemclock.c          |    1 +
 dlls/quartz/tests/referenceclock.c |    2 --
 4 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/quartz/enummoniker.c b/dlls/quartz/enummoniker.c
index 5c31494..86b4bb4 100644
--- a/dlls/quartz/enummoniker.c
+++ b/dlls/quartz/enummoniker.c
@@ -89,6 +89,7 @@ static HRESULT WINAPI EnumMonikerImpl_QueryInterface(
         return S_OK;
     }
 
+    *ppvObj = NULL;
     FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
     return E_NOINTERFACE;
 }
diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c
index 1e73979..66b6f6a 100644
--- a/dlls/quartz/main.c
+++ b/dlls/quartz/main.c
@@ -89,6 +89,7 @@ DSCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
 	return S_OK;
     }
 
+    *ppobj = NULL;
     WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
     return E_NOINTERFACE;
 }
diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c
index 005a5c7..7f52b95 100644
--- a/dlls/quartz/systemclock.c
+++ b/dlls/quartz/systemclock.c
@@ -210,6 +210,7 @@ static HRESULT WINAPI SystemClockImpl_QueryInterface(IReferenceClock* iface, REF
     return S_OK;
   }
   
+  *ppobj = NULL;
   WARN("(%p, %s,%p): not found\n", This, debugstr_guid(riid), ppobj);
   return E_NOINTERFACE;
 }
diff --git a/dlls/quartz/tests/referenceclock.c b/dlls/quartz/tests/referenceclock.c
index 628fee0..639af46 100644
--- a/dlls/quartz/tests/referenceclock.c
+++ b/dlls/quartz/tests/referenceclock.c
@@ -38,9 +38,7 @@ static void test_IReferenceClock_query_interface(const char * clockdesc, IRefere
 
     hr = IReferenceClock_QueryInterface(pClock, &IID_IDirectDraw, (LPVOID *)&pF);
     ok(hr == E_NOINTERFACE, "IReferenceClock_QueryInterface returned %x\n", hr);
-    todo_wine {
     ok(pF == NULL, "pF is not NULL\n");
-    }
 
     hr = IReferenceClock_QueryInterface(pClock, &IID_IReferenceClock, (LPVOID *)&pF);
     ok(hr == S_OK, "IReferenceClock_QueryInterface returned %x\n", hr);




More information about the wine-cvs mailing list