[ros-diffs] [dchapyshev] 39866: - Sync spoolss with Wine head - Fix winspool stubs

dchapyshev at svn.reactos.org dchapyshev at svn.reactos.org
Wed Mar 4 16:24:06 CET 2009


Author: dchapyshev
Date: Wed Mar  4 18:24:06 2009
New Revision: 39866

URL: http://svn.reactos.org/svn/reactos?rev=39866&view=rev
Log:
- Sync spoolss with Wine head
- Fix winspool stubs

Modified:
    trunk/reactos/dll/win32/spoolss/router.c
    trunk/reactos/dll/win32/spoolss/spoolss.spec
    trunk/reactos/dll/win32/winspool/stubs.c

Modified: trunk/reactos/dll/win32/spoolss/router.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/spoolss/router.c?rev=39866&r1=39865&r2=39866&view=diff
==============================================================================
--- trunk/reactos/dll/win32/spoolss/router.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/spoolss/router.c [iso-8859-1] Wed Mar  4 18:24:06 2009
@@ -313,6 +313,122 @@
 }
 
 /******************************************************************
+ * AddMonitorW (spoolss.@)
+ *
+ * Install a Printmonitor
+ *
+ * PARAMS
+ *  pName       [I] Servername or NULL (local Computer)
+ *  Level       [I] Structure-Level (Must be 2)
+ *  pMonitors   [I] PTR to MONITOR_INFO_2
+ *
+ * RETURNS
+ *  Success: TRUE
+ *  Failure: FALSE
+ *
+ * NOTES
+ *  All Files for the Monitor must already be copied to %winsysdir% ("%SystemRoot%\system32")
+ *
+ */
+BOOL WINAPI AddMonitorW(LPWSTR pName, DWORD Level, LPBYTE pMonitors)
+{
+    backend_t * pb;
+    DWORD res = ROUTER_UNKNOWN;
+
+    TRACE("(%s, %d, %p)\n", debugstr_w(pName), Level, pMonitors);
+
+    if (Level != 2) {
+        SetLastError(ERROR_INVALID_LEVEL);
+        return FALSE;
+    }
+
+    pb = backend_first(pName);
+    if (pb && pb->fpAddMonitor)
+        res = pb->fpAddMonitor(pName, Level, pMonitors);
+    else
+    {
+        SetLastError(ERROR_PROC_NOT_FOUND);
+    }
+
+    TRACE("got %u with %u\n", res, GetLastError());
+    return (res == ROUTER_SUCCESS);
+}
+
+/******************************************************************
+ * AddPrinterDriverExW (spoolss.@)
+ *
+ * Install a Printer Driver with the Option to upgrade / downgrade the Files
+ *
+ * PARAMS
+ *  pName           [I] Servername or NULL (local Computer)
+ *  level           [I] Level for the supplied DRIVER_INFO_*W struct
+ *  pDriverInfo     [I] PTR to DRIVER_INFO_*W struct with the Driver Parameter
+ *  dwFileCopyFlags [I] How to Copy / Upgrade / Downgrade the needed Files
+ *
+ * RESULTS
+ *  Success: TRUE
+ *  Failure: FALSE
+ *
+ */
+BOOL WINAPI AddPrinterDriverExW(LPWSTR pName, DWORD level, LPBYTE pDriverInfo, DWORD dwFileCopyFlags)
+{
+    backend_t * pb;
+    DWORD res = ROUTER_UNKNOWN;
+
+    TRACE("(%s, %d, %p, 0x%x)\n", debugstr_w(pName), level, pDriverInfo, dwFileCopyFlags);
+
+    if (!pDriverInfo) {
+        SetLastError(ERROR_INVALID_PARAMETER);
+        return FALSE;
+    }
+
+    pb = backend_first(pName);
+    if (pb && pb->fpAddPrinterDriverEx)
+        res = pb->fpAddPrinterDriverEx(pName, level, pDriverInfo, dwFileCopyFlags);
+    else
+    {
+        SetLastError(ERROR_PROC_NOT_FOUND);
+    }
+
+    TRACE("got %u with %u\n", res, GetLastError());
+    return (res == ROUTER_SUCCESS);
+}
+
+/******************************************************************
+ * DeleteMonitorW (spoolss.@)
+ *
+ * Delete a specific Printmonitor from a Printing-Environment
+ *
+ * PARAMS
+ *  pName        [I] Servername or NULL (local Computer)
+ *  pEnvironment [I] Printing-Environment of the Monitor or NULL (Default)
+ *  pMonitorName [I] Name of the Monitor, that should be deleted
+ *
+ * RETURNS
+ *  Success: TRUE
+ *  Failure: FALSE
+ *
+ */
+BOOL WINAPI DeleteMonitorW(LPWSTR pName, LPWSTR pEnvironment, LPWSTR pMonitorName)
+{
+    backend_t * pb;
+    DWORD res = ROUTER_UNKNOWN;
+
+    TRACE("(%s, %s, %s)\n", debugstr_w(pName), debugstr_w(pEnvironment), debugstr_w(pMonitorName));
+
+    pb = backend_first(pName);
+    if (pb && pb->fpDeleteMonitor)
+        res = pb->fpDeleteMonitor(pName, pEnvironment, pMonitorName);
+    else
+    {
+        SetLastError(ERROR_PROC_NOT_FOUND);
+    }
+
+    TRACE("got %u with %u\n", res, GetLastError());
+    return (res == ROUTER_SUCCESS);
+}
+
+/******************************************************************
  * EnumMonitorsW (spoolss.@)
  *
  * Enumerate available Port-Monitors
@@ -399,3 +515,58 @@
 
     return (res == ROUTER_SUCCESS);
 }
+
+/******************************************************************
+ * GetPrinterDriverDirectoryW (spoolss.@)
+ *
+ * Return the PATH for the Printer-Drivers
+ *
+ * PARAMS
+ *   pName            [I] Servername or NULL (local Computer)
+ *   pEnvironment     [I] Printing-Environment or NULL (Default)
+ *   Level            [I] Structure-Level (must be 1)
+ *   pDriverDirectory [O] PTR to Buffer that receives the Result
+ *   cbBuf            [I] Size of Buffer at pDriverDirectory
+ *   pcbNeeded        [O] PTR to DWORD that receives the size in Bytes used /
+ *                        required for pDriverDirectory
+ *
+ * RETURNS
+ *   Success: TRUE  and in pcbNeeded the Bytes used in pDriverDirectory
+ *   Failure: FALSE and in pcbNeeded the Bytes required for pDriverDirectory,
+ *   if cbBuf is too small
+ *
+ *   Native Values returned in pDriverDirectory on Success:
+ *|  NT(Windows NT x86): "%winsysdir%\\spool\\DRIVERS\\w32x86"
+ *|  NT(Windows x64):    "%winsysdir%\\spool\\DRIVERS\\x64"
+ *|  NT(Windows 4.0):    "%winsysdir%\\spool\\DRIVERS\\win40"
+ *|  win9x(Windows 4.0): "%winsysdir%"
+ *
+ *   "%winsysdir%" is the Value from GetSystemDirectoryW()
+ *
+ */
+BOOL WINAPI GetPrinterDriverDirectoryW(LPWSTR pName, LPWSTR pEnvironment,
+            DWORD Level, LPBYTE pDriverDirectory, DWORD cbBuf, LPDWORD pcbNeeded)
+{
+    backend_t * pb;
+    DWORD res = ROUTER_UNKNOWN;
+
+    TRACE("(%s, %s, %d, %p, %d, %p)\n", debugstr_w(pName),
+          debugstr_w(pEnvironment), Level, pDriverDirectory, cbBuf, pcbNeeded);
+
+    if (pcbNeeded) *pcbNeeded = 0;
+
+    pb = backend_first(pName);
+    if (pb && pb->fpGetPrinterDriverDirectory)
+        res = pb->fpGetPrinterDriverDirectory(pName, pEnvironment, Level,
+                                              pDriverDirectory, cbBuf, pcbNeeded);
+    else
+    {
+        SetLastError(ERROR_PROC_NOT_FOUND);
+    }
+
+    TRACE("got %u with %u (%u byte)\n",
+            res, GetLastError(), pcbNeeded ? *pcbNeeded : 0);
+
+    return (res == ROUTER_SUCCESS);
+
+}

