[2/2] wmphoto: Register WMP encoder and decoder classes.

Vincent Povirk vincent at codeweavers.com
Wed Aug 16 16:08:52 CDT 2017


This allows some photo tools in Office 2010 to work. It doesn't
use the classes, just checks that they're registered.

Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
---
 dlls/wmphoto/Makefile.in |  2 ++
 dlls/wmphoto/main.c      | 10 ++++++----
 dlls/wmphoto/wmphoto.idl | 42 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 4 deletions(-)
 create mode 100644 dlls/wmphoto/wmphoto.idl

diff --git a/dlls/wmphoto/Makefile.in b/dlls/wmphoto/Makefile.in
index 115de54..d31af33 100644
--- a/dlls/wmphoto/Makefile.in
+++ b/dlls/wmphoto/Makefile.in
@@ -1,3 +1,5 @@
 MODULE = wmphoto.dll
 
 C_SRCS = main.c
+
+IDL_SRCS = wmphoto.idl
diff --git a/dlls/wmphoto/main.c b/dlls/wmphoto/main.c
index 48fd5dc..a92f18b 100644
--- a/dlls/wmphoto/main.c
+++ b/dlls/wmphoto/main.c
@@ -24,16 +24,20 @@
 #include "windef.h"
 #include "winbase.h"
 #include "objbase.h"
+#include "rpcproxy.h"
 
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(wincodecs);
 
+static HINSTANCE WMPHOTO_hInstance;
+
 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 {
     switch (fdwReason)
     {
     case DLL_PROCESS_ATTACH:
+        WMPHOTO_hInstance = hinstDLL;
         DisableThreadLibraryCalls(hinstDLL);
         break;
     case DLL_WINE_PREATTACH:
@@ -56,12 +60,10 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID * ppv)
 
 HRESULT WINAPI DllRegisterServer(void)
 {
-    FIXME("wmphoto: stub\n");
-    return E_NOTIMPL;
+    return __wine_register_resources( WMPHOTO_hInstance );
 }
 
 HRESULT WINAPI DllUnregisterServer(void)
 {
-    FIXME("wmphoto: stub\n");
-    return E_NOTIMPL;
+    return __wine_unregister_resources( WMPHOTO_hInstance );
 }
diff --git a/dlls/wmphoto/wmphoto.idl b/dlls/wmphoto/wmphoto.idl
new file mode 100644
index 0000000..b2a47c1
--- /dev/null
+++ b/dlls/wmphoto/wmphoto.idl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2017 Vincent Povirk for CodeWeavers
+ *
+ * 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
+ */
+
+#pragma makedep register
+
+import "unknwn.idl";
+import "wincodec.idl";
+
+[
+    helpstring("WIC WMP Decoder"),
+    uuid(a26cec36-234c-4950-ae16-e34aace71d0d),
+    threading(both)
+]
+coclass WICWmpDecoder
+{
+    [default] interface IWICBitmapDecoder;
+};
+
+[
+    helpstring("WIC WMP Encoder"),
+    uuid(ac4ce3cb-e1c1-44cd-8215-5a1665509ec2),
+    threading(both)
+]
+coclass WICWmpEncoder
+{
+    [default] interface IWICBitmapEncoder;
+};
-- 
2.7.4




More information about the wine-patches mailing list