Andrew Nguyen : dxdiagn: Fail class instantiation if aggregation is requested.

Alexandre Julliard julliard at winehq.org
Tue Dec 22 09:58:59 CST 2009


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

Author: Andrew Nguyen <arethusa26 at gmail.com>
Date:   Tue Dec 22 04:15:07 2009 -0600

dxdiagn: Fail class instantiation if aggregation is requested.

---

 dlls/dxdiagn/provider.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/dxdiagn/provider.c b/dlls/dxdiagn/provider.c
index 21bb32d..0795910 100644
--- a/dlls/dxdiagn/provider.c
+++ b/dlls/dxdiagn/provider.c
@@ -139,12 +139,12 @@ HRESULT DXDiag_CreateDXDiagProvider(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, R
   IDxDiagProviderImpl* provider;
 
   TRACE("(%p, %s, %p)\n", punkOuter, debugstr_guid(riid), ppobj);
-  
+
+  *ppobj = NULL;
+  if (punkOuter) return CLASS_E_NOAGGREGATION;
+
   provider = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDxDiagProviderImpl));
-  if (NULL == provider) {
-    *ppobj = NULL;
-    return E_OUTOFMEMORY;
-  }
+  if (NULL == provider) return E_OUTOFMEMORY;
   provider->lpVtbl = &DxDiagProvider_Vtbl;
   provider->ref = 0; /* will be inited with QueryInterface */
   return IDxDiagProviderImpl_QueryInterface ((PDXDIAGPROVIDER)provider, riid, ppobj);




More information about the wine-cvs mailing list