Detlef Riekenberg : localspl: Implement fpAddPort.

Alexandre Julliard julliard at winehq.org
Tue Sep 29 11:09:11 CDT 2009


Module: wine
Branch: master
Commit: 9d5377f50fe807252d836f56f9897bd02dc7cdf9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9d5377f50fe807252d836f56f9897bd02dc7cdf9

Author: Detlef Riekenberg <wine.dev at web.de>
Date:   Tue Sep 29 13:25:07 2009 +0200

localspl: Implement fpAddPort.

---

 dlls/localspl/provider.c |   68 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 67 insertions(+), 1 deletions(-)

diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c
index 2bf9414..0f1c293 100644
--- a/dlls/localspl/provider.c
+++ b/dlls/localspl/provider.c
@@ -1458,6 +1458,72 @@ static BOOL WINAPI fpAddMonitor(LPWSTR pName, DWORD Level, LPBYTE pMonitors)
 }
 
 /******************************************************************************
+ * fpAddPort [exported through PRINTPROVIDOR]
+ *
+ * Add a Port for a specific Monitor
+ *
+ * PARAMS
+ *  pName        [I] Servername or NULL (local Computer)
+ *  hWnd         [I] Handle to parent Window for the Dialog-Box
+ *  pMonitorName [I] Name of the Monitor that manage the Port
+ *
+ * RETURNS
+ *  Success: TRUE
+ *  Failure: FALSE
+ *
+ */
+static BOOL WINAPI fpAddPort(LPWSTR pName, HWND hWnd, LPWSTR pMonitorName)
+{
+    monitor_t * pm;
+    monitor_t * pui;
+    LONG        lres;
+    DWORD       res;
+
+    TRACE("(%s, %p, %s)\n", debugstr_w(pName), hWnd, debugstr_w(pMonitorName));
+
+    lres = copy_servername_from_name(pName, NULL);
+    if (lres) {
+        FIXME("server %s not supported\n", debugstr_w(pName));
+        SetLastError(ERROR_INVALID_PARAMETER);
+        return FALSE;
+    }
+
+    /* an empty Monitorname is Invalid */
+    if (!pMonitorName[0]) {
+        SetLastError(ERROR_NOT_SUPPORTED);
+        return FALSE;
+    }
+
+    pm = monitor_load(pMonitorName, NULL);
+    if (pm && pm->monitor && pm->monitor->pfnAddPort) {
+        res = pm->monitor->pfnAddPort(pName, hWnd, pMonitorName);
+        TRACE("got %d with %u (%s)\n", res, GetLastError(), debugstr_w(pm->dllname));
+    }
+    else
+    {
+        pui = monitor_loadui(pm);
+        if (pui && pui->monitorUI && pui->monitorUI->pfnAddPortUI) {
+            res = pui->monitorUI->pfnAddPortUI(pName, hWnd, pMonitorName, NULL);
+            TRACE("got %d with %u (%s)\n", res, GetLastError(), debugstr_w(pui->dllname));
+        }
+        else
+        {
+            FIXME("not implemented for %s (monitor %p: %s / monitorui %p: %s)\n",
+                    debugstr_w(pMonitorName), pm, debugstr_w(pm ? pm->dllname : NULL),
+                    pui, debugstr_w(pui ? pui->dllname : NULL));
+
+            SetLastError(ERROR_NOT_SUPPORTED);
+            res = FALSE;
+        }
+        monitor_unload(pui);
+    }
+    monitor_unload(pm);
+
+    TRACE("returning %d with %u\n", res, GetLastError());
+    return res;
+}
+
+/******************************************************************************
  * fpAddPrinterDriverEx [exported through PRINTPROVIDOR]
  *
  * Install a Printer Driver with the Option to upgrade / downgrade the Files
@@ -2017,7 +2083,7 @@ void setup_provider(void)
         NULL,   /* fpEnumForms */
         fpEnumMonitors,
         fpEnumPorts,
-        NULL,   /* fpAddPort */
+        fpAddPort,
         fpConfigurePort,
         fpDeletePort,
         NULL,   /* fpCreatePrinterIC */




More information about the wine-cvs mailing list