- Add the first bits of the winspool/spoolsv/spoolss interface in a WIDL-compatible...
authorColin Finck <colin@reactos.org>
Wed, 6 May 2015 12:47:20 +0000 (12:47 +0000)
committerColin Finck <colin@reactos.org>
Wed, 6 May 2015 12:47:20 +0000 (12:47 +0000)
  References:
     - https://git.samba.org/?p=samba.git;a=blob;f=librpc/idl/spoolss.idl;hb=618af83d1bd07b12a9acc88b0d2111cab7a8bb2b
     - https://msdn.microsoft.com/en-us/library/cc244649.aspx
- Replace our stubbed spoolsv by a new basic implementation that already creates a thread to serve RPC requests.
- Add stubbed versions of localmon, localspl, spoolss, winprint, winspool matching the exports of the Windows Server 2003 DLLs.
  localmon and winprint are part of localspl in Windows Server 2003. I took the freedom of putting these distinct components into separate DLLs (as it's done for localmon in NT4 and for winprint in Win7).
- Implement some stubs myself to fix the build (e.g. comdlg32 uses some functions).
- Implement OpenPrinterA and OpenPrinterW in winspool. This is just ANSI-to-Unicode conversion and a RPC call.
- Remove the Wine-imported ntprint, this one also needs a complete rewrite once we're at this point.

svn path=/branches/colins-printing-for-freedom/; revision=67576

41 files changed:
reactos/dll/win32/CMakeLists.txt
reactos/dll/win32/ntprint/CMakeLists.txt [deleted file]
reactos/dll/win32/ntprint/ntprint.c [deleted file]
reactos/dll/win32/ntprint/ntprint.rc [deleted file]
reactos/dll/win32/ntprint/ntprint.spec [deleted file]
reactos/include/reactos/idl/winspool.idl [new file with mode: 0644]
reactos/win32ss/printing/CMakeLists.txt
reactos/win32ss/printing/base/CMakeLists.txt
reactos/win32ss/printing/base/spoolss/CMakeLists.txt [new file with mode: 0644]
reactos/win32ss/printing/base/spoolss/main.c [new file with mode: 0644]
reactos/win32ss/printing/base/spoolss/precomp.h [new file with mode: 0644]
reactos/win32ss/printing/base/spoolss/spoolss.rc [new file with mode: 0644]
reactos/win32ss/printing/base/spoolss/spoolss.spec [new file with mode: 0644]
reactos/win32ss/printing/base/spoolsv/CMakeLists.txt
reactos/win32ss/printing/base/spoolsv/main.c [new file with mode: 0644]
reactos/win32ss/printing/base/spoolsv/precomp.h [new file with mode: 0644]
reactos/win32ss/printing/base/spoolsv/rpcserver.c [new file with mode: 0644]
reactos/win32ss/printing/base/spoolsv/spoolsv.c [deleted file]
reactos/win32ss/printing/base/spoolsv/spoolsv.rc
reactos/win32ss/printing/base/winspool/CMakeLists.txt [new file with mode: 0644]
reactos/win32ss/printing/base/winspool/main.c [new file with mode: 0644]
reactos/win32ss/printing/base/winspool/precomp.h [new file with mode: 0644]
reactos/win32ss/printing/base/winspool/winspool.rc [new file with mode: 0644]
reactos/win32ss/printing/base/winspool/winspool.spec [new file with mode: 0644]
reactos/win32ss/printing/monitors/localmon/CMakeLists.txt
reactos/win32ss/printing/monitors/localmon/localmon.rc [new file with mode: 0644]
reactos/win32ss/printing/monitors/localmon/localmon.spec [new file with mode: 0644]
reactos/win32ss/printing/monitors/localmon/main.c [new file with mode: 0644]
reactos/win32ss/printing/monitors/localmon/precomp.h [new file with mode: 0644]
reactos/win32ss/printing/processors/CMakeLists.txt
reactos/win32ss/printing/processors/winprint/CMakeLists.txt [new file with mode: 0644]
reactos/win32ss/printing/processors/winprint/main.c [new file with mode: 0644]
reactos/win32ss/printing/processors/winprint/precomp.h [new file with mode: 0644]
reactos/win32ss/printing/processors/winprint/winprint.rc [new file with mode: 0644]
reactos/win32ss/printing/processors/winprint/winprint.spec [new file with mode: 0644]
reactos/win32ss/printing/providers/CMakeLists.txt
reactos/win32ss/printing/providers/localspl/CMakeLists.txt [new file with mode: 0644]
reactos/win32ss/printing/providers/localspl/localspl.rc [new file with mode: 0644]
reactos/win32ss/printing/providers/localspl/localspl.spec [new file with mode: 0644]
reactos/win32ss/printing/providers/localspl/main.c [new file with mode: 0644]
reactos/win32ss/printing/providers/localspl/precomp.h [new file with mode: 0644]

index 8912eb0..44f3634 100644 (file)
@@ -135,7 +135,6 @@ add_subdirectory(npptools)
 add_subdirectory(ntdsapi)
 add_subdirectory(ntlanman)
 add_subdirectory(ntmarta)
-add_subdirectory(ntprint)
 add_subdirectory(objsel)
 add_subdirectory(odbc32)
 add_subdirectory(odbccp32)
diff --git a/reactos/dll/win32/ntprint/CMakeLists.txt b/reactos/dll/win32/ntprint/CMakeLists.txt
deleted file mode 100644 (file)
index 2f52596..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-
-include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
-add_definitions(-D__WINESRC__)
-spec2def(ntprint.dll ntprint.spec)
-
-list(APPEND SOURCE
-    ntprint.c
-    ntprint.rc
-    ${CMAKE_CURRENT_BINARY_DIR}/ntprint_stubs.c
-    ${CMAKE_CURRENT_BINARY_DIR}/ntprint.def)
-
-add_library(ntprint SHARED ${SOURCE})
-set_module_type(ntprint win32dll)
-target_link_libraries(ntprint wine)
-add_importlibs(ntprint winspool msvcrt kernel32 ntdll)
-add_cd_file(TARGET ntprint DESTINATION reactos/system32 FOR all)
diff --git a/reactos/dll/win32/ntprint/ntprint.c b/reactos/dll/win32/ntprint/ntprint.c
deleted file mode 100644 (file)
index ec05d98..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Implementation of the Spooler Setup API (Printing)
- *
- * Copyright 2007 Detlef Riekenberg
- *
- * 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
- */
-
-#define WIN32_NO_STATUS
-
-#include <stdarg.h>
-
-#define COBJMACROS
-#define NONAMELESSUNION
-
-#include <windef.h>
-#include <winbase.h>
-//#include "winerror.h"
-#include <wingdi.h>
-//#include "winnls.h"
-//#include "winver.h"
-#include <winspool.h>
-
-//#include "wine/unicode.h"
-#include <wine/debug.h>
-
-WINE_DEFAULT_DEBUG_CHANNEL(ntprint);
-
-typedef struct {
-  LPMONITOR_INFO_2W mi2;    /* Buffer for installed Monitors */
-  DWORD installed;          /* Number of installed Monitors */
-} monitorinfo_t;
-
-/*****************************************************
- *      DllMain
- */
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
-{
-    TRACE("(%p, %d, %p)\n",hinstDLL, fdwReason, lpvReserved);
-
-    switch(fdwReason)
-    {
-        case DLL_WINE_PREATTACH:
-            return FALSE;           /* prefer native version */
-
-        case DLL_PROCESS_ATTACH:
-            DisableThreadLibraryCalls( hinstDLL );
-            break;
-    }
-    return TRUE;
-}
-
-/*****************************************************
- *  PSetupCreateMonitorInfo  [NTPRINT.@]
- *
- *
- */
-
-HANDLE WINAPI PSetupCreateMonitorInfo(LPVOID unknown1, LPVOID  unknown2,LPVOID unknown3)
-{
-    monitorinfo_t * mi=NULL;
-    DWORD needed;
-    DWORD res;
-
-    TRACE("(%p, %p, %p)\n", unknown1, unknown2, unknown3);
-
-    if ((unknown2 != NULL) || (unknown3 != NULL)) {
-        FIXME("got unknown parameter: (%p, %p, %p)\n", unknown1, unknown2, unknown3);
-        return NULL;
-    }
-
-    mi = HeapAlloc(GetProcessHeap(), 0, sizeof(monitorinfo_t));
-    if (!mi) {
-        /* FIXME: SetLastError() needed? */
-        return NULL;
-    }
-
-    /* Get the needed size for all Monitors */
-    res = EnumMonitorsW(NULL, 2, NULL, 0, &needed, &mi->installed);
-    if (!res && (GetLastError() == ERROR_INSUFFICIENT_BUFFER)) {
-        mi->mi2 = HeapAlloc(GetProcessHeap(), 0, needed);
-        res = EnumMonitorsW(NULL, 2, (LPBYTE) mi->mi2, needed, &needed, &mi->installed);
-    }
-
-    if (!res) {
-        HeapFree(GetProcessHeap(), 0, mi);
-        /* FIXME: SetLastError() needed? */
-        return NULL;
-    }
-
-    TRACE("=> %p (%u monitors installed)\n", mi, mi->installed);
-    return mi;
-}
-
-/*****************************************************
- *  PSetupDestroyMonitorInfo  [NTPRINT.@]
- *
- */
-
-VOID WINAPI PSetupDestroyMonitorInfo(HANDLE monitorinfo)
-{
-    monitorinfo_t * mi = monitorinfo;
-
-    TRACE("(%p)\n", mi);
-    if (mi) {
-        if (mi->installed) HeapFree(GetProcessHeap(), 0, mi->mi2);
-        HeapFree(GetProcessHeap(), 0, mi);
-    }
-}
-
-/*****************************************************
- *  PSetupEnumMonitor  [NTPRINT.@]
- *
- * Copy the selected Monitorname to a buffer
- *
- * PARAMS
- *  monitorinfo [I]  HANDLE from PSetupCreateMonitorInfo
- *  index       [I]  Nr. of the Monitorname to copy
- *  buffer      [I]  Target, that receive the Monitorname
- *  psize       [IO] PTR to a DWORD that hold the size of the buffer and receive
- *                   the needed size, when the buffer is too small
- *
- * RETURNS
- *  Success:  TRUE
- *  Failure:  FALSE
- *
- * NOTES
- *   size is in Bytes on w2k and WCHAR on XP
- *
- */
-
-BOOL WINAPI PSetupEnumMonitor(HANDLE monitorinfo, DWORD index, LPWSTR buffer, LPDWORD psize)
-{
-    monitorinfo_t * mi = monitorinfo;
-    LPWSTR  nameW;
-    DWORD   len;
-
-    TRACE("(%p, %u, %p, %p) => %d\n", mi, index, buffer, psize, psize ? *psize : 0);
-
-    if (index < mi->installed) {
-        nameW = mi->mi2[index].pName;
-        len = lstrlenW(nameW) + 1;
-        if (len <= *psize) {
-            memcpy(buffer, nameW, len * sizeof(WCHAR));
-            TRACE("#%u: %s\n", index, debugstr_w(buffer));
-            return TRUE;
-        }
-        *psize = len;
-        SetLastError(ERROR_INSUFFICIENT_BUFFER);
-        return FALSE;
-    }
-    SetLastError(ERROR_NO_MORE_ITEMS);
-    return FALSE;
-}
diff --git a/reactos/dll/win32/ntprint/ntprint.rc b/reactos/dll/win32/ntprint/ntprint.rc
deleted file mode 100644 (file)
index 7cafb61..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Top level resource file for ntprint.dll
- *
- * Copyright 2007 Detlef Riekenberg
- *
- * 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 "winver.h"
-
-#define WINE_FILENAME_STR "ntprint.dll"
-#define WINE_FILEDESCRIPTION_STR "Spooler Setup API (Printing)"
-
-/* Same Version as WinXP_sp2 */
-#define WINE_FILEVERSION      5,1,2600,2180
-#define WINE_FILEVERSION_STR "5.1.2600.2180"
-
-#define WINE_PRODUCTVERSION      5,1,2600,2180
-#define WINE_PRODUCTVERSION_STR "5.1.2600.2180"
-
-#include <wine/wine_common_ver.rc>
diff --git a/reactos/dll/win32/ntprint/ntprint.spec b/reactos/dll/win32/ntprint/ntprint.spec
deleted file mode 100644 (file)
index 8869776..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-@ stub ClassInstall32
-@ stub PSetupAssociateICMProfiles
-@ stub PSetupBuildDriversFromPath
-@ stub PSetupCreateDrvSetupPage
-@ stdcall PSetupCreateMonitorInfo(long ptr ptr)
-@ stub PSetupCreatePrinterDeviceInfoList
-@ stub PSetupDestroyDriverInfo3
-@ stdcall PSetupDestroyMonitorInfo(long)
-@ stub PSetupDestroyPrinterDeviceInfoList
-@ stub PSetupDestroySelectedDriverInfo
-@ stub PSetupDriverInfoFromName
-@ stdcall PSetupEnumMonitor(long long ptr ptr)
-@ stub PSetupFreeDrvField
-@ stub PSetupGetDriverInfForPrinter
-@ stub PSetupGetDriverInfo3
-@ stub PSetupGetLocalDataField
-@ stub PSetupGetPathToSearch
-@ stub PSetupGetSelectedDriverInfo
-@ stub PSetupInstallICMProfiles
-@ stub PSetupInstallMonitor
-@ stub PSetupInstallPrinterDriver
-@ stub PSetupInstallPrinterDriverFromTheWeb
-@ stub PSetupIsCompatibleDriver
-@ stub PSetupIsDriverInstalled
-@ stub PSetupIsMonitorInstalled
-@ stub PSetupIsOemDriver
-@ stub PSetupIsTheDriverFoundInInfInstalled
-@ stub PSetupKillBadUserConnections
-@ stub PSetupPreSelectDriver
-@ stub PSetupProcessPrinterAdded
-@ stub PSetupRefreshDriverList
-@ stub PSetupSelectDeviceButtons
-@ stub PSetupSelectDriver
-@ stub PSetupSetSelectDevTitleAndInstructions
-@ stub PSetupThisPlatform
diff --git a/reactos/include/reactos/idl/winspool.idl b/reactos/include/reactos/idl/winspool.idl
new file mode 100644 (file)
index 0000000..e2b12f1
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * PROJECT:     ReactOS Spooler API
+ * LICENSE:     GNU LGPL v2.1 or any later version as published by the Free Software Foundation
+ * PURPOSE:     WIDL-compatible interface definition for the Spooler API
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#include <ms-dtyp.idl>
+
+typedef [context_handle] void* WINSPOOL_PRINTER_HANDLE;
+typedef [handle, string, unique] WCHAR* WINSPOOL_HANDLE;
+
+typedef struct _DEVMODE_CONTAINER
+{
+    DWORD cbBuf;
+    BYTE* pDevMode;
+}
+WINSPOOL_DEVMODE_CONTAINER;
+
+
+[
+    uuid(12345678-1234-ABCD-EF00-0123456789AB),
+    version(1.0),
+    endpoint("ncacn_np:[\\pipe\\spoolss]"),
+    pointer_default(unique)
+]
+
+interface winspool {
+    /* Function 0 */
+    DWORD _RpcEnumPrinters(
+        [in] DWORD Flags,
+        [in] WINSPOOL_HANDLE Name,
+        [in] DWORD Level,
+        [out] BYTE* pPrinterEnum,
+        [in] DWORD cbBuf,
+        [out] DWORD* pcbNeeded,
+        [out] DWORD* pcReturned
+    );
+
+    /* Function 1 */
+    DWORD _RpcOpenPrinter(
+        [in] WINSPOOL_HANDLE pPrinterName,
+        [out] WINSPOOL_PRINTER_HANDLE* phPrinter,
+        [in, string, unique] WCHAR* pDatatype,
+        [in] WINSPOOL_DEVMODE_CONTAINER* pDevModeContainer,
+        [in] DWORD AccessRequired
+    );
+}
index 7808286..e7a2786 100644 (file)
@@ -1,5 +1,5 @@
 add_subdirectory(base)
 #add_subdirectory(drivers)
 add_subdirectory(monitors)
-#add_subdirectory(processors)
-#add_subdirectory(providers)
+add_subdirectory(processors)
+add_subdirectory(providers)
index 2956040..25ae882 100644 (file)
@@ -1,4 +1,4 @@
 #add_subdirectory(printui)
-#add_subdirectory(spoolss)
+add_subdirectory(spoolss)
 add_subdirectory(spoolsv)
-#add_subdirectory(winspool)
+add_subdirectory(winspool)
diff --git a/reactos/win32ss/printing/base/spoolss/CMakeLists.txt b/reactos/win32ss/printing/base/spoolss/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e0f50d9
--- /dev/null
@@ -0,0 +1,18 @@
+
+spec2def(spoolss spoolss.spec ADD_IMPORTLIB)
+
+list(APPEND SOURCE
+    main.c
+    precomp.h)
+
+add_library(spoolss SHARED
+    ${SOURCE}
+    spoolss.rc
+    ${CMAKE_CURRENT_BINARY_DIR}/spoolss_stubs.c
+    ${CMAKE_CURRENT_BINARY_DIR}/spoolss.def)
+
+set_module_type(spoolss win32dll UNICODE)
+target_link_libraries(spoolss wine)
+add_importlibs(spoolss kernel32 msvcrt ntdll)
+add_pch(spoolss precomp.h SOURCE)
+add_cd_file(TARGET spoolss DESTINATION reactos/system32 FOR all)
diff --git a/reactos/win32ss/printing/base/spoolss/main.c b/reactos/win32ss/printing/base/spoolss/main.c
new file mode 100644 (file)
index 0000000..4ed1cf4
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * PROJECT:     ReactOS Spooler Router
+ * LICENSE:     GNU LGPL v2.1 or any later version as published by the Free Software Foundation
+ * PURPOSE:     Main functions
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#include "precomp.h"
+
+BOOL WINAPI
+ClosePrinter(HANDLE hPrinter)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+EndDocPrinter(HANDLE hPrinter)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+EndPagePrinter(HANDLE hPrinter)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+EnumPrintersW(DWORD Flags, LPWSTR Name, DWORD Level, LPBYTE pPrinterEnum, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+GetPrinterDriverW(HANDLE hPrinter, LPWSTR pEnvironment, DWORD Level, LPBYTE pDriverInfo, DWORD cbBuf, LPDWORD pcbNeeded)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+GetPrinterW(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter, DWORD cbBuf, LPDWORD pcbNeeded)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+GetPrintProcessorDirectoryW(LPWSTR pName, LPWSTR pEnvironment, DWORD Level, LPBYTE pPrintProcessorInfo, DWORD cbBuf, LPDWORD pcbNeeded)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+InitializeRouter(HANDLE SpoolerStatusHandle)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+OpenPrinterW(LPWSTR pPrinterName, LPHANDLE phPrinter, LPPRINTER_DEFAULTSW pDefault)
+{
+    return FALSE;
+}
+
+DWORD WINAPI
+StartDocPrinterW(HANDLE hPrinter, DWORD Level, LPBYTE pDocInfo)
+{
+    return 0;
+}
+
+BOOL WINAPI
+StartPagePrinter(HANDLE hPrinter)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+WritePrinter(HANDLE hPrinter, LPVOID pBuf, DWORD cbBuf, LPDWORD pcWritten)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+XcvDataW(HANDLE hXcv, PCWSTR pszDataName, PBYTE pInputData, DWORD cbInputData, PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded, PDWORD pdwStatus)
+{
+    return FALSE;
+}
diff --git a/reactos/win32ss/printing/base/spoolss/precomp.h b/reactos/win32ss/printing/base/spoolss/precomp.h
new file mode 100644 (file)
index 0000000..fa44233
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * PROJECT:     ReactOS Spooler Router
+ * LICENSE:     GNU LGPL v2.1 or any later version as published by the Free Software Foundation
+ * PURPOSE:     Precompiled Header for all source files
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#ifndef _PRECOMP_H
+#define _PRECOMP_H
+
+#define WIN32_NO_STATUS
+#include <windef.h>
+#include <winbase.h>
+#include <wingdi.h>
+#include <winspool.h>
+
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(spoolss);
+
+#endif
diff --git a/reactos/win32ss/printing/base/spoolss/spoolss.rc b/reactos/win32ss/printing/base/spoolss/spoolss.rc
new file mode 100644 (file)
index 0000000..f14cd12
--- /dev/null
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION  "ReactOS Spooler Router"
+#define REACTOS_STR_INTERNAL_NAME     "spoolss"
+#define REACTOS_STR_ORIGINAL_FILENAME "spoolss.dll"
+#include <reactos/version.rc>
diff --git a/reactos/win32ss/printing/base/spoolss/spoolss.spec b/reactos/win32ss/printing/base/spoolss/spoolss.spec
new file mode 100644 (file)
index 0000000..7e10f88
--- /dev/null
@@ -0,0 +1,178 @@
+@ stub AbortPrinter
+@ stub AddDriverCatalog
+@ stub AddFormW
+@ stub AddJobW
+@ stub AddMonitorW
+@ stub AddPerMachineConnectionW
+@ stub AddPortExW
+@ stub AddPortW
+@ stub AddPrinterConnectionW
+@ stub AddPrinterDriverExW
+@ stub AddPrinterDriverW
+@ stub AddPrinterExW
+@ stub AddPrinterW
+@ stub AddPrintProcessorW
+@ stub AddPrintProvidorW
+@ stub AdjustPointers
+@ stub AdjustPointersInStructuresArray
+@ stub AlignKMPtr
+@ stub AlignRpcPtr
+@ stub AllocSplStr
+@ stub AllowRemoteCalls
+@ stub AppendPrinterNotifyInfoData
+@ stub bGetDevModePerUser
+@ stub bSetDevModePerUser
+@ stub BuildOtherNamesFromMachineName
+@ stub CacheAddName
+@ stub CacheCreateAndAddNode
+@ stub CacheCreateAndAddNodeWithIPAddresses
+@ stub CacheDeleteNode
+@ stub CacheIsNameCluster
+@ stub CacheIsNameInNodeList
+@ stub CallDrvDevModeConversion
+@ stub CallRouterFindFirstPrinterChangeNotification
+@ stub CheckLocalCall
+@ stdcall ClosePrinter(long)
+@ stub ClusterSplClose
+@ stub ClusterSplIsAlive
+@ stub ClusterSplOpen
+@ stub ConfigurePortW
+@ stub CreatePrinterIC
+@ stub DbgGetPointers
+@ stub DeleteFormW
+@ stub DeleteMonitorW
+@ stub DeletePerMachineConnectionW
+@ stub DeletePortW
+@ stub DeletePrinter
+@ stub DeletePrinterConnectionW
+@ stub DeletePrinterDataExW
+@ stub DeletePrinterDataW
+@ stub DeletePrinterDriverExW
+@ stub DeletePrinterDriverW
+@ stub DeletePrinterIC
+@ stub DeletePrinterKeyW
+@ stub DeletePrintProcessorW
+@ stub DeletePrintProvidorW
+@ stub DllAllocSplMem
+@ stub DllFreeSplMem
+@ stub DllFreeSplStr
+@ stdcall EndDocPrinter(long)
+@ stdcall EndPagePrinter(long)
+@ stub EnumFormsW
+@ stub EnumJobsW
+@ stub EnumMonitorsW
+@ stub EnumPerMachineConnectionsW
+@ stub EnumPortsW
+@ stub EnumPrinterDataExW
+@ stub EnumPrinterDataW
+@ stub EnumPrinterDriversW
+@ stub EnumPrinterKeyW
+@ stdcall EnumPrintersW(long ptr long ptr long ptr ptr)
+@ stub EnumPrintProcessorDatatypesW
+@ stub EnumPrintProcessorsW
+@ stub FindClosePrinterChangeNotification
+@ stub FlushPrinter
+@ stub FormatPrinterForRegistryKey
+@ stub FormatRegistryKeyForPrinter
+@ stub FreeOtherNames
+@ stub GetClientUserHandle
+@ stub GetFormW
+@ stub GetJobAttributes
+@ stub GetJobW
+@ stub GetNetworkId
+@ stub GetPrinterDataExW
+@ stub GetPrinterDataW
+@ stub GetPrinterDriverDirectoryW
+@ stub GetPrinterDriverExW
+@ stdcall GetPrinterDriverW(long wstr long ptr long ptr)
+@ stdcall GetPrinterW(long long ptr long ptr)
+@ stdcall GetPrintProcessorDirectoryW(wstr wstr long ptr long ptr)
+@ stub GetServerPolicy
+@ stub GetShrinkedSize
+@ stub ImpersonatePrinterClient
+@ stdcall InitializeRouter(long)
+@ stub IsNamedPipeRpcCall
+@ stub LoadDriver
+@ stub LoadDriverFiletoConvertDevmode
+@ stub LoadDriverWithVersion
+@ stub LogWmiTraceEvent
+@ stub MarshallDownStructure
+@ stub MarshallDownStructuresArray
+@ stub MarshallUpStructure
+@ stub MarshallUpStructuresArray
+@ stub MIDL_user_allocate1
+@ stub MIDL_user_free1
+@ stub OldGetPrinterDriverW
+@ stub OpenPrinterExW
+@ stub OpenPrinterPortW
+@ stdcall OpenPrinterW(wstr ptr ptr)
+@ stub PackStrings
+@ stub PartialReplyPrinterChangeNotification
+@ stub PlayGdiScriptOnPrinterIC
+@ stub PrinterHandleRundown
+@ stub PrinterMessageBoxW
+@ stub ProvidorFindClosePrinterChangeNotification
+@ stub ProvidorFindFirstPrinterChangeNotification
+@ stub pszDbgAllocMsgA
+@ stub ReadPrinter
+@ stub ReallocSplMem
+@ stub ReallocSplStr
+@ stub RemoteFindFirstPrinterChangeNotification
+@ stub ReplyClosePrinter
+@ stub ReplyOpenPrinter
+@ stub ReplyPrinterChangeNotification
+@ stub ResetPrinterW
+@ stub RevertToPrinterSelf
+@ stub RouterAllocBidiMem
+@ stub RouterAllocBidiResponseContainer
+@ stub RouterAllocPrinterNotifyInfo
+@ stub RouterFindFirstPrinterChangeNotification
+@ stub RouterFindNextPrinterChangeNotification
+@ stub RouterFreeBidiMem
+@ stub RouterFreePrinterNotifyInfo
+@ stub RouterRefreshPrinterChangeNotification
+@ stub RouterReplyPrinter
+@ stub ScheduleJob
+@ stub SeekPrinter
+@ stub SendRecvBidiData
+@ stub SetAllocFailCount
+@ stub SetFormW
+@ stub SetJobW
+@ stub SetPortW
+@ stub SetPrinterDataExW
+@ stub SetPrinterDataW
+@ stub SetPrinterW
+@ stub SplCloseSpoolFileHandle
+@ stub SplCommitSpoolData
+@ stub SplDriverUnloadComplete
+@ stub SplGetSpoolFileInfo
+@ stub SplInitializeWinSpoolDrv
+@ stub SplIsSessionZero
+@ stub SplIsUpgrade
+@ stub SplPowerEvent
+@ stub SplProcessPnPEvent
+@ stub SplPromptUIInUsersSession
+@ stub SplReadPrinter
+@ stub SplRegisterForDeviceEvents
+@ stub SplShutDownRouter
+@ stub SplUnregisterForDeviceEvents
+@ stub SpoolerFindClosePrinterChangeNotification
+@ stub SpoolerFindFirstPrinterChangeNotification
+@ stub SpoolerFindNextPrinterChangeNotification
+@ stub SpoolerFreePrinterNotifyInfo
+@ stub SpoolerHasInitialized
+@ stub SpoolerInit
+@ stdcall StartDocPrinterW(long long ptr)
+@ stdcall StartPagePrinter(long)
+@ stub UndoAlignKMPtr
+@ stub UndoAlignRpcPtr
+@ stub UnloadDriver
+@ stub UnloadDriverFile
+@ stub UpdateBufferSize
+@ stub UpdatePrinterRegAll
+@ stub UpdatePrinterRegUser
+@ stub vDbgLogError
+@ stub WaitForPrinterChange
+@ stub WaitForSpoolerInitialization
+@ stdcall WritePrinter(long ptr long ptr)
+@ stdcall XcvDataW(long wstr ptr long ptr long ptr ptr)
index 1d4686c..1eb98e7 100644 (file)
@@ -1,6 +1,16 @@
 
-add_executable(spoolsv spoolsv.c spoolsv.rc)
-target_link_libraries(spoolsv wine)
+include_directories(${REACTOS_SOURCE_DIR}/include/reactos/idl)
+add_rpc_files(server ${REACTOS_SOURCE_DIR}/include/reactos/idl/winspool.idl)
+
+list(APPEND SOURCE
+    main.c
+    rpcserver.c
+    precomp.h
+    ${CMAKE_CURRENT_BINARY_DIR}/winspool_s.c)
+
+add_executable(spoolsv ${SOURCE} spoolsv.rc)
 set_module_type(spoolsv win32cui UNICODE)
-add_importlibs(spoolsv advapi32 msvcrt kernel32 ntdll)
+target_link_libraries(spoolsv wine)
+add_importlibs(spoolsv advapi32 kernel32 msvcrt ntdll rpcrt4)
+add_pch(spoolsv precomp.h SOURCE)
 add_cd_file(TARGET spoolsv DESTINATION reactos/system32 FOR all)
diff --git a/reactos/win32ss/printing/base/spoolsv/main.c b/reactos/win32ss/printing/base/spoolsv/main.c
new file mode 100644 (file)
index 0000000..1b00de0
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * PROJECT:     ReactOS Print Spooler Service
+ * LICENSE:     GNU GPLv2 or any later version as published by the Free Software Foundation
+ * PURPOSE:     Main functions
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#include "precomp.h"
+
+SERVICE_STATUS_HANDLE hServiceStatus;
+SERVICE_STATUS ServiceStatus;
+WCHAR wszServiceName[] = L"Spooler";
+
+static void
+_UpdateServiceStatus(DWORD dwNewStatus, DWORD dwCheckPoint)
+{
+    ServiceStatus.dwCheckPoint = dwCheckPoint;
+    ServiceStatus.dwCurrentState = dwNewStatus;
+    SetServiceStatus(hServiceStatus, &ServiceStatus);
+}
+
+static DWORD WINAPI
+_ServiceControlHandlerEx(DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext)
+{
+    switch (dwControl)
+    {
+        case SERVICE_CONTROL_SHUTDOWN:
+        case SERVICE_CONTROL_STOP:
+            _UpdateServiceStatus(SERVICE_STOP_PENDING, 1);
+            RpcMgmtStopServerListening(NULL);
+            _UpdateServiceStatus(SERVICE_STOPPED, 0);
+            return NO_ERROR;
+
+        case SERVICE_CONTROL_INTERROGATE:
+            return NO_ERROR;
+
+        default:
+            return ERROR_CALL_NOT_IMPLEMENTED;
+    }
+}
+
+static VOID WINAPI
+_ServiceMain(DWORD dwArgc, LPWSTR* lpszArgv)
+{
+    HANDLE hThread;
+
+    UNREFERENCED_PARAMETER(dwArgc);
+    UNREFERENCED_PARAMETER(lpszArgv);
+
+    // Register our service for control
+    hServiceStatus = RegisterServiceCtrlHandlerExW(wszServiceName, _ServiceControlHandlerEx, NULL);
+
+    // Report initial SERVICE_START_PENDING status
+    ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
+    ServiceStatus.dwServiceSpecificExitCode = 0;
+    ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
+    ServiceStatus.dwWaitHint = 4000;
+    ServiceStatus.dwWin32ExitCode = NO_ERROR;
+    _UpdateServiceStatus(SERVICE_START_PENDING, 0);
+
+    // Create a thread for serving RPC requests
+    hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)RpcThreadProc, NULL, 0, NULL);
+
+    if (hThread)
+    {
+        // We don't need the thread handle. Keeping it open blocks the thread from terminating.
+        CloseHandle(hThread);
+        _UpdateServiceStatus(SERVICE_RUNNING, 0);
+    }
+    else
+    {
+        ERR("CreateThread failed with error %u!\n", GetLastError());
+        _UpdateServiceStatus(SERVICE_STOPPED, 0);
+    }
+}
+
+int
+wmain(int argc, WCHAR* argv[])
+{
+    SERVICE_TABLE_ENTRYW ServiceTable[] =
+    {
+        {wszServiceName, _ServiceMain},
+        {NULL, NULL}
+    };
+
+    UNREFERENCED_PARAMETER(argc);
+    UNREFERENCED_PARAMETER(argv);
+
+    StartServiceCtrlDispatcherW(ServiceTable);
+
+    return 0;
+}
diff --git a/reactos/win32ss/printing/base/spoolsv/precomp.h b/reactos/win32ss/printing/base/spoolsv/precomp.h
new file mode 100644 (file)
index 0000000..f7b5b64
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * PROJECT:     ReactOS Print Spooler Service
+ * LICENSE:     GNU GPLv2 or any later version as published by the Free Software Foundation
+ * PURPOSE:     Precompiled Header for all source files
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#ifndef _PRECOMP_H
+#define _PRECOMP_H
+
+#define WIN32_NO_STATUS
+#include <windef.h>
+#include <winsvc.h>
+#include <winspool_s.h>
+
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(spoolsv);
+
+// rpcserver.c
+extern DWORD WINAPI RpcThreadProc(LPVOID lpParameter);
+
+#endif
diff --git a/reactos/win32ss/printing/base/spoolsv/rpcserver.c b/reactos/win32ss/printing/base/spoolsv/rpcserver.c
new file mode 100644 (file)
index 0000000..fad5100
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * PROJECT:     ReactOS Print Spooler Service
+ * LICENSE:     GNU GPLv2 or any later version as published by the Free Software Foundation
+ * PURPOSE:     RPC Server Thread
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#include "precomp.h"
+
+DWORD WINAPI
+RpcThreadProc(LPVOID lpParameter)
+{
+    RPC_STATUS Status;
+
+    Status = RpcServerUseProtseqEpW(L"ncacn_np", 20, L"\\pipe\\spoolss", NULL);
+    if (Status != RPC_S_OK)
+    {
+        ERR("RpcServerUseProtseqEpW failed with status %u!\n", Status);
+        return 0;
+    }
+
+    Status = RpcServerRegisterIf(winspool_v1_0_s_ifspec, NULL, NULL);
+    if (Status != RPC_S_OK)
+    {
+        ERR("RpcServerRegisterIf failed with status %u!\n", Status);
+        return 0;
+    }
+
+    Status = RpcServerListen(1, RPC_C_LISTEN_MAX_CALLS_DEFAULT, 0);
+    if (Status != RPC_S_OK)
+    {
+        ERR("RpcServerListen() failed with status %u!\n", Status);
+    }
+
+    return 0;
+}
+
+DWORD
+_RpcEnumPrinters(DWORD Flags, WINSPOOL_HANDLE Name, DWORD Level, BYTE* pPrinterEnum, DWORD cbBuf, DWORD* pcbNeeded, DWORD* pcReturned)
+{
+    return 0;
+}
+
+DWORD
+_RpcOpenPrinter(WINSPOOL_HANDLE pPrinterName, WINSPOOL_PRINTER_HANDLE* phPrinter, WCHAR* pDatatype, WINSPOOL_DEVMODE_CONTAINER* pDevModeContainer, DWORD AccessRequired)
+{
+    return 0;
+}
+
+void __RPC_FAR* __RPC_USER
+midl_user_allocate(SIZE_T len)
+{
+    return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
+}
+
+void __RPC_USER
+midl_user_free(void __RPC_FAR* ptr)
+{
+    HeapFree(GetProcessHeap(), 0, ptr);
+}
+
+void __RPC_USER
+WINSPOOL_PRINTER_HANDLE_rundown(WINSPOOL_PRINTER_HANDLE hPrinter)
+{
+}
diff --git a/reactos/win32ss/printing/base/spoolsv/spoolsv.c b/reactos/win32ss/printing/base/spoolsv/spoolsv.c
deleted file mode 100644 (file)
index 651a3d8..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * COPYRIGHT:        See COPYING in the top level directory
- * PROJECT:          ReactOS kernel
- * FILE:             services/spoolsv/spoolsv.c
- * PURPOSE:          Printer spooler
- * PROGRAMMER:       Eric Kohl
- */
-
-/* INCLUDES *****************************************************************/
-
-#include <windef.h>
-#include <winsvc.h>
-#include <wine/debug.h>
-
-WINE_DEFAULT_DEBUG_CHANNEL(spoolsv);
-
-
-/* GLOBALS ******************************************************************/
-
-static VOID CALLBACK ServiceMain(DWORD argc, LPWSTR *argv);
-static WCHAR ServiceName[] = L"Spooler";
-static SERVICE_TABLE_ENTRYW ServiceTable[] =
-{
-    {ServiceName, ServiceMain},
-    {NULL, NULL}
-};
-
-SERVICE_STATUS_HANDLE ServiceStatusHandle;
-SERVICE_STATUS ServiceStatus;
-
-
-/* FUNCTIONS *****************************************************************/
-
-static VOID
-UpdateServiceStatus(DWORD dwState)
-{
-    ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
-    ServiceStatus.dwCurrentState = dwState;
-
-    if (dwState == SERVICE_RUNNING)
-        ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
-    else
-        ServiceStatus.dwControlsAccepted = 0;
-
-    ServiceStatus.dwWin32ExitCode = 0;
-    ServiceStatus.dwServiceSpecificExitCode = 0;
-    ServiceStatus.dwCheckPoint = 0;
-
-    if (dwState == SERVICE_START_PENDING ||
-        dwState == SERVICE_STOP_PENDING)
-        ServiceStatus.dwWaitHint = 10000;
-    else
-        ServiceStatus.dwWaitHint = 0;
-
-    SetServiceStatus(ServiceStatusHandle,
-                     &ServiceStatus);
-}
-
-
-static DWORD WINAPI
-ServiceControlHandler(DWORD dwControl,
-                      DWORD dwEventType,
-                      LPVOID lpEventData,
-                      LPVOID lpContext)
-{
-    TRACE("ServiceControlHandler() called\n");
-
-    switch (dwControl)
-    {
-        case SERVICE_CONTROL_STOP:
-            TRACE("  SERVICE_CONTROL_STOP received\n");
-            UpdateServiceStatus(SERVICE_STOPPED);
-            return ERROR_SUCCESS;
-
-        case SERVICE_CONTROL_INTERROGATE:
-            TRACE("  SERVICE_CONTROL_INTERROGATE received\n");
-            SetServiceStatus(ServiceStatusHandle,
-                             &ServiceStatus);
-            return ERROR_SUCCESS;
-
-        case SERVICE_CONTROL_SHUTDOWN:
-            TRACE("  SERVICE_CONTROL_SHUTDOWN received\n");
-            UpdateServiceStatus(SERVICE_STOPPED);
-            return ERROR_SUCCESS;
-
-        default :
-            TRACE("  Control %lu received\n");
-            return ERROR_CALL_NOT_IMPLEMENTED;
-    }
-}
-
-
-static VOID CALLBACK
-ServiceMain(DWORD argc, LPWSTR *argv)
-{
-    UNREFERENCED_PARAMETER(argc);
-    UNREFERENCED_PARAMETER(argv);
-
-    TRACE("ServiceMain() called\n");
-
-    ServiceStatusHandle = RegisterServiceCtrlHandlerExW(ServiceName,
-                                                        ServiceControlHandler,
-                                                        NULL);
-
-    TRACE("Calling SetServiceStatus()\n");
-    UpdateServiceStatus(SERVICE_RUNNING);
-    TRACE("SetServiceStatus() called\n");
-
-
-    TRACE("ServiceMain() done\n");
-}
-
-
-int
-wmain(int argc, WCHAR *argv[])
-{
-    UNREFERENCED_PARAMETER(argc);
-    UNREFERENCED_PARAMETER(argv);
-
-    TRACE("Spoolsv: main() started\n");
-
-    StartServiceCtrlDispatcher(ServiceTable);
-
-    TRACE("Spoolsv: main() done\n");
-
-    return 0;
-}
-
-/* EOF */
index 2d35466..714f4da 100644 (file)
@@ -1,4 +1,4 @@
-#define REACTOS_STR_FILE_DESCRIPTION  "Spooler-Service"
-#define REACTOS_STR_INTERNAL_NAME     "Spoolsv"
-#define REACTOS_STR_ORIGINAL_FILENAME "Spoolsv.exe"
+#define REACTOS_STR_FILE_DESCRIPTION  "ReactOS Print Spooler Service"
+#define REACTOS_STR_INTERNAL_NAME     "spoolsv"
+#define REACTOS_STR_ORIGINAL_FILENAME "spoolsv.exe"
 #include <reactos/version.rc>
