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

Dmitry Timoshkov dmitry at baikal.ru
Mon Dec 23 01:38:08 CST 2013


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

diff --git a/dlls/taskschd/Makefile.in b/dlls/taskschd/Makefile.in
index 39e6c5b..2edda56 100644
--- a/dlls/taskschd/Makefile.in
+++ b/dlls/taskschd/Makefile.in
@@ -3,4 +3,6 @@ MODULE    = taskschd.dll
 C_SRCS = \
 	taskschd.c
 
+IDL_R_SRCS = schedule_classes.idl
+
 @MAKE_DLL_RULES@
diff --git a/dlls/taskschd/schedule_classes.idl b/dlls/taskschd/schedule_classes.idl
new file mode 100644
index 0000000..5f9dfc8
--- /dev/null
+++ b/dlls/taskschd/schedule_classes.idl
@@ -0,0 +1,29 @@
+/*
+ * Task Scheduler COM Classes
+ *
+ * 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 register
+
+[
+    threading(both),
+    progid("Schedule.Service.1"),
+    vi_progid("Schedule.Service"),
+    uuid(0f87369f-a4e5-4cfc-bd3e-73e6154572dd)
+]
+coclass TaskService { interface ITaskService; }
diff --git a/dlls/taskschd/taskschd.c b/dlls/taskschd/taskschd.c
index 241db94..f664ad6 100644
--- a/dlls/taskschd/taskschd.c
+++ b/dlls/taskschd/taskschd.c
@@ -25,11 +25,15 @@
 
 #include "windef.h"
 #include "winbase.h"
+#include "objbase.h"
+#include "rpcproxy.h"
 
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(taskschd);
 
+static HINSTANCE schd_instance;
+
 /******************************************************************
  *      DllMain
  */
@@ -41,8 +45,25 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
         return FALSE; /* prefer native version */
 
     case DLL_PROCESS_ATTACH:
+        schd_instance = hinst;
         DisableThreadLibraryCalls(hinst);
         break;
     }
     return TRUE;
 }
+
+/***********************************************************************
+ *      DllRegisterServer
+ */
+HRESULT WINAPI DllRegisterServer(void)
+{
+    return __wine_register_resources(schd_instance);
+}
+
+/***********************************************************************
+ *      DllUnregisterServer
+ */
+HRESULT WINAPI DllUnregisterServer(void)
+{
+    return __wine_unregister_resources(schd_instance);
+}
diff --git a/dlls/taskschd/taskschd.spec b/dlls/taskschd/taskschd.spec
index b79e689..d20e3d1 100644
--- a/dlls/taskschd/taskschd.spec
+++ b/dlls/taskschd/taskschd.spec
@@ -1,5 +1,5 @@
 @ stub DllCanUnloadNow
 @ stub DllGetClassObject
 @ stub DllGetVersion
-@ stub DllRegisterServer
-@ stub DllUnregisterServer
+@ stdcall -private DllRegisterServer()
+@ stdcall -private DllUnregisterServer()
-- 
1.8.5.2




More information about the wine-patches mailing list