Changed last IDirect3D9->QueryInterface() according to hpoussin's feedback
authorGregor Brunmar <gbrunmar.ros@gmail.com>
Wed, 19 Dec 2007 20:06:34 +0000 (20:06 +0000)
committerGregor Brunmar <gbrunmar.ros@gmail.com>
Wed, 19 Dec 2007 20:06:34 +0000 (20:06 +0000)
svn path=/trunk/; revision=31333

reactos/dll/directx/d3d9/d3d9_impl.c

index 629e4b6..90f713d 100644 (file)
@@ -14,13 +14,16 @@ static ULONG WINAPI IDirect3D9Impl_AddRef(LPDIRECT3D9 iface);
 /* IDirect3D9: IUnknown implementation */
 static HRESULT WINAPI IDirect3D9Impl_QueryInterface(LPDIRECT3D9 iface, REFIID riid, LPVOID* ppvObject)
 {
+    LPDIRECTD3D9_INT This = (LPDIRECTD3D9_INT)iface;
+
     if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirect3D9))
     {
         IDirect3D9Impl_AddRef(iface);
-        *ppvObject = iface;
+        *ppvObject = &This->lpVtbl;
         return S_OK;
     }
 
+    *ppvObject = NULL;
     return E_NOINTERFACE;
 }