Modified: trunk/reactos/dll/win32/spoolss/spoolss.spec
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/spoolss/spoolss.spec?rev=39866&r1=39865&r2=39866&view=diff
==============================================================================
--- trunk/reactos/dll/win32/spoolss/spoolss.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/spoolss/spoolss.spec [iso-8859-1] Wed Mar  4 18:24:06 2009
@@ -1,14 +1,14 @@
 @ stub AbortPrinter
 @ stub AddFormW
 @ stub AddJobW
-@ stub AddMonitorW
+@ stdcall AddMonitorW(wstr long ptr)
 @ stub AddPerMachineConnectionW
 @ stub AddPortExW
 @ stub AddPortW
 @ stub AddPrintProcessorW
 @ stub AddPrintProvidorW
 @ stub AddPrinterConnectionW
-@ stub AddPrinterDriverExW
+@ stdcall AddPrinterDriverExW(wstr long ptr long)
 @ stub AddPrinterDriverW
 @ stub AddPrinterExW
 @ stub AddPrinterW
@@ -25,7 +25,7 @@
 @ stub CreatePrinterIC
 @ stub DbgGetPointers
 @ stub DeleteFormW
-@ stub DeleteMonitorW
+@ stdcall DeleteMonitorW(wstr wstr wstr)
 @ stub DeletePerMachineConnectionW
 @ stub DeletePortW
 @ stub DeletePrintProcessorW
