winspool: [2/2] Implement ConfigurePortA (synced to current git)

Detlef Riekenberg wine.dev at web.de
Wed Nov 8 17:04:11 CST 2006


Changelog:
- winspool: Implement ConfigurePortA


Synced to current git

The test [3/3] is still "in-sync":
http://www.winehq.org/pipermail/wine-patches/2006-November/032559.html


Thanks

-- 
 
By by ... Detlef

-------------- next part --------------
>From a5cb59ddf503e1668b0d5c6ed378b7a35a2c2843 Mon Sep 17 00:00:00 2001
From: Detlef Riekenberg <wine.dev at web.de>
Date: Wed, 8 Nov 2006 23:24:37 +0100
Subject: [PATCH] winspool: Implement ConfigurePortA
---
 dlls/winspool.drv/info.c |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index 47f7b81..8759257 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -5788,8 +5788,31 @@ BOOL WINAPI AddPrinterDriverExA( LPSTR p
  */
 BOOL WINAPI ConfigurePortA(LPSTR pName, HWND hWnd, LPSTR pPortName)
 {
-    FIXME("%s %p %s\n", debugstr_a(pName), hWnd, debugstr_a(pPortName));
-    return FALSE;
+    LPWSTR  nameW = NULL;
+    LPWSTR  portW = NULL;
+    INT     len;
+    DWORD   res;
+
+    TRACE("(%s, %p, %s)\n", debugstr_a(pName), hWnd, debugstr_a(pPortName));
+
+    /* convert servername to unicode */
+    if (pName) {
+        len = MultiByteToWideChar(CP_ACP, 0, pName, -1, NULL, 0);
+        nameW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+        MultiByteToWideChar(CP_ACP, 0, pName, -1, nameW, len);
+    }
+
+    /* convert portname to unicode */
+    if (pPortName) {
+        len = MultiByteToWideChar(CP_ACP, 0, pPortName, -1, NULL, 0);
+        portW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+        MultiByteToWideChar(CP_ACP, 0, pPortName, -1, portW, len);
+    }
+
+    res = ConfigurePortW(nameW, hWnd, portW);
+    HeapFree(GetProcessHeap(), 0, nameW);
+    HeapFree(GetProcessHeap(), 0, portW);
+    return res;
 }
 
 /******************************************************************************
-- 
1.4.1



More information about the wine-patches mailing list