From 32f917399811c4f7d11cd080058fc8c1ac1ae184 Mon Sep 17 00:00:00 2001 From: Damjan Jovanovic Date: Fri, 22 Oct 2010 15:14:40 +0200 Subject: [PATCH] windowscodecs: Add COM proxies and stubs. --- .gitignore | 2 ++ dlls/windowscodecs/Makefile.in | 8 +++++++- dlls/windowscodecs/clsfactory.c | 4 +++- dlls/windowscodecs/main.c | 4 +++- dlls/windowscodecs/regsvr.c | 11 +++++++++-- dlls/windowscodecs/windowscodecs_wincodec.idl | 19 +++++++++++++++++++ 6 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 dlls/windowscodecs/windowscodecs_wincodec.idl diff --git a/.gitignore b/.gitignore index dcbab5394ed..bfb87d97f35 100644 --- a/.gitignore +++ b/.gitignore @@ -139,6 +139,8 @@ dlls/sti/sti_wia.h dlls/sti/sti_wia_p.c dlls/urlmon/urlmon_urlmon.h dlls/urlmon/urlmon_urlmon_p.c +dlls/windowscodecs/windowscodecs_wincodec.h +dlls/windowscodecs/windowscodecs_wincodec_p.c include/activaut.h include/activdbg.h include/activscp.h diff --git a/dlls/windowscodecs/Makefile.in b/dlls/windowscodecs/Makefile.in index 53868a09f68..9dd9302329e 100644 --- a/dlls/windowscodecs/Makefile.in +++ b/dlls/windowscodecs/Makefile.in @@ -1,7 +1,8 @@ MODULE = windowscodecs.dll IMPORTLIB = windowscodecs -IMPORTS = uuid ole32 shlwapi advapi32 +IMPORTS = uuid ole32 oleaut32 shlwapi advapi32 rpcrt4 EXTRAINCL = @PNGINCL@ +EXTRADEFS = -DENTRY_PREFIX=WIC_ -DPROXY_DELEGATION -DREGISTER_PROXY_DLL C_SRCS = \ bmpdecode.c \ @@ -27,4 +28,9 @@ C_SRCS = \ RC_SRCS = version.rc +IDL_P_SRCS = \ + windowscodecs_wincodec.idl + +EXTRA_OBJS = dlldata.o + @MAKE_DLL_RULES@ diff --git a/dlls/windowscodecs/clsfactory.c b/dlls/windowscodecs/clsfactory.c index 82de283dcd1..3c718cbbaf8 100644 --- a/dlls/windowscodecs/clsfactory.c +++ b/dlls/windowscodecs/clsfactory.c @@ -36,6 +36,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); +extern HRESULT WINAPI WIC_DllGetClassObject(REFCLSID, REFIID, LPVOID *) DECLSPEC_HIDDEN; + typedef struct { REFCLSID classid; HRESULT (*constructor)(IUnknown*,REFIID,void**); @@ -174,7 +176,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) if (info) ret = ClassFactoryImpl_Constructor(info, iid, ppv); else - ret = CLASS_E_CLASSNOTAVAILABLE; + ret = WIC_DllGetClassObject(rclsid, iid, ppv); TRACE("<-- %08X\n", ret); return ret; diff --git a/dlls/windowscodecs/main.c b/dlls/windowscodecs/main.c index 6f37f5dea8f..823fec2f5cf 100644 --- a/dlls/windowscodecs/main.c +++ b/dlls/windowscodecs/main.c @@ -32,6 +32,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); +extern BOOL WINAPI WIC_DllMain(HINSTANCE, DWORD, LPVOID) DECLSPEC_HIDDEN; + BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { @@ -44,7 +46,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) break; } - return TRUE; + return WIC_DllMain(hinstDLL, fdwReason, lpvReserved); } HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer, diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c index 3d395f6a572..f8f61794788 100644 --- a/dlls/windowscodecs/regsvr.c +++ b/dlls/windowscodecs/regsvr.c @@ -1294,13 +1294,18 @@ static struct regsvr_converter const converter_list[] = { { NULL } /* list terminator */ }; +extern HRESULT WINAPI WIC_DllRegisterServer(void) DECLSPEC_HIDDEN; +extern HRESULT WINAPI WIC_DllUnregisterServer(void) DECLSPEC_HIDDEN; + HRESULT WINAPI DllRegisterServer(void) { HRESULT hr; TRACE("\n"); - hr = register_coclasses(coclass_list); + hr = WIC_DllRegisterServer(); + if (SUCCEEDED(hr)) + hr = register_coclasses(coclass_list); if (SUCCEEDED(hr)) register_decoders(decoder_list); if (SUCCEEDED(hr)) @@ -1316,7 +1321,9 @@ HRESULT WINAPI DllUnregisterServer(void) TRACE("\n"); - hr = unregister_coclasses(coclass_list); + hr = WIC_DllUnregisterServer(); + if (SUCCEEDED(hr)) + hr = unregister_coclasses(coclass_list); if (SUCCEEDED(hr)) unregister_decoders(decoder_list); if (SUCCEEDED(hr)) diff --git a/dlls/windowscodecs/windowscodecs_wincodec.idl b/dlls/windowscodecs/windowscodecs_wincodec.idl new file mode 100644 index 00000000000..33b47745afd --- /dev/null +++ b/dlls/windowscodecs/windowscodecs_wincodec.idl @@ -0,0 +1,19 @@ +/* + * Copyright 2010 Damjan Jovanovic + * + * 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 + */ + +#include "wincodec.idl"