@@ -68,7 +68,7 @@
 @ stub GetPrintProcessorDirectoryW
 @ stub GetPrinterDataExW
 @ stub GetPrinterDataW
-@ stub GetPrinterDriverDirectoryW
+@ stdcall GetPrinterDriverDirectoryW(wstr wstr long ptr long ptr)
 @ stub GetPrinterDriverExW
 @ stub GetPrinterDriverW
 @ stub GetPrinterW

Modified: trunk/reactos/dll/win32/winspool/stubs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winspool/stubs.c?rev=39866&r1=39865&r2=39866&view=diff
==============================================================================
--- trunk/reactos/dll/win32/winspool/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/winspool/stubs.c [iso-8859-1] Wed Mar  4 18:24:06 2009
@@ -1068,9 +1068,9 @@
 /*
  * @unimplemented
  */
-DWORD
-WINAPI
-GetPrinterDriverA(HANDLE Printer, LPSTR Environment, DWORD Level, PBYTE Buffer, DWORD BufSize, PDWORD Needed)
+BOOL
+WINAPI
+GetPrinterDriverA(HANDLE Printer, LPSTR Environment, DWORD Level, LPBYTE Buffer, DWORD BufSize, LPDWORD Needed)
 {
   OutputDebugStringW(L"winspool GetPrinterDriverA stub called\n");
   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
@@ -1082,9 +1082,9 @@
 /*
  * @unimplemented
  */
-DWORD
-WINAPI
-GetPrinterDriverW(HANDLE Printer, LPWSTR Environment, DWORD Level, PBYTE Buffer, DWORD BufSize, PDWORD Needed)
+BOOL
+WINAPI
+GetPrinterDriverW(HANDLE Printer, LPWSTR Environment, DWORD Level, LPBYTE Buffer, DWORD BufSize, LPDWORD Needed)
 {
   OutputDebugStringW(L"winspool GetPrinterDriverW stub called\n");
   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
@@ -1096,9 +1096,9 @@
 /*
  * @unimplemented
  */
-DWORD
-WINAPI
-GetPrinterDriverDirectoryA(LPSTR Name, LPSTR Environment, DWORD Level, PBYTE Buffer, DWORD BufSize, PDWORD Needed)
+BOOL
+WINAPI
+GetPrinterDriverDirectoryA(LPSTR Name, LPSTR Environment, DWORD Level, LPBYTE Buffer, DWORD BufSize, LPDWORD Needed)
 {
   OutputDebugStringW(L"winspool GetPrinterDriverDirectoryA stub called\n");
   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
@@ -1110,9 +1110,9 @@
 /*
  * @unimplemented
  */
-DWORD
-WINAPI
-GetPrinterDriverDirectoryW(LPWSTR Name, LPWSTR Environment, DWORD Level, PBYTE Buffer, DWORD BufSize, PDWORD Needed)
+BOOL
+WINAPI
+GetPrinterDriverDirectoryW(LPWSTR Name, LPWSTR Environment, DWORD Level, LPBYTE Buffer, DWORD BufSize, LPDWORD Needed)
 {
   OutputDebugStringW(L"winspool GetPrinterDriverDirectoryW stub called\n");
   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
@@ -1124,9 +1124,9 @@
 /*
  * @unimplemented
  */
-DWORD
-WINAPI
-GetPrintProcessorDirectoryA(LPSTR Name, LPSTR Environment, DWORD Level, PBYTE Buffer, DWORD BufSize, PDWORD Needed)
+BOOL
+WINAPI
+GetPrintProcessorDirectoryA(LPSTR Name, LPSTR Environment, DWORD Level, LPBYTE Buffer, DWORD BufSize, LPDWORD Needed)
 {
   OutputDebugStringW(L"winspool GetPrintProcessorDirectoryA stub called\n");
   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
@@ -1138,9 +1138,9 @@
 /*
  * @unimplemented
  */
-DWORD
-WINAPI
-GetPrintProcessorDirectoryW(LPWSTR Name, LPWSTR Environment, DWORD Level, PBYTE Buffer, DWORD BufSize, PDWORD Needed)
+BOOL
+WINAPI
+GetPrintProcessorDirectoryW(LPWSTR Name, LPWSTR Environment, DWORD Level, LPBYTE Buffer, DWORD BufSize, LPDWORD Needed)
 {
   OutputDebugStringW(L"winspool GetPrintProcessorDirectoryW stub called\n");
   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);



More information about the Ros-diffs mailing list