https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f4da2bab03cbc627e750f09c6580f75dd945215f

commit f4da2bab03cbc627e750f09c6580f75dd945215f
Author:     Pierre Schweitzer <[email protected]>
AuthorDate: Fri Sep 14 22:30:41 2018 +0200
Commit:     Pierre Schweitzer <[email protected]>
CommitDate: Fri Sep 14 22:34:02 2018 +0200

    [MPR] Import Wine commit: 93fb279f4f3e150eee329b02ca5fb0251d8a239d
    Properly handle device-less connections.
    
    CORE-15012
---
 dll/win32/mpr/wnet.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/dll/win32/mpr/wnet.c b/dll/win32/mpr/wnet.c
index 80375b837e..162b41f4b9 100644
--- a/dll/win32/mpr/wnet.c
+++ b/dll/win32/mpr/wnet.c
@@ -2652,6 +2652,7 @@ DWORD WINAPI WNetGetUniversalNameW ( LPCWSTR lpLocalPath, 
DWORD dwInfoLevel,
 DWORD WINAPI WNetClearConnections ( HWND owner )
 {
     HANDLE connected;
+    PWSTR connection;
     DWORD ret, size, count;
     NETRESOURCEW * resources, * iter;
 
@@ -2685,7 +2686,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;

Reply via email to