From 773ff2e83b0547540639c6d4aeb9f817b621fb2f Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Thu, 6 Dec 2018 08:39:37 +0100 Subject: [PATCH] mpr: Implement support for deleting persistent connections. Signed-off-by: Pierre Schweitzer Signed-off-by: Alexandre Julliard --- dlls/mpr/wnet.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/mpr/wnet.c b/dlls/mpr/wnet.c index 3db0ab102a9..df8aef26080 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; }