From 13dfbf259244dbbd7deacab4205edfdf1055c65b Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 27 Feb 2016 20:58:32 +0000 Subject: [PATCH] [MPR] 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 | 22 ++++++++++++++++++++++ reactos/dll/win32/mpr/wnet.c | 7 +++++++ 2 files changed, 29 insertions(+) diff --git a/reactos/dll/win32/mpr/mpr_ros.diff b/reactos/dll/win32/mpr/mpr_ros.diff index 04605380688..8c4a8e86c5f 100644 --- a/reactos/dll/win32/mpr/mpr_ros.diff +++ b/reactos/dll/win32/mpr/mpr_ros.diff @@ -49,6 +49,28 @@ Index: wnet.c =================================================================== --- wnet.c (révision 70645) +++ wnet.c (copie de travail) +@@ -750,7 +750,12 @@ + 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); + if (ret == WN_SUCCESS) +@@ -760,6 +765,8 @@ + ret = *lphEnum ? WN_SUCCESS : + WN_OUT_OF_MEMORY; + } ++ ++ lpNet->lpRemoteName = RemoteName; + } + else + ret = WN_NOT_SUPPORTED; @@ -1553,6 +1553,33 @@ dwFlags, NULL, 0, NULL); } diff --git a/reactos/dll/win32/mpr/wnet.c b/reactos/dll/win32/mpr/wnet.c index 2cf1c8ba053..15ca5627bef 100644 --- a/reactos/dll/win32/mpr/wnet.c +++ b/reactos/dll/win32/mpr/wnet.c @@ -750,6 +750,11 @@ DWORD WINAPI WNetOpenEnumW( DWORD dwScope, DWORD dwType, DWORD dwUsage, 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); @@ -760,6 +765,8 @@ DWORD WINAPI WNetOpenEnumW( DWORD dwScope, DWORD dwType, DWORD dwUsage, ret = *lphEnum ? WN_SUCCESS : WN_OUT_OF_MEMORY; } + + lpNet->lpRemoteName = RemoteName; } else ret = WN_NOT_SUPPORTED; -- 2.17.1