diff --git a/reactos/win32ss/printing/base/winspool/CMakeLists.txt b/reactos/win32ss/printing/base/winspool/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f3ab3da
--- /dev/null
@@ -0,0 +1,22 @@
+
+include_directories(${REACTOS_SOURCE_DIR}/include/reactos/idl)
+add_rpc_files(client ${REACTOS_SOURCE_DIR}/include/reactos/idl/winspool.idl)
+spec2def(winspool winspool.spec ADD_IMPORTLIB)
+
+list(APPEND SOURCE
+    main.c
+    precomp.h
+    ${CMAKE_CURRENT_BINARY_DIR}/winspool_c.c)
+
+add_library(winspool SHARED
+    ${SOURCE}
+    winspool.rc
+    ${CMAKE_CURRENT_BINARY_DIR}/winspool_stubs.c
+    ${CMAKE_CURRENT_BINARY_DIR}/winspool.def)
+
+set_target_properties(winspool PROPERTIES SUFFIX ".drv")
+set_module_type(winspool win32dll UNICODE)
+target_link_libraries(winspool wine)
+add_importlibs(winspool kernel32 msvcrt ntdll rpcrt4)
+add_pch(winspool precomp.h SOURCE)
+add_cd_file(TARGET winspool DESTINATION reactos/system32 FOR all)
diff --git a/reactos/win32ss/printing/base/winspool/main.c b/reactos/win32ss/printing/base/winspool/main.c
new file mode 100644 (file)
index 0000000..d2e5bd4
--- /dev/null
@@ -0,0 +1,297 @@
+/*
+ * PROJECT:     ReactOS Spooler API
+ * LICENSE:     GNU LGPL v2.1 or any later version as published by the Free Software Foundation
+ * PURPOSE:     Main functions
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#include "precomp.h"
+
+handle_t __RPC_USER
+WINSPOOL_HANDLE_bind(WINSPOOL_HANDLE wszName)
+{
+    handle_t hBinding;
+    PWSTR wszStringBinding;
+    RPC_STATUS Status;
+
+    // Get us a string binding handle from the supplied connection information
+    Status = RpcStringBindingComposeW(NULL, L"ncacn_np", wszStringBinding, L"\\pipe\\spoolss", NULL, &wszStringBinding);
+    if (Status != RPC_S_OK)
+    {
+        ERR("RpcStringBindingComposeW failed with status %u!\n", Status);
+        return NULL;
+    }
+
+    // Get a handle_t binding handle from the string binding handle
+    Status = RpcBindingFromStringBindingW(wszStringBinding, &hBinding);
+    if (Status != RPC_S_OK)
+    {
+        ERR("RpcBindingFromStringBindingW failed with status %u!\n", Status);
+        return NULL;
+    }
+
+    // Free the string binding handle
+    Status = RpcStringFreeW(&wszStringBinding);
+    if (Status != RPC_S_OK)
+    {
+        ERR("RpcStringFreeW failed with status %u!\n", Status);
+        return NULL;
+    }
+
+    return hBinding;
+}
+
+void __RPC_USER
+WINSPOOL_HANDLE_unbind(WINSPOOL_HANDLE wszName, handle_t hBinding)
+{
+    RPC_STATUS Status;
+
+    Status = RpcBindingFree(&hBinding);
+    if (Status != RPC_S_OK)
+    {
+        ERR("RpcBindingFree failed with status %u!\n", Status);
+    }
+}
+
+void __RPC_FAR* __RPC_USER
+midl_user_allocate(SIZE_T len)
+{
+    return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
+}
+
+void __RPC_USER
+midl_user_free(void __RPC_FAR* ptr)
+{
+    HeapFree(GetProcessHeap(), 0, ptr);
+}
+
+BOOL WINAPI
+ClosePrinter(HANDLE hPrinter)
+{
+    return FALSE;
+}
+
+DWORD WINAPI
+DeviceCapabilitiesA(LPCSTR pDevice, LPCSTR pPort, WORD fwCapability, LPSTR pOutput, const DEVMODEA* pDevMode)
+{
+    return 0;
+}
+
+DWORD WINAPI
+DeviceCapabilitiesW(LPCWSTR pDevice, LPCWSTR pPort, WORD fwCapability, LPWSTR pOutput, const DEVMODEW* pDevMode)
+{
+    return 0;
+}
+
+LONG WINAPI
+DocumentPropertiesA(HWND hWnd, HANDLE hPrinter, LPSTR pDeviceName, PDEVMODEA pDevModeOutput, PDEVMODEA pDevModeInput, DWORD fMode)
+{
+    return 0;
+}
+
+LONG WINAPI
+DocumentPropertiesW(HWND hWnd, HANDLE hPrinter, LPWSTR pDeviceName, PDEVMODEW pDevModeOutput, PDEVMODEW pDevModeInput, DWORD fMode)
+{
+    return 0;
+}
+
+BOOL WINAPI
+EndDocPrinter(HANDLE hPrinter)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+EndPagePrinter(HANDLE hPrinter)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+EnumPrintersA(DWORD Flags, LPSTR Name, DWORD Level, LPBYTE pPrinterEnum, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+EnumPrintersW(DWORD Flags, LPWSTR Name, DWORD Level, LPBYTE pPrinterEnum, DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+GetDefaultPrinterA(LPSTR pszBuffer, LPDWORD pcchBuffer)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+GetDefaultPrinterW(LPWSTR pszBuffer, LPDWORD pcchBuffer)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+GetPrinterA(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter, DWORD cbBuf, LPDWORD pcbNeeded)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+GetPrinterDriverA(HANDLE hPrinter, LPSTR pEnvironment, DWORD Level, LPBYTE pDriverInfo, DWORD cbBuf, LPDWORD pcbNeeded)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+GetPrinterDriverW(HANDLE hPrinter, LPWSTR pEnvironment, DWORD Level, LPBYTE pDriverInfo, DWORD cbBuf, LPDWORD pcbNeeded)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+GetPrinterW(HANDLE hPrinter, DWORD Level, LPBYTE pPrinter, DWORD cbBuf, LPDWORD pcbNeeded)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+GetPrintProcessorDirectoryW(LPWSTR pName, LPWSTR pEnvironment, DWORD Level, LPBYTE pPrintProcessorInfo, DWORD cbBuf, LPDWORD pcbNeeded)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+OpenPrinterA(LPSTR pPrinterName, LPHANDLE phPrinter, LPPRINTER_DEFAULTSA pDefault)
+{
+    BOOL ReturnValue = FALSE;
+    DEVMODEW wDevMode;
+    PWSTR pwszPrinterName = NULL;
+    PWSTR pwszDatatype = NULL;
+    PRINTER_DEFAULTSW wDefault = { 0 };
+    size_t StringLength;
+
+    if (pPrinterName)
+    {
+        // Convert pPrinterName to a Unicode string pwszPrinterName
+        StringLength = strlen(pPrinterName) + 1;
+
+        pwszPrinterName = HeapAlloc(GetProcessHeap(), 0, StringLength * sizeof(WCHAR));
+        if (!pwszPrinterName)
+        {
+            ERR("HeapAlloc failed for pwszPrinterName with last error %u!\n", GetLastError());
+            goto Cleanup;
+        }
+
+        MultiByteToWideChar(CP_ACP, 0, pPrinterName, -1, pwszPrinterName, StringLength);
+    }
+
+    if (pDefault)
+    {
+        wDefault.DesiredAccess = pDefault->DesiredAccess;
+
+        if (pDefault->pDatatype)
+        {
+            // Convert pDefault->pDatatype to a Unicode string pwszDatatype that later becomes wDefault.pDatatype
+            StringLength = strlen(pDefault->pDatatype) + 1;
+
+            pwszDatatype = HeapAlloc(GetProcessHeap(), 0, StringLength * sizeof(WCHAR));
+            if (!pwszDatatype)
+            {
+                ERR("HeapAlloc failed for pwszDatatype with last error %u!\n", GetLastError());
+                goto Cleanup;
+            }
+
+            MultiByteToWideChar(CP_ACP, 0, pDefault->pDatatype, -1, pwszDatatype, StringLength);
+            wDefault.pDatatype = pwszDatatype;
+        }
+
+        if (pDefault->pDevMode)
+        {
+            // Fixed size strings, so no additional memory needs to be allocated
+            MultiByteToWideChar(CP_ACP, 0, pDefault->pDevMode->dmDeviceName, -1, wDevMode.dmDeviceName, sizeof(wDevMode.dmDeviceName) / sizeof(WCHAR));
+            MultiByteToWideChar(CP_ACP, 0, pDefault->pDevMode->dmFormName, -1, wDevMode.dmFormName, sizeof(wDevMode.dmFormName) / sizeof(WCHAR));
+
+            // Use CopyMemory to copy over several structure values in one step
+            CopyMemory(&wDevMode.dmSpecVersion, &pDefault->pDevMode->dmSpecVersion, (ULONG_PTR)&wDevMode.dmCollate - (ULONG_PTR)&wDevMode.dmSpecVersion);
+            CopyMemory(&wDevMode.dmLogPixels, &pDefault->pDevMode->dmLogPixels, (ULONG_PTR)&wDevMode.dmPanningHeight - (ULONG_PTR)&wDevMode.dmLogPixels);
+
+            wDefault.pDevMode = &wDevMode;
+        }
+    }
+
+    ReturnValue = OpenPrinterW(pwszPrinterName, phPrinter, &wDefault);
+
+Cleanup:
+    if (pwszPrinterName)
+        HeapFree(GetProcessHeap(), 0, pwszPrinterName);
+
+    if (pwszDatatype)
+        HeapFree(GetProcessHeap(), 0, pwszDatatype);
+
+    return ReturnValue;
+}
+
+BOOL WINAPI
+OpenPrinterW(LPWSTR pPrinterName, LPHANDLE phPrinter, LPPRINTER_DEFAULTSW pDefault)
+{
+    BOOL ReturnValue = FALSE;
+    DWORD ErrorCode;
+    PWSTR pDatatype = NULL;
+    WINSPOOL_DEVMODE_CONTAINER DevModeContainer;
+    WINSPOOL_DEVMODE_CONTAINER* pDevModeContainer = NULL;
+    ACCESS_MASK AccessRequired = 0;
+
+    // Prepare the additional parameters in the format required by _RpcOpenPrinter
+    if (pDefault)
+    {
+        pDatatype = pDefault->pDatatype;
+        DevModeContainer.cbBuf = sizeof(DEVMODEW);
+        DevModeContainer.pDevMode = (BYTE*)pDefault->pDevMode;
+        pDevModeContainer = &DevModeContainer;
+        AccessRequired = pDefault->DesiredAccess;
+    }
+
+    // Do the RPC call
+    RpcTryExcept
+    {
+        ErrorCode = _RpcOpenPrinter(pPrinterName, phPrinter, pDatatype, pDevModeContainer, AccessRequired);
+        if (ErrorCode)
+        {
+            ERR("_RpcOpenPrinter failed with error %u!\n", ErrorCode);
+        }
+
+        ReturnValue = (ErrorCode == ERROR_SUCCESS);
+    }
+    RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+    {
+        ERR("_RpcOpenPrinter failed with exception code %u!\n", RpcExceptionCode());
+    }
+    RpcEndExcept;
+
+    return ReturnValue;
+}
+
+DWORD WINAPI
+StartDocPrinterW(HANDLE hPrinter, DWORD Level, LPBYTE pDocInfo)
+{
+    return 0;
+}
+
+BOOL WINAPI
+StartPagePrinter(HANDLE hPrinter)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+WritePrinter(HANDLE hPrinter, LPVOID pBuf, DWORD cbBuf, LPDWORD pcWritten)
+{
+    return FALSE;
+}
+
+BOOL WINAPI
+XcvDataW(HANDLE hXcv, PCWSTR pszDataName, PBYTE pInputData, DWORD cbInputData, PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded, PDWORD pdwStatus)
+{
+    return FALSE;
+}
diff --git a/reactos/win32ss/printing/base/winspool/precomp.h b/reactos/win32ss/printing/base/winspool/precomp.h
new file mode 100644 (file)
index 0000000..5455c62
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * PROJECT:     ReactOS Print Spooler API
+ * LICENSE:     GNU LGPL v2.1 or any later version as published by the Free Software Foundation
+ * PURPOSE:     Precompiled Header for all source files
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#ifndef _PRECOMP_H
+#define _PRECOMP_H
+
+#define WIN32_NO_STATUS
+#include <windef.h>
+#include <winbase.h>
+#include <wingdi.h>
+#include <winreg.h>
+#include <winspool.h>
+#include <winspool_c.h>
+
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(winspool);
+
+#endif
diff --git a/reactos/win32ss/printing/base/winspool/winspool.rc b/reactos/win32ss/printing/base/winspool/winspool.rc
new file mode 100644 (file)
index 0000000..c7b2a80
--- /dev/null
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION  "ReactOS Spooler API"
+#define REACTOS_STR_INTERNAL_NAME     "winspool"
+#define REACTOS_STR_ORIGINAL_FILENAME "winspool.drv"
+#include <reactos/version.rc>
diff --git a/reactos/win32ss/printing/base/winspool/winspool.spec b/reactos/win32ss/printing/base/winspool/winspool.spec
new file mode 100644 (file)
index 0000000..d856269
--- /dev/null
@@ -0,0 +1,169 @@
+@ stub AbortPrinter
+@ stub AddFormA
+@ stub AddFormW
+@ stub AddJobA
+@ stub AddJobW
+@ stub AddMonitorA
+@ stub AddMonitorW
+@ stub AddPortA
+@ stub AddPortExA
+@ stub AddPortExW
+@ stub AddPortW
+@ stub AddPrinterA
+@ stub AddPrinterConnectionA
+@ stub AddPrinterConnectionW
+@ stub AddPrinterDriverA
+@ stub AddPrinterDriverExA
+@ stub AddPrinterDriverExW
+@ stub AddPrinterDriverW
+@ stub AddPrinterW
+@ stub AddPrintProcessorA
+@ stub AddPrintProcessorW
+@ stub AddPrintProvidorA
+@ stub AddPrintProvidorW
+@ stub AdvancedDocumentPropertiesA
+@ stub AdvancedDocumentPropertiesW
+@ stub ADVANCEDSETUPDIALOG
+@ stub AdvancedSetupDialog
+@ stdcall ClosePrinter(long)
+@ stub CloseSpoolFileHandle
+@ stub CommitSpoolData
+@ stub ConfigurePortA
+@ stub ConfigurePortW
+@ stub ConnectToPrinterDlg
+@ stub ConvertAnsiDevModeToUnicodeDevmode
+@ stub ConvertUnicodeDevModeToAnsiDevmode
+@ stub CreatePrinterIC
+@ stub DeleteFormA
+@ stub DeleteFormW
+@ stub DeleteMonitorA
+@ stub DeleteMonitorW
+@ stub DeletePortA
+@ stub DeletePortW
+@ stub DeletePrinter
+@ stub DeletePrinterConnectionA
+@ stub DeletePrinterConnectionW
+@ stub DeletePrinterDataA
+@ stub DeletePrinterDataExA
+@ stub DeletePrinterDataExW
+@ stub DeletePrinterDataW
+@ stub DeletePrinterDriverA
+@ stub DeletePrinterDriverExA
+@ stub DeletePrinterDriverExW
+@ stub DeletePrinterDriverW
+@ stub DeletePrinterIC
+@ stub DeletePrinterKeyA
+@ stub DeletePrinterKeyW
+@ stub DeletePrintProcessorA
+@ stub DeletePrintProcessorW
+@ stub DeletePrintProvidorA
+@ stub DeletePrintProvidorW
+@ stub DEVICECAPABILITIES
+@ stub DeviceCapabilities
+@ stdcall DeviceCapabilitiesA(str str long ptr ptr)
+@ stdcall DeviceCapabilitiesW(wstr wstr long ptr ptr)
+@ stub DEVICEMODE
+@ stub DeviceMode
+@ stub DevicePropertySheets
+@ stub DevQueryPrint
+@ stub DevQueryPrintEx
+@ stub DocumentEvent
+@ stdcall DocumentPropertiesA(long long ptr ptr ptr long)
+@ stdcall DocumentPropertiesW(long long ptr ptr ptr long)
+@ stub DocumentPropertySheets
+@ stdcall EndDocPrinter(long)
+@ stdcall EndPagePrinter(long)
+@ stub EnumFormsA
+@ stub EnumFormsW
+@ stub EnumJobsA
+@ stub EnumJobsW
+@ stub EnumMonitorsA
+@ stub EnumMonitorsW
+@ stub EnumPortsA
+@ stub EnumPortsW
+@ stub EnumPrinterDataA
+@ stub EnumPrinterDataExA
+@ stub EnumPrinterDataExW
+@ stub EnumPrinterDataW
+@ stub EnumPrinterDriversA
+@ stub EnumPrinterDriversW
+@ stub EnumPrinterKeyA
+@ stub EnumPrinterKeyW
+@ stdcall EnumPrintersA(long ptr long ptr long ptr ptr)
+@ stdcall EnumPrintersW(long ptr long ptr long ptr ptr)
+@ stub EnumPrintProcessorDatatypesA
+@ stub EnumPrintProcessorDatatypesW
+@ stub EnumPrintProcessorsA
+@ stub EnumPrintProcessorsW
+@ stub EXTDEVICEMODE
+@ stub ExtDeviceMode
+@ stub FindClosePrinterChangeNotification
+@ stub FindFirstPrinterChangeNotification
+@ stub FindNextPrinterChangeNotification
+@ stub FlushPrinter
+@ stub FreePrinterNotifyInfo
+@ stdcall GetDefaultPrinterA(ptr ptr)
+@ stdcall GetDefaultPrinterW(ptr ptr)
+@ stub GetFormA
+@ stub GetFormW
+@ stub GetJobA
+@ stub GetJobW
+@ stdcall GetPrinterA(long long ptr long ptr)
+@ stub GetPrinterDataA
+@ stub GetPrinterDataExA
+@ stub GetPrinterDataExW
+@ stub GetPrinterDataW
+@ stdcall GetPrinterDriverA(long str long ptr long ptr)
+@ stub GetPrinterDriverDirectoryA
+@ stub GetPrinterDriverDirectoryW
+@ stdcall GetPrinterDriverW(long wstr long ptr long ptr)
+@ stdcall GetPrinterW(long long ptr long ptr)
+@ stub GetPrintProcessorDirectoryA
+@ stdcall GetPrintProcessorDirectoryW(wstr wstr long ptr long ptr)
+@ stub GetSpoolFileHandle
+@ stub IsValidDevmodeA
+@ stub IsValidDevmodeW
+@ stdcall OpenPrinterA(str ptr ptr)
+@ stdcall OpenPrinterW(wstr ptr ptr)
+@ stub PerfClose
+@ stub PerfCollect
+@ stub PerfOpen
+@ stub PlayGdiScriptOnPrinterIC
+@ stub PrinterMessageBoxA
+@ stub PrinterMessageBoxW
+@ stub PrinterProperties
+@ stub QueryColorProfile
+@ stub QueryRemoteFonts
+@ stub QuerySpoolMode
+@ stub ReadPrinter
+@ stub ResetPrinterA
+@ stub ResetPrinterW
+@ stub ScheduleJob
+@ stub SeekPrinter
+@ stub SetAllocFailCount
+@ stub SetDefaultPrinterA
+@ stub SetDefaultPrinterW
+@ stub SetFormA
+@ stub SetFormW
+@ stub SetJobA
+@ stub SetJobW
+@ stub SetPortA
+@ stub SetPortW
+@ stub SetPrinterA
+@ stub SetPrinterDataA
+@ stub SetPrinterDataExA
+@ stub SetPrinterDataExW
+@ stub SetPrinterDataW
+@ stub SetPrinterW
+@ stub SplDriverUnloadComplete
+@ stub SpoolerDevQueryPrintW
+@ stub SpoolerInit
+@ stub SpoolerPrinterEvent
+@ stub StartDocDlgA
+@ stub StartDocDlgW
+@ stub StartDocPrinterA
+@ stdcall StartDocPrinterW(long long ptr)
+@ stdcall StartPagePrinter(long)
+@ stub WaitForPrinterChange
+@ stdcall WritePrinter(long ptr long ptr)
+@ stdcall XcvDataW(long wstr ptr long ptr long ptr ptr)
index 34ffc55..88057dd 100644 (file)
@@ -1 +1,20 @@
+
 add_subdirectory(ui)
+
+spec2def(localmon localmon.spec ADD_IMPORTLIB)
+
+list(APPEND SOURCE
+    main.c
+    precomp.h)
+
+add_library(localmon SHARED
+    ${SOURCE}
+    localmon.rc
+    ${CMAKE_CURRENT_BINARY_DIR}/localmon_stubs.c
+    ${CMAKE_CURRENT_BINARY_DIR}/localmon.def)
+
+set_module_type(localmon win32dll UNICODE)
+target_link_libraries(localmon wine)
+add_importlibs(localmon kernel32 msvcrt ntdll)
+add_pch(localmon precomp.h SOURCE)
+add_cd_file(TARGET localmon DESTINATION reactos/system32 FOR all)
diff --git a/reactos/win32ss/printing/monitors/localmon/localmon.rc b/reactos/win32ss/printing/monitors/localmon/localmon.rc
new file mode 100644 (file)
index 0000000..75a0a32
--- /dev/null
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION  "ReactOS Local Spooler Port Monitor"
+#define REACTOS_STR_INTERNAL_NAME     "localmon"
+#define REACTOS_STR_ORIGINAL_FILENAME "localmon.dll"
+#include <reactos/version.rc>
diff --git a/reactos/win32ss/printing/monitors/localmon/localmon.spec b/reactos/win32ss/printing/monitors/localmon/localmon.spec
new file mode 100644 (file)
index 0000000..48db9c4
--- /dev/null
@@ -0,0 +1 @@
+@ stdcall InitializePrintMonitor2(ptr ptr)
diff --git a/reactos/win32ss/printing/monitors/localmon/main.c b/reactos/win32ss/printing/monitors/localmon/main.c
new file mode 100644 (file)
index 0000000..a66d9f3
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * PROJECT:     ReactOS Local Spooler Port Monitor
+ * LICENSE:     GNU LGPL v2.1 or any later version as published by the Free Software Foundation
+ * PURPOSE:     Main functions
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#include "precomp.h"
+
+LPMONITOR2 WINAPI
+InitializePrintMonitor2(PMONITORINIT pMonitorInit, PHANDLE phMonitor)
+{
+    return NULL;
+}
diff --git a/reactos/win32ss/printing/monitors/localmon/precomp.h b/reactos/win32ss/printing/monitors/localmon/precomp.h
new file mode 100644 (file)
index 0000000..647439e
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * PROJECT:     ReactOS Local Spooler Port Monitor
+ * LICENSE:     GNU LGPL v2.1 or any later version as published by the Free Software Foundation
+ * PURPOSE:     Precompiled Header for all source files
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#ifndef _PRECOMP_H
+#define _PRECOMP_H
+
+#define WIN32_NO_STATUS
+#include <windef.h>
+#include <winbase.h>
+#include <wingdi.h>
+#include <winreg.h>
+#include <winspool.h>
+#include <winsplp.h>
+
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(localmon);
+
+#endif
diff --git a/reactos/win32ss/printing/processors/winprint/CMakeLists.txt b/reactos/win32ss/printing/processors/winprint/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0f120e2
--- /dev/null
@@ -0,0 +1,18 @@
+
+spec2def(winprint winprint.spec ADD_IMPORTLIB)
+
+list(APPEND SOURCE
+    main.c
+    precomp.h)
+
+add_library(winprint SHARED
+    ${SOURCE}
+    winprint.rc
+    ${CMAKE_CURRENT_BINARY_DIR}/winprint_stubs.c
+    ${CMAKE_CURRENT_BINARY_DIR}/winprint.def)
+
+set_module_type(winprint win32dll UNICODE)
+target_link_libraries(winprint wine)
+add_importlibs(winprint kernel32 msvcrt ntdll)
+add_pch(winprint precomp.h SOURCE)
+add_cd_file(TARGET winprint DESTINATION reactos/system32/spool/prtprocs/w32x86 FOR all)
diff --git a/reactos/win32ss/printing/processors/winprint/main.c b/reactos/win32ss/printing/processors/winprint/main.c
new file mode 100644 (file)
index 0000000..df999e2
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+ * PROJECT:     ReactOS Standard Print Processor
+ * LICENSE:     GNU LGPL v2.1 or any later version as published by the Free Software Foundation
+ * PURPOSE:     Main functions
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#include "precomp.h"
+
diff --git a/reactos/win32ss/printing/processors/winprint/precomp.h b/reactos/win32ss/printing/processors/winprint/precomp.h
new file mode 100644 (file)
index 0000000..7dce148
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * PROJECT:     ReactOS Standard Print Processor
+ * LICENSE:     GNU LGPL v2.1 or any later version as published by the Free Software Foundation
+ * PURPOSE:     Precompiled Header for all source files
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#ifndef _PRECOMP_H
+#define _PRECOMP_H
+
+#define WIN32_NO_STATUS
+#include <windef.h>
+#include <winbase.h>
+#include <wingdi.h>
+#include <winreg.h>
+#include <winspool.h>
+#include <winsplp.h>
+
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(winprint);
+
+#endif
diff --git a/reactos/win32ss/printing/processors/winprint/winprint.rc b/reactos/win32ss/printing/processors/winprint/winprint.rc
new file mode 100644 (file)
index 0000000..522d139
--- /dev/null
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION  "ReactOS Standard Print Processor"
+#define REACTOS_STR_INTERNAL_NAME     "winprint"
+#define REACTOS_STR_ORIGINAL_FILENAME "winprint.dll"
+#include <reactos/version.rc>
diff --git a/reactos/win32ss/printing/processors/winprint/winprint.spec b/reactos/win32ss/printing/processors/winprint/winprint.spec
new file mode 100644 (file)
index 0000000..745b1b1
--- /dev/null
@@ -0,0 +1,6 @@
+@ stub ClosePrintProcessor
+@ stub ControlPrintProcessor
+@ stub EnumPrintProcessorDatatypesW
+@ stub GetPrintProcessorCapabilities
+@ stub OpenPrintProcessor
+@ stub PrintDocumentOnPrintProcessor
index b7aca41..30b37ad 100644 (file)
@@ -1,3 +1,3 @@
 #add_subdirectory(inetpp)
-#add_subdirectory(localspl)
+add_subdirectory(localspl)
 #add_subdirectory(win32spl)
diff --git a/reactos/win32ss/printing/providers/localspl/CMakeLists.txt b/reactos/win32ss/printing/providers/localspl/CMakeLists.txt
new file mode 100644 (file)
index 0000000..28ad707
--- /dev/null
@@ -0,0 +1,18 @@
+
+spec2def(localspl localspl.spec ADD_IMPORTLIB)
+
+list(APPEND SOURCE
+    main.c
+    precomp.h)
+
+add_library(localspl SHARED
+    ${SOURCE}
+    localspl.rc
+    ${CMAKE_CURRENT_BINARY_DIR}/localspl_stubs.c
+    ${CMAKE_CURRENT_BINARY_DIR}/localspl.def)
+
+set_module_type(localspl win32dll UNICODE)
+target_link_libraries(localspl wine)
+add_importlibs(localspl kernel32 msvcrt ntdll)
+add_pch(localspl precomp.h SOURCE)
+add_cd_file(TARGET localspl DESTINATION reactos/system32 FOR all)
diff --git a/reactos/win32ss/printing/providers/localspl/localspl.rc b/reactos/win32ss/printing/providers/localspl/localspl.rc
new file mode 100644 (file)
index 0000000..71b7ec5
--- /dev/null
@@ -0,0 +1,5 @@
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION  "ReactOS Local Spooler"
+#define REACTOS_STR_INTERNAL_NAME     "localspl"
+#define REACTOS_STR_ORIGINAL_FILENAME "localspl.dll"
+#include <reactos/version.rc>
diff --git a/reactos/win32ss/printing/providers/localspl/localspl.spec b/reactos/win32ss/printing/providers/localspl/localspl.spec
new file mode 100644 (file)
index 0000000..12e6e29
--- /dev/null
@@ -0,0 +1 @@
+@ stdcall InitializePrintProvidor(ptr long ptr)
diff --git a/reactos/win32ss/printing/providers/localspl/main.c b/reactos/win32ss/printing/providers/localspl/main.c
new file mode 100644 (file)
index 0000000..374c21a
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * PROJECT:     ReactOS Local Spooler
+ * LICENSE:     GNU LGPL v2.1 or any later version as published by the Free Software Foundation
+ * PURPOSE:     Main functions
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#include "precomp.h"
+
+BOOL WINAPI
+InitializePrintProvidor(LPPRINTPROVIDOR pPrintProvidor, DWORD cbPrintProvidor, LPWSTR pFullRegistryPath)
+{
+    return FALSE;
+}
diff --git a/reactos/win32ss/printing/providers/localspl/precomp.h b/reactos/win32ss/printing/providers/localspl/precomp.h
new file mode 100644 (file)
index 0000000..ab00cc3
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * PROJECT:     ReactOS Local Spooler
+ * LICENSE:     GNU LGPL v2.1 or any later version as published by the Free Software Foundation
+ * PURPOSE:     Precompiled Header for all source files
+ * COPYRIGHT:   Copyright 2015 Colin Finck <colin@reactos.org>
+ */
+
+#ifndef _PRECOMP_H
+#define _PRECOMP_H
+
+#define WIN32_NO_STATUS
+#include <windef.h>
+#include <winbase.h>
+#include <wingdi.h>
+#include <winreg.h>
+#include <winspool.h>
+#include <winsplp.h>
+
+#include <wine/debug.h>
+WINE_DEFAULT_DEBUG_CHANNEL(localspl);
+
+#endif