localspl: (3/4) Implement XcvDataPort

Detlef Riekenberg wine.dev at web.de
Mon Jan 15 17:38:02 CST 2007


Changelog:
- localspl: Implement XcvDataPort


This Patch depends on:
"localspl: implement XcvOpenPort and XcvClosePort"
http://www.winehq.org/pipermail/wine-patches/2007-January/034759.html



-- 
 
By by ... Detlef

-------------- next part --------------
>From 35ddd5b53f6028f0dcb3ce3b461c3f2998f99a3e Mon Sep 17 00:00:00 2001
From: Detlef Riekenberg <wine.dev at web.de>
Date: Tue, 16 Jan 2007 00:22:09 +0100
Subject: [PATCH] localspl: Implement XcvDataPort
---
 dlls/localspl/localmon.c |   52 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 51 insertions(+), 1 deletions(-)

diff --git a/dlls/localspl/localmon.c b/dlls/localspl/localmon.c
index 1fdcaae..27f4032 100644
--- a/dlls/localspl/localmon.c
+++ b/dlls/localspl/localmon.c
@@ -64,6 +64,8 @@ static struct list xcv_handles = LIST_IN
 
 /* ############################### */
 
+static const WCHAR cmd_MonitorUIW[] = {'M','o','n','i','t','o','r','U','I',0};
+static const WCHAR dllnameuiW[] = {'l','o','c','a','l','u','i','.','d','l','l',0};
 
 static const WCHAR WinNT_CV_PortsW[] = {'S','o','f','t','w','a','r','e','\\',
                                         'M','i','c','r','o','s','o','f','t','\\',
@@ -338,6 +340,54 @@ BOOL WINAPI localmon_XcvClosePort(HANDLE
 }
 
 /*****************************************************
+ * localmon_XcvDataPort [exported through MONITOREX]
+ *
+ * Execute command through a Communication-Channel
+ *
+ * PARAMS
+ *  hXcv            [i] The Handle to work with
+ *  pszDataName     [i] Name of the command to execute
+ *  pInputData      [i] Buffer for extra Input Data (needed only for some commands)
+ *  cbInputData     [i] Size in Bytes of Buffer at pInputData
+ *  pOutputData     [o] Buffer to receive additional Data (needed only for some commands)
+ *  cbOutputData    [i] Size in Bytes of Buffer at pOutputData
+ *  pcbOutputNeeded [o] PTR to receive the minimal Size in Bytes of the Buffer at pOutputData
+ *
+ * RETURNS
+ *  Success: ERROR_SUCCESS
+ *  Failure: win32 error code (same value is returned by GetLastError) 
+ *
+ * NOTES
+ *
+ *  Minimal List of commands, that every Printmonitor DLL should support:
+ *
+ *| "MonitorUI" : Return the Name of the Userinterface-DLL as WSTR in pOutputData
+ *| "AddPort"   : Add a Port (Name as WSTR in pInputData)
+ *| "DeletePort": Delete a Port (Name as WSTR in pInputData)
+ *
+ *
+ */
+DWORD WINAPI localmon_XcvDataPort(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInputData, DWORD cbInputData,
+                PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
+{
+
+    TRACE("(%p, %s, %p, %d, %p, %d, %p)\n", hXcv, debugstr_w(pszDataName),
+          pInputData, cbInputData, pOutputData, cbOutputData, pcbOutputNeeded);
+
+
+    if (!lstrcmpW(pszDataName, cmd_MonitorUIW)) {
+        * pcbOutputNeeded = sizeof(dllnameuiW);
+        if (cbOutputData >= sizeof(dllnameuiW)) {
+            memcpy(pOutputData, dllnameuiW, sizeof(dllnameuiW));
+            return ERROR_SUCCESS;
+        }
+        return ERROR_INSUFFICIENT_BUFFER;
+    }
+    FIXME("command not supported: %s\n", debugstr_w(pszDataName));
+    return ERROR_INVALID_PARAMETER;
+}
+
+/*****************************************************
  * localmon_XcvOpenPort [exported through MONITOREX]
  *
  * Open a Communication-Channel
@@ -418,7 +468,7 @@ LPMONITOREX WINAPI InitializePrintMonito
             NULL,       /* localmon_GetPrinterDataFromPort */
             NULL,       /* localmon_SetPortTimeOuts */
             localmon_XcvOpenPort,
-            NULL,        /* localmon_XcvDataPort */
+            localmon_XcvDataPort,
             localmon_XcvClosePort            
         }
     };
-- 
1.4.1



More information about the wine-patches mailing list