[4/4] taskschd: Add registration for TaskScheduler interfaces. Take 2.

Dmitry Timoshkov dmitry at baikal.ru
Tue Dec 24 04:56:00 CST 2013


---
 dlls/taskschd/Makefile.in      |  2 ++
 dlls/taskschd/taskschd.c       | 20 ++++++++++++++++++++
 dlls/taskschd/taskschd.spec    |  4 ++--
 dlls/taskschd/taskschd_tlb.idl | 21 +++++++++++++++++++++
 4 files changed, 45 insertions(+), 2 deletions(-)
 create mode 100644 dlls/taskschd/taskschd_tlb.idl

diff --git a/dlls/taskschd/Makefile.in b/dlls/taskschd/Makefile.in
index f5f758f..e9a19e6 100644
--- a/dlls/taskschd/Makefile.in
+++ b/dlls/taskschd/Makefile.in
@@ -4,4 +4,6 @@ C_SRCS = \
 	task.c \
 	taskschd.c
 
+IDL_TLB_SRCS = taskschd_tlb.idl
+
 @MAKE_DLL_RULES@
diff --git a/dlls/taskschd/taskschd.c b/dlls/taskschd/taskschd.c
index 4ad5f4c..ead8c5a 100644
--- a/dlls/taskschd/taskschd.c
+++ b/dlls/taskschd/taskschd.c
@@ -26,6 +26,7 @@
 #include "windef.h"
 #include "winbase.h"
 #include "objbase.h"
+#include "rpcproxy.h"
 #include "taskschd.h"
 #include "taskschd_private.h"
 
@@ -33,6 +34,8 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(taskschd);
 
+static HINSTANCE schd_instance;
+
 typedef struct
 {
     IClassFactory IClassFactory_iface;
@@ -123,6 +126,7 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
         return FALSE; /* prefer native version */
 
     case DLL_PROCESS_ATTACH:
+        schd_instance = hinst;
         DisableThreadLibraryCalls(hinst);
         break;
     }
@@ -161,6 +165,22 @@ HRESULT WINAPI DllCanUnloadNow(void)
     return S_FALSE;
 }
 
+/***********************************************************************
+ *      DllRegisterServer
+ */
+HRESULT WINAPI DllRegisterServer(void)
+{
+    return __wine_register_resources(schd_instance);
+}
+
+/***********************************************************************
+ *      DllUnregisterServer
+ */
+HRESULT WINAPI DllUnregisterServer(void)
+{
+    return __wine_unregister_resources(schd_instance);
+}
+
 const char *debugstr_variant(const VARIANT *v)
 {
     if (!v) return "(null)";
diff --git a/dlls/taskschd/taskschd.spec b/dlls/taskschd/taskschd.spec
index d7e3040..af75eea 100644
--- a/dlls/taskschd/taskschd.spec
+++ b/dlls/taskschd/taskschd.spec
@@ -1,5 +1,5 @@
 @ stdcall -private DllCanUnloadNow()
 @ stdcall -private DllGetClassObject(ptr ptr ptr)
 @ stub DllGetVersion
-@ stub DllRegisterServer
-@ stub DllUnregisterServer
+@ stdcall -private DllRegisterServer()
+@ stdcall -private DllUnregisterServer()
diff --git a/dlls/taskschd/taskschd_tlb.idl b/dlls/taskschd/taskschd_tlb.idl
new file mode 100644
index 0000000..6347a1a
--- /dev/null
+++ b/dlls/taskschd/taskschd_tlb.idl
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2013 Dmitry Timoshkov
+ *
+ * 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 typelib
+
+#include "taskschd.idl"
-- 
1.8.5.2




More information about the wine-patches mailing list