localspl: [1/2] Implement DeletePort for XcvDataPort

Detlef Riekenberg wine.dev at web.de
Tue Mar 6 17:20:25 CST 2007


localspl: Implement DeletePort for XcvDataPort

-- 
 
By by ... Detlef

-------------- next part --------------
>From d9c384cc9a0fdfd4d06f022c591b9e8cd121cd17 Mon Sep 17 00:00:00 2001
From: Detlef Riekenberg <wine.dev at web.de>
Date: Wed, 7 Mar 2007 00:15:13 +0100
Subject: [PATCH] localspl: Implement DeletePort for XcvDataPort
---
 dlls/localspl/localmon.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/dlls/localspl/localmon.c b/dlls/localspl/localmon.c
index c195c17..c98611d 100644
--- a/dlls/localspl/localmon.c
+++ b/dlls/localspl/localmon.c
@@ -65,6 +65,7 @@ static struct list xcv_handles = LIST_IN
 
 /* ############################### */
 
+static const WCHAR cmd_DeletePortW[] = {'D','e','l','e','t','e','P','o','r','t',0};
 static const WCHAR cmd_ConfigureLPTPortCommandOKW[] = {'C','o','n','f','i','g','u','r','e',
                                     'L','P','T','P','o','r','t',
                                     'C','o','m','m','a','n','d','O','K',0};
@@ -468,6 +469,18 @@ DWORD WINAPI localmon_XcvDataPort(HANDLE
         return res;
     }
 
+    if (!lstrcmpW(pszDataName, cmd_DeletePortW)) {
+        TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData));
+        res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_PortsW, &hroot);
+        if (res == ERROR_SUCCESS) {
+            res = RegDeleteValueW(hroot, (LPWSTR) pInputData);
+            RegCloseKey(hroot);
+            TRACE("=> %u with %u\n", res, GetLastError() );
+            return res;
+        }
+        return ERROR_FILE_NOT_FOUND;
+    }
+
     if (!lstrcmpW(pszDataName, cmd_GetDefaultCommConfigW)) {
         TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData));
         *pcbOutputNeeded = cbOutputData;
-- 
1.4.1



More information about the wine-patches mailing list