From c81ac66d87f8f3d5c14c30863196d1c3330e39ee Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 11 Sep 2009 13:40:17 +0200 Subject: [PATCH] quartz: Add proxies for strmif.idl. --- .gitignore | 2 + dlls/quartz/Makefile.in | 7 ++- dlls/quartz/main.c | 104 ++++++++++++++++++++++------------ dlls/quartz/quartz_strmif.idl | 22 +++++++ dlls/quartz/regsvr.c | 59 +++---------------- 5 files changed, 107 insertions(+), 87 deletions(-) create mode 100644 dlls/quartz/quartz_strmif.idl diff --git a/.gitignore b/.gitignore index 7473244b187..cd44fce4105 100644 --- a/.gitignore +++ b/.gitignore @@ -106,6 +106,8 @@ dlls/qmgr/qmgr_local_i.c dlls/qmgrprxy/qmgrprxy.h dlls/qmgrprxy/qmgrprxy_i.c dlls/qmgrprxy/qmgrprxy_p.c +dlls/quartz/quartz_strmif.h +dlls/quartz/quartz_strmif_p.c dlls/rpcrt4/epm.h dlls/rpcrt4/epm_c.c dlls/rpcrt4/tests/server.h diff --git a/dlls/quartz/Makefile.in b/dlls/quartz/Makefile.in index c5114b9475d..1206d0a0c0b 100644 --- a/dlls/quartz/Makefile.in +++ b/dlls/quartz/Makefile.in @@ -4,7 +4,8 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = quartz.dll IMPORTLIB = quartz -IMPORTS = strmiids uuid dsound msacm32 msvfw32 ole32 oleaut32 shlwapi user32 gdi32 advapi32 kernel32 +IMPORTS = strmiids uuid dsound msacm32 msvfw32 ole32 oleaut32 shlwapi rpcrt4 user32 gdi32 advapi32 kernel32 +EXTRADEFS = -DENTRY_PREFIX=QUARTZ_ -DPROXY_DELEGATION -DREGISTER_PROXY_DLL C_SRCS = \ acmwrapper.c \ @@ -34,6 +35,10 @@ C_SRCS = \ RC_SRCS = version.rc +IDL_P_SRCS = quartz_strmif.idl + +EXTRA_OBJS = dlldata.o + @MAKE_DLL_RULES@ @DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/quartz/main.c b/dlls/quartz/main.c index 6b4c135d234..7828487b2dd 100644 --- a/dlls/quartz/main.c +++ b/dlls/quartz/main.c @@ -28,19 +28,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz); +extern HRESULT WINAPI QUARTZ_DllGetClassObject(REFCLSID, REFIID, LPVOID *) DECLSPEC_HIDDEN; +extern HRESULT WINAPI QUARTZ_DllCanUnloadNow(void) DECLSPEC_HIDDEN; +extern BOOL WINAPI QUARTZ_DllMain(HINSTANCE, DWORD, LPVOID) DECLSPEC_HIDDEN; + static DWORD dll_ref = 0; /* For the moment, do nothing here. */ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) { - switch(fdwReason) { - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hInstDLL); - break; - case DLL_PROCESS_DETACH: - break; - } - return TRUE; + return QUARTZ_DllMain( hInstDLL, fdwReason, lpv ); } /****************************************************************************** @@ -172,36 +169,29 @@ static const IClassFactoryVtbl DSCF_Vtbl = HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) { unsigned int i; - IClassFactoryImpl *factory; - + TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); - - if ( !IsEqualGUID( &IID_IClassFactory, riid ) - && ! IsEqualGUID( &IID_IUnknown, riid) ) - return E_NOINTERFACE; - for (i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++) + if (IsEqualGUID( &IID_IClassFactory, riid ) || IsEqualGUID( &IID_IUnknown, riid)) { - if (IsEqualGUID(object_creation[i].clsid, rclsid)) - break; + for (i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++) + { + if (IsEqualGUID(object_creation[i].clsid, rclsid)) + { + IClassFactoryImpl *factory = CoTaskMemAlloc(sizeof(*factory)); + if (factory == NULL) return E_OUTOFMEMORY; + + factory->ITF_IClassFactory.lpVtbl = &DSCF_Vtbl; + factory->ref = 1; + + factory->pfnCreateInstance = object_creation[i].pfnCreateInstance; + + *ppv = &factory->ITF_IClassFactory; + return S_OK; + } + } } - - if (i == sizeof(object_creation)/sizeof(object_creation[0])) - { - FIXME("%s: no class found.\n", debugstr_guid(rclsid)); - return CLASS_E_CLASSNOTAVAILABLE; - } - - factory = CoTaskMemAlloc(sizeof(*factory)); - if (factory == NULL) return E_OUTOFMEMORY; - - factory->ITF_IClassFactory.lpVtbl = &DSCF_Vtbl; - factory->ref = 1; - - factory->pfnCreateInstance = object_creation[i].pfnCreateInstance; - - *ppv = &(factory->ITF_IClassFactory); - return S_OK; + return QUARTZ_DllGetClassObject( rclsid, riid, ppv ); } /*********************************************************************** @@ -209,7 +199,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) */ HRESULT WINAPI DllCanUnloadNow(void) { - return dll_ref != 0 ? S_FALSE : S_OK; + if (dll_ref) return S_FALSE; + return QUARTZ_DllCanUnloadNow(); } @@ -225,6 +216,49 @@ static const struct { { { 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0} }, NULL } }; +/*********************************************************************** + * proxies + */ +HRESULT CALLBACK ICaptureGraphBuilder_FindInterface_Proxy( ICaptureGraphBuilder *This, + const GUID *pCategory, + IBaseFilter *pf, + REFIID riid, + void **ppint ) +{ + return ICaptureGraphBuilder_RemoteFindInterface_Proxy( This, pCategory, pf, + riid, (IUnknown **)ppint ); +} + +HRESULT __RPC_STUB ICaptureGraphBuilder_FindInterface_Stub( ICaptureGraphBuilder *This, + const GUID *pCategory, + IBaseFilter *pf, + REFIID riid, + IUnknown **ppint ) +{ + return ICaptureGraphBuilder_FindInterface( This, pCategory, pf, riid, (void **)ppint ); +} + +HRESULT CALLBACK ICaptureGraphBuilder2_FindInterface_Proxy( ICaptureGraphBuilder2 *This, + const GUID *pCategory, + const GUID *pType, + IBaseFilter *pf, + REFIID riid, + void **ppint ) +{ + return ICaptureGraphBuilder2_RemoteFindInterface_Proxy( This, pCategory, pType, + pf, riid, (IUnknown **)ppint ); +} + +HRESULT __RPC_STUB ICaptureGraphBuilder2_FindInterface_Stub( ICaptureGraphBuilder2 *This, + const GUID *pCategory, + const GUID *pType, + IBaseFilter *pf, + REFIID riid, + IUnknown **ppint ) +{ + return ICaptureGraphBuilder2_FindInterface( This, pCategory, pType, pf, riid, (void **)ppint ); +} + /*********************************************************************** * qzdebugstr_guid (internal) * diff --git a/dlls/quartz/quartz_strmif.idl b/dlls/quartz/quartz_strmif.idl new file mode 100644 index 00000000000..aad62321f27 --- /dev/null +++ b/dlls/quartz/quartz_strmif.idl @@ -0,0 +1,22 @@ +/* + * Copyright 2009 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* just a wrapper for strmif.idl */ + +cpp_quote("#include ") +#include "strmif.idl" diff --git a/dlls/quartz/regsvr.c b/dlls/quartz/regsvr.c index e7785c54307..cdb33d101c7 100644 --- a/dlls/quartz/regsvr.c +++ b/dlls/quartz/regsvr.c @@ -901,56 +901,6 @@ static struct regsvr_coclass const coclass_list[] = { */ static struct regsvr_interface const interface_list[] = { - { &IID_IFilterGraph, - "IFilterGraph", - NULL, - 11, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IFilterGraph2, - "IFilterGraph2", - NULL, - 21, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IFilterMapper, - "IFilterMapper", - NULL, - 11, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_IFilterMapper2, - "IFilterMapper2", - NULL, - 7, - NULL, - &CLSID_PSFactoryBuffer - }, - /* FIXME: - { &IID_SeekingPassThru, - "ISeekingPassThru", - NULL, - 4, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_AsyncReader, - "IAsyncReader", - NULL, - 11, - NULL, - &CLSID_PSFactoryBuffer - }, - { &IID_WAVEParser, - "IWAVEParser", - NULL, - 11, - NULL, - &CLSID_PSFactoryBuffer - },*/ { NULL } /* list terminator */ }; @@ -1213,6 +1163,9 @@ static struct regsvr_filter const filter_list[] = { { NULL } /* list terminator */ }; +extern HRESULT WINAPI QUARTZ_DllRegisterServer(void) DECLSPEC_HIDDEN; +extern HRESULT WINAPI QUARTZ_DllUnregisterServer(void) DECLSPEC_HIDDEN; + /*********************************************************************** * DllRegisterServer (QUARTZ.@) */ @@ -1222,7 +1175,9 @@ HRESULT WINAPI DllRegisterServer(void) TRACE("\n"); - hr = register_coclasses(coclass_list); + hr = QUARTZ_DllRegisterServer(); + if (SUCCEEDED(hr)) + hr = register_coclasses(coclass_list); if (SUCCEEDED(hr)) hr = register_interfaces(interface_list); if (SUCCEEDED(hr)) @@ -1252,5 +1207,7 @@ HRESULT WINAPI DllUnregisterServer(void) hr = unregister_mediatypes_parsing(mediatype_parsing_list); if (SUCCEEDED(hr)) hr = unregister_mediatypes_extension(mediatype_extension_list); + if (SUCCEEDED(hr)) + hr = QUARTZ_DllUnregisterServer(); return hr; }