[MPR]
authorPierre Schweitzer <pierre@reactos.org>
Sat, 27 Feb 2016 20:58:32 +0000 (20:58 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 27 Feb 2016 20:58:32 +0000 (20:58 +0000)
Fix enumeration of network places root directory when starting the enumeration from network providers enumeration

CORE-10878 #resolve #comment Fixed with r70793

svn path=/trunk/; revision=70793

reactos/dll/win32/mpr/mpr_ros.diff
reactos/dll/win32/mpr/wnet.c

index 0460538..8c4a8e8 100644 (file)
@@ -49,6 +49,28 @@ Index: wnet.c
 ===================================================================\r
 --- wnet.c     (rĂ©vision 70645)\r
 +++ wnet.c     (copie de travail)\r
 ===================================================================\r
 --- wnet.c     (rĂ©vision 70645)\r
 +++ wnet.c     (copie de travail)\r
+@@ -750,7 +750,12 @@\r
+                              providerTable->table[index].dwEnumScopes & WNNC_ENUM_GLOBAL)\r
+                             {\r
+                                 HANDLE handle;\r
++                                PVOID RemoteName = lpNet->lpRemoteName;\r
\r
++                                if ((lpNet->dwUsage & RESOURCEUSAGE_CONTAINER) &&\r
++                                    RemoteName && !strcmpW(RemoteName, lpNet->lpProvider))\r
++                                    lpNet->lpRemoteName = NULL;\r
++\r
+                                 ret = providerTable->table[index].openEnum(\r
+                                  dwScope, dwType, dwUsage, lpNet, &handle);\r
+                                 if (ret == WN_SUCCESS)\r
+@@ -760,6 +765,8 @@\r
+                                     ret = *lphEnum ? WN_SUCCESS :\r
+                                      WN_OUT_OF_MEMORY;\r
+                                 }\r
++\r
++                                lpNet->lpRemoteName = RemoteName;\r
+                             }\r
+                             else\r
+                                 ret = WN_NOT_SUPPORTED;\r
 @@ -1553,6 +1553,33 @@\r
                                dwFlags, NULL, 0, NULL);\r
  }\r
 @@ -1553,6 +1553,33 @@\r
                                dwFlags, NULL, 0, NULL);\r
  }\r
index 2cf1c8b..15ca562 100644 (file)
@@ -750,6 +750,11 @@ DWORD WINAPI WNetOpenEnumW( DWORD dwScope, DWORD dwType, DWORD dwUsage,
                              providerTable->table[index].dwEnumScopes & WNNC_ENUM_GLOBAL)
                             {
                                 HANDLE handle;
                              providerTable->table[index].dwEnumScopes & WNNC_ENUM_GLOBAL)
                             {
                                 HANDLE handle;
+                                PVOID RemoteName = lpNet->lpRemoteName;
+
+                                if ((lpNet->dwUsage & RESOURCEUSAGE_CONTAINER) &&
+                                    RemoteName && !strcmpW(RemoteName, lpNet->lpProvider))
+                                    lpNet->lpRemoteName = NULL;
 
                                 ret = providerTable->table[index].openEnum(
                                  dwScope, dwType, dwUsage, lpNet, &handle);
 
                                 ret = providerTable->table[index].openEnum(
                                  dwScope, dwType, dwUsage, lpNet, &handle);
@@ -760,6 +765,8 @@ DWORD WINAPI WNetOpenEnumW( DWORD dwScope, DWORD dwType, DWORD dwUsage,
                                     ret = *lphEnum ? WN_SUCCESS :
                                      WN_OUT_OF_MEMORY;
                                 }
                                     ret = *lphEnum ? WN_SUCCESS :
                                      WN_OUT_OF_MEMORY;
                                 }
+
+                                lpNet->lpRemoteName = RemoteName;
                             }
                             else
                                 ret = WN_NOT_SUPPORTED;
                             }
                             else
                                 ret = WN_NOT_SUPPORTED;