mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 08:16:34 +00:00
[MPR] Import Wine commit: 773ff2e83b0547540639c6d4aeb9f817b621fb2f
Implement support for deleting persistent connections.
This commit is contained in:
parent
3e8ec64489
commit
bcad6700ec
1 changed files with 6 additions and 20 deletions
|
@ -2298,37 +2298,23 @@ DWORD WINAPI WNetCancelConnection2W( LPCWSTR lpName, DWORD dwFlags, BOOL fForce
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef __REACTOS__
|
|
||||||
|
|
||||||
if (dwFlags & CONNECT_UPDATE_PROFILE)
|
if (ret == WN_SUCCESS && dwFlags & CONNECT_UPDATE_PROFILE)
|
||||||
{
|
{
|
||||||
HKEY user_profile;
|
HKEY user_profile;
|
||||||
WCHAR *coma = strchrW(lpName, ':');
|
|
||||||
|
|
||||||
if (coma && RegOpenCurrentUser(KEY_ALL_ACCESS, &user_profile) == ERROR_SUCCESS)
|
/* 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;
|
WCHAR subkey[10] = {'N', 'e', 't', 'w', 'o', 'r', 'k', '\\', lpName[0], 0};
|
||||||
DWORD len;
|
|
||||||
|
|
||||||
len = (ULONG_PTR)coma - (ULONG_PTR)lpName + sizeof(L"Network\\");
|
|
||||||
subkey = HeapAlloc(GetProcessHeap(), 0, len);
|
|
||||||
if (subkey)
|
|
||||||
{
|
|
||||||
strcpyW(subkey, L"Network\\");
|
|
||||||
memcpy(subkey + (sizeof(L"Network\\") / sizeof(WCHAR)) - 1, lpName, (ULONG_PTR)coma - (ULONG_PTR)lpName);
|
|
||||||
subkey[len / sizeof(WCHAR) - 1] = 0;
|
|
||||||
|
|
||||||
TRACE("Removing: %S\n", subkey);
|
|
||||||
|
|
||||||
RegDeleteKeyW(user_profile, subkey);
|
RegDeleteKeyW(user_profile, subkey);
|
||||||
HeapFree(GetProcessHeap(), 0, subkey);
|
|
||||||
}
|
|
||||||
|
|
||||||
RegCloseKey(user_profile);
|
RegCloseKey(user_profile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue