From 823c418d8e1bf59278b1f143c8688ad9e13b2bc2 Mon Sep 17 00:00:00 2001 From: Joris Huizer Date: Mon, 18 Oct 2004 21:21:19 +0000 Subject: [PATCH] Added IClassFactory->CreateInstance aggregation checks. --- dlls/amstream/amstream.c | 3 +++ dlls/itss/itss.c | 3 +++ dlls/quartz/filesource.c | 7 ++++++- dlls/quartz/filtergraph.c | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dlls/amstream/amstream.c b/dlls/amstream/amstream.c index c74846c319b..9b2d41d97fb 100644 --- a/dlls/amstream/amstream.c +++ b/dlls/amstream/amstream.c @@ -46,6 +46,9 @@ HRESULT AM_create(IUnknown *pUnkOuter, LPVOID *ppObj) IAMMultiMediaStreamImpl* object; FIXME("(%p,%p)\n", pUnkOuter, ppObj); + + if( pUnkOuter ) + return CLASS_E_NOAGGREGATION; object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAMMultiMediaStreamImpl)); diff --git a/dlls/itss/itss.c b/dlls/itss/itss.c index e7c415795fb..083539b3554 100644 --- a/dlls/itss/itss.c +++ b/dlls/itss/itss.c @@ -384,6 +384,9 @@ static HRESULT ITSS_create(IUnknown *pUnkOuter, LPVOID *ppObj) { ITStorageImpl *its; + if( pUnkOuter ) + return CLASS_E_NOAGGREGATION; + its = HeapAlloc( GetProcessHeap(), 0, sizeof(ITStorageImpl) ); its->vtbl_IITStorage = &ITStorageImpl_Vtbl; its->ref = 1; diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 037cc2c4d43..90ef4c91637 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -293,7 +293,12 @@ static HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, HRESULT AsyncReader_create(IUnknown * pUnkOuter, LPVOID * ppv) { - AsyncReader * pAsyncRead = CoTaskMemAlloc(sizeof(AsyncReader)); + AsyncReader *pAsyncRead; + + if( pUnkOuter ) + return CLASS_E_NOAGGREGATION; + + pAsyncRead = CoTaskMemAlloc(sizeof(AsyncReader)); if (!pAsyncRead) return E_OUTOFMEMORY; diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 8fc417b0b79..b56e8d98e3e 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -2416,6 +2416,9 @@ HRESULT FILTERGRAPH_create(IUnknown *pUnkOuter, LPVOID *ppObj) { TRACE("(%p,%p)\n", pUnkOuter, ppObj); + if( pUnkOuter ) + return CLASS_E_NOAGGREGATION; + fimpl = (IFilterGraphImpl *) HeapAlloc(GetProcessHeap(), 0, sizeof(*fimpl)); fimpl->IGraphBuilder_vtbl = &IGraphBuilder_VTable; fimpl->IMediaControl_vtbl = &IMediaControl_VTable;