[PATCH] spoolss: Implement EnumMonitors

Detlef Riekenberg wine.dev at web.de
Sun Feb 8 09:49:38 CST 2009


---
 dlls/spoolss/router.c     |   64 +++++++++++++++++++++++++++++++++++++++++++++
 dlls/spoolss/spoolss.spec |    2 +-
 2 files changed, 65 insertions(+), 1 deletions(-)

diff --git a/dlls/spoolss/router.c b/dlls/spoolss/router.c
index fb3279e..f3d3045 100644
--- a/dlls/spoolss/router.c
+++ b/dlls/spoolss/router.c
@@ -268,3 +268,67 @@ BOOL backend_load_all(void)
 
     return (pb != NULL);
 }
+
+/******************************************************************************
+ * backend_first [internal]
+ *
+ * find the first usable backend
+ *
+ * RETURNS
+ *  Success: PTR to the backend
+ *  Failure: NULL
+ *
+ */
+static backend_t * backend_first(LPWSTR name)
+{
+    /* test for the local system first */
+    if(!name || !name[0]) return backend[0];
+
+    FIXME("server %s not supported\n", debugstr_w(name));
+    return NULL;
+}
+
+/******************************************************************
+ * EnumMonitorsW (spoolss.@)
+ *
+ * Enumerate available Port-Monitors
+ *
+ * PARAMS
+ *  pName      [I] Servername or NULL (local Computer)
+ *  Level      [I] Structure-Level
+ *  pMonitors  [O] PTR to Buffer that receives the Result
+ *  cbBuf      [I] Size of Buffer at pMonitors
+ *  pcbNeeded  [O] PTR to DWORD that receives the size in Bytes used / required for pMonitors
+ *  pcReturned [O] PTR to DWORD that receives the number of Monitors in pMonitors
+ *
+ * RETURNS
+ *  Success: TRUE
+ *  Failure: FALSE and in pcbNeeded the Bytes required for pMonitors, if cbBuf is too small
+ *
+ */
+BOOL WINAPI EnumMonitorsW(LPWSTR pName, DWORD Level, LPBYTE pMonitors, DWORD cbBuf,
+                          LPDWORD pcbNeeded, LPDWORD pcReturned)
+{
+    backend_t * pb;
+    DWORD res = ROUTER_UNKNOWN;
+
+    TRACE("(%s, %d, %p, %d, %p, %p)\n", debugstr_w(pName), Level, pMonitors,
+          cbBuf, pcbNeeded, pcReturned);
+
+    if (pcbNeeded) *pcbNeeded = 0;
+    if (pcReturned) *pcReturned = 0;
+
+    pb = backend_first(pName);
+    if (pb && pb->fpEnumMonitors)
+        res = pb->fpEnumMonitors(pName, Level, pMonitors, cbBuf, pcbNeeded, pcReturned);
+    else
+    {
+        SetLastError(ERROR_PROC_NOT_FOUND);
+    }
+
+    TRACE("got %u with %u (%u byte for %u entries)\n\n", res, GetLastError(),
+            pcbNeeded ? *pcbNeeded : 0, pcReturned ? *pcReturned : 0);
+
+    return (res == ROUTER_SUCCESS);
+}
+
diff --git a/dlls/spoolss/spoolss.spec b/dlls/spoolss/spoolss.spec
index da5ee04..237bab1 100644
--- a/dlls/spoolss/spoolss.spec
+++ b/dlls/spoolss/spoolss.spec
@@ -45,7 +45,7 @@
 @ stub EndPagePrinter
 @ stub EnumFormsW
 @ stub EnumJobsW
-@ stub EnumMonitorsW
+@ stdcall EnumMonitorsW(wstr long ptr long ptr ptr)
 @ stub EnumPerMachineConnectionsW
 @ stdcall EnumPortsW(wstr long ptr ptr ptr ptr) winspool.drv.EnumPortsW
 @ stub EnumPrintProcessorDatatypesW
-- 
1.5.4.3


--=-EarbMbKZaWzX1AD3I5Pe--




More information about the wine-patches mailing list