Add a spooler service skeleton. Now the Service-Winetests can be used unmodified.
authorEric Kohl <eric.kohl@reactos.org>
Wed, 3 Sep 2008 20:57:51 +0000 (20:57 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Wed, 3 Sep 2008 20:57:51 +0000 (20:57 +0000)
svn path=/trunk/; revision=35916

reactos/base/services/services.rbuild
reactos/base/services/spoolsv/spoolsv.c [new file with mode: 0644]
reactos/base/services/spoolsv/spoolsv.rbuild [new file with mode: 0644]
reactos/base/services/spoolsv/spoolsv.rc [new file with mode: 0644]

index e99db88..190ed54 100644 (file)
@@ -13,6 +13,9 @@
        <directory name="rpcss">
                <xi:include href="rpcss/rpcss.rbuild" />
        </directory>
        <directory name="rpcss">
                <xi:include href="rpcss/rpcss.rbuild" />
        </directory>
+       <directory name="spoolsv">
+               <xi:include href="spoolsv/spoolsv.rbuild" />
+       </directory>
        <directory name="svchost">
                <xi:include href="svchost/svchost.rbuild" />
        </directory>
        <directory name="svchost">
                <xi:include href="svchost/svchost.rbuild" />
        </directory>
diff --git a/reactos/base/services/spoolsv/spoolsv.c b/reactos/base/services/spoolsv/spoolsv.c
new file mode 100644 (file)
index 0000000..21640f1
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS kernel
+ * FILE:             services/spoolsv/spoolsv.c
+ * PURPOSE:          Printer spooler
+ * PROGRAMMER:       Eric Kohl
+ */
+
+/* INCLUDES *****************************************************************/
+
+#define WIN32_NO_STATUS
+#include <windows.h>
+
+#define NDEBUG
+#include <debug.h>
+
+/* GLOBALS ******************************************************************/
+
+#define SERVICE_NAME TEXT("Spooler")
+
+SERVICE_STATUS_HANDLE ServiceStatusHandle;
+
+
+/* FUNCTIONS *****************************************************************/
+
+
+static DWORD WINAPI
+ServiceControlHandler(DWORD dwControl,
+                      DWORD dwEventType,
+                      LPVOID lpEventData,
+                      LPVOID lpContext)
+{
+    switch (dwControl)
+    {
+        case SERVICE_CONTROL_STOP:
+        case SERVICE_CONTROL_SHUTDOWN:
+            return ERROR_SUCCESS;
+
+        default :
+            return ERROR_CALL_NOT_IMPLEMENTED;
+    }
+}
+
+
+
+static VOID CALLBACK
+ServiceMain(DWORD argc, LPTSTR *argv)
+{
+    UNREFERENCED_PARAMETER(argc);
+    UNREFERENCED_PARAMETER(argv);
+
+    DPRINT("ServiceMain() called\n");
+
+    ServiceStatusHandle = RegisterServiceCtrlHandlerExW(SERVICE_NAME,
+                                                        ServiceControlHandler,
+                                                        NULL);
+
+
+
+    DPRINT("ServiceMain() done\n");
+}
+
+
+int
+wmain(int argc, WCHAR *argv[])
+{
+    SERVICE_TABLE_ENTRY ServiceTable[2] =
+    {
+        {SERVICE_NAME, ServiceMain},
+        {NULL, NULL}
+    };
+
+    UNREFERENCED_PARAMETER(argc);
+    UNREFERENCED_PARAMETER(argv);
+
+    DPRINT("Spoolsv: main() started\n");
+
+    StartServiceCtrlDispatcher(ServiceTable);
+
+    DPRINT("Spoolsv: main() done\n");
+
+    ExitThread(0);
+
+    return 0;
+}
+
+/* EOF */
diff --git a/reactos/base/services/spoolsv/spoolsv.rbuild b/reactos/base/services/spoolsv/spoolsv.rbuild
new file mode 100644 (file)
index 0000000..ef53b83
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
+<module name="spoolsv" type="win32cui" installbase="system32" installname="spoolsv.exe" unicode="yes">
+       <include base="spoolsv">.</include>
+       <define name="WINVER">0x600</define>
+       <define name="_WIN32_IE">0x0500</define>
+       <define name="_WIN32_WINNT">0x0600</define>
+       <library>ntdll</library>
+       <library>kernel32</library>
+       <library>advapi32</library>
+       <file>spoolsv.c</file>
+       <file>spoolsv.rc</file>
+</module>
diff --git a/reactos/base/services/spoolsv/spoolsv.rc b/reactos/base/services/spoolsv/spoolsv.rc
new file mode 100644 (file)
index 0000000..4eeb5b3
--- /dev/null
@@ -0,0 +1,4 @@
+#define REACTOS_STR_FILE_DESCRIPTION   "Spooler-Service\0"
+#define REACTOS_STR_INTERNAL_NAME      "Spoolsv\0"
+#define REACTOS_STR_ORIGINAL_FILENAME  "Spoolsv.exe\0"
+#include <reactos/version.rc>