[PATCH 1/2] xactengine3_7: Move DllGetClassObject to it's own file

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Mon Aug 3 23:26:17 CDT 2020


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/xactengine3_7/Makefile.in |  1 +
 dlls/xactengine3_7/main.c      | 42 ++++++++++++++++++++++++++++++++++
 dlls/xactengine3_7/xact_dll.c  | 14 +-----------
 3 files changed, 44 insertions(+), 13 deletions(-)
 create mode 100644 dlls/xactengine3_7/main.c

diff --git a/dlls/xactengine3_7/Makefile.in b/dlls/xactengine3_7/Makefile.in
index 6fce27d1628..bbbf239daf5 100644
--- a/dlls/xactengine3_7/Makefile.in
+++ b/dlls/xactengine3_7/Makefile.in
@@ -4,6 +4,7 @@ EXTRALIBS = $(FAUDIO_LIBS)
 EXTRAINCL = $(FAUDIO_CFLAGS)
 
 C_SRCS = \
+	main.c \
 	xact_dll.c
 
 IDL_SRCS = xact_classes.idl
diff --git a/dlls/xactengine3_7/main.c b/dlls/xactengine3_7/main.c
new file mode 100644
index 00000000000..659cbeeca9e
--- /dev/null
+++ b/dlls/xactengine3_7/main.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2018 Ethan Lee 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
+ */
+
+#include "config.h"
+
+#include <stdarg.h>
+
+#define COBJMACROS
+
+#include "xact_classes.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(xact3);
+
+extern IClassFactory XACTFactory;
+
+HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
+{
+    if (IsEqualGUID(rclsid, &CLSID_XACTEngine37))
+    {
+        TRACE("(%s, %s, %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
+        return IClassFactory_QueryInterface(&XACTFactory, riid, ppv);
+    }
+
+    FIXME("Unknown class %s\n", debugstr_guid(rclsid));
+    return CLASS_E_CLASSNOTAVAILABLE;
+}
diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c
index 69570e8ceff..d35bece8de9 100644
--- a/dlls/xactengine3_7/xact_dll.c
+++ b/dlls/xactengine3_7/xact_dll.c
@@ -488,7 +488,7 @@ static const IClassFactoryVtbl XACT3CF_Vtbl =
     XACT3CF_LockServer
 };
 
-static IClassFactory XACTFactory = { &XACT3CF_Vtbl };
+IClassFactory XACTFactory = { &XACT3CF_Vtbl };
 
 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *pReserved)
 {
@@ -509,18 +509,6 @@ HRESULT WINAPI DllCanUnloadNow(void)
     return S_FALSE;
 }
 
-HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
-{
-    if (IsEqualGUID(rclsid, &CLSID_XACTEngine37))
-    {
-        TRACE("(%s, %s, %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
-        return IClassFactory_QueryInterface(&XACTFactory, riid, ppv);
-    }
-
-    FIXME("Unknown class %s\n", debugstr_guid(rclsid));
-    return CLASS_E_CLASSNOTAVAILABLE;
-}
-
 HRESULT WINAPI DllRegisterServer(void)
 {
     return __wine_register_resources(instance);
-- 
2.27.0




More information about the wine-devel mailing list