Alistair Leslie-Hughes : mfreadwrite: Register MFReadWriteClassFactory interface.

Alexandre Julliard julliard at winehq.org
Mon Feb 4 13:29:54 CST 2019


Module: wine
Branch: master
Commit: 46911cf90a526ef3207ff9e396687ba8ab1b05a7
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=46911cf90a526ef3207ff9e396687ba8ab1b05a7

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Thu Jan 31 07:53:50 2019 +0000

mfreadwrite: Register MFReadWriteClassFactory interface.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mfreadwrite/Makefile.in      |  3 +++
 dlls/mfreadwrite/main.c           | 16 +++++++++++++++-
 dlls/mfreadwrite/mf_classes.idl   | 25 +++++++++++++++++++++++++
 dlls/mfreadwrite/mfreadwrite.spec |  2 ++
 4 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/dlls/mfreadwrite/Makefile.in b/dlls/mfreadwrite/Makefile.in
index 4b8ee82..afefdb5 100644
--- a/dlls/mfreadwrite/Makefile.in
+++ b/dlls/mfreadwrite/Makefile.in
@@ -1,5 +1,8 @@
 MODULE    = mfreadwrite.dll
 IMPORTLIB = mfreadwrite
+IMPORTS   = mfuuid uuid
 
 C_SRCS = \
 	main.c
+
+IDL_SRCS = mf_classes.idl
diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c
index 2a5e29a..666e5ae 100644
--- a/dlls/mfreadwrite/main.c
+++ b/dlls/mfreadwrite/main.c
@@ -24,13 +24,16 @@
 
 #include "windef.h"
 #include "winbase.h"
-#include "initguid.h"
+#include "ole2.h"
+#include "rpcproxy.h"
 #include "mfreadwrite.h"
 
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
 
+static HINSTANCE mfinstance;
+
 BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
 {
     switch (reason)
@@ -38,6 +41,7 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
         case DLL_WINE_PREATTACH:
             return FALSE;    /* prefer native version */
         case DLL_PROCESS_ATTACH:
+            mfinstance = instance;
             DisableThreadLibraryCalls(instance);
             break;
     }
@@ -65,6 +69,16 @@ HRESULT WINAPI DllCanUnloadNow(void)
     return S_FALSE;
 }
 
+HRESULT WINAPI DllRegisterServer(void)
+{
+    return __wine_register_resources( mfinstance );
+}
+
+HRESULT WINAPI DllUnregisterServer(void)
+{
+    return __wine_unregister_resources( mfinstance );
+}
+
 typedef struct _srcreader
 {
     IMFSourceReader IMFSourceReader_iface;
diff --git a/dlls/mfreadwrite/mf_classes.idl b/dlls/mfreadwrite/mf_classes.idl
new file mode 100644
index 0000000..99dbd80
--- /dev/null
+++ b/dlls/mfreadwrite/mf_classes.idl
@@ -0,0 +1,25 @@
+/*
+ *
+ * Copyright 2019 Alistair Leslie-Hughes
+ *
+ * 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
+
+[
+    threading(both),
+    uuid(48e2ed0f-98c2-4a37-bed5-166312ddd83f)
+]
+coclass MFReadWriteClassFactory { interface IMFReadWriteClassFactory; }
diff --git a/dlls/mfreadwrite/mfreadwrite.spec b/dlls/mfreadwrite/mfreadwrite.spec
index f46c592..ad61646 100644
--- a/dlls/mfreadwrite/mfreadwrite.spec
+++ b/dlls/mfreadwrite/mfreadwrite.spec
@@ -1,5 +1,7 @@
 @ stdcall -private DllCanUnloadNow()
 @ stdcall -private DllGetClassObject(ptr ptr ptr)
+@ stdcall -private DllRegisterServer()
+@ stdcall -private DllUnregisterServer()
 @ stub MFCreateSinkWriterFromMediaSink
 @ stub MFCreateSinkWriterFromURL
 @ stdcall MFCreateSourceReaderFromByteStream(ptr ptr ptr)




More information about the wine-cvs mailing list