mpr: Properly handle device-less connections.

Signed-off-by: Pierre Schweitzer <pierre@reactos.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Pierre Schweitzer 2018-09-14 08:38:28 +02:00 committed by Alexandre Julliard
parent a220669f33
commit 93fb279f4f
1 changed files with 9 additions and 1 deletions

View File

@ -2413,6 +2413,7 @@ DWORD WINAPI WNetGetUniversalNameW ( LPCWSTR lpLocalPath, DWORD dwInfoLevel,
DWORD WINAPI WNetClearConnections ( HWND owner )
{
HANDLE connected;
PWSTR connection;
DWORD ret, size, count;
NETRESOURCEW * resources, * iter;
@ -2446,7 +2447,14 @@ DWORD WINAPI WNetClearConnections ( HWND owner )
if (ret == WN_SUCCESS || ret == WN_MORE_DATA)
{
for (iter = resources; count; count--, iter++)
WNetCancelConnection2W(iter->lpLocalName, 0, TRUE);
{
if (iter->lpLocalName && iter->lpLocalName[0])
connection = iter->lpLocalName;
else
connection = iter->lpRemoteName;
WNetCancelConnection2W(connection, 0, TRUE);
}
}
else
break;