Pierre Schweitzer : mpr: Implement support for deleting persistent connections.

Alexandre Julliard julliard at winehq.org
Thu Dec 6 15:24:58 CST 2018


Module: wine
Branch: master
Commit: 773ff2e83b0547540639c6d4aeb9f817b621fb2f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=773ff2e83b0547540639c6d4aeb9f817b621fb2f

Author: Pierre Schweitzer <pierre at reactos.org>
Date:   Thu Dec  6 08:39:37 2018 +0100

mpr: Implement support for deleting persistent connections.

Signed-off-by: Pierre Schweitzer <pierre at reactos.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mpr/wnet.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/dlls/mpr/wnet.c b/dlls/mpr/wnet.c
index 3db0ab1..df8aef2 100644
--- a/dlls/mpr/wnet.c
+++ b/dlls/mpr/wnet.c
@@ -2290,6 +2290,23 @@ DWORD WINAPI WNetCancelConnection2W( LPCWSTR lpName, DWORD dwFlags, BOOL fForce
             }
         }
     }
+
+    if (ret == WN_SUCCESS && dwFlags & CONNECT_UPDATE_PROFILE)
+    {
+        HKEY user_profile;
+
+        /* FIXME: Only remove it if that's a drive letter */
+        if (isalphaW(lpName[0]) && lpName[1] == ':' &&
+            RegOpenCurrentUser(KEY_ALL_ACCESS, &user_profile) == ERROR_SUCCESS)
+        {
+            WCHAR subkey[10] = {'N', 'e', 't', 'w', 'o', 'r', 'k', '\\', lpName[0], 0};
+
+            RegDeleteKeyW(user_profile, subkey);
+
+            RegCloseKey(user_profile);
+        }
+    }
+
     return ret;
 }
 




More information about the wine-cvs mailing list