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
This commit is contained in:
Pierre Schweitzer 2016-02-27 20:58:32 +00:00
parent ad68f421d5
commit 13dfbf2592
2 changed files with 29 additions and 0 deletions

View file

@ -49,6 +49,28 @@ Index: wnet.c
=================================================================== ===================================================================
--- wnet.c (révision 70645) --- wnet.c (révision 70645)
+++ wnet.c (copie de travail) +++ 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 @@ @@ -1553,6 +1553,33 @@
dwFlags, NULL, 0, NULL); dwFlags, NULL, 0, NULL);
} }

View file

@ -750,6 +750,11 @@ DWORD WINAPI WNetOpenEnumW( DWORD dwScope, DWORD dwType, DWORD dwUsage,
providerTable->table[index].dwEnumScopes & WNNC_ENUM_GLOBAL) providerTable->table[index].dwEnumScopes & WNNC_ENUM_GLOBAL)
{ {
HANDLE handle; HANDLE handle;
PVOID RemoteName = lpNet->lpRemoteName;
if ((lpNet->dwUsage & RESOURCEUSAGE_CONTAINER) &&
RemoteName && !strcmpW(RemoteName, lpNet->lpProvider))
lpNet->lpRemoteName = NULL;
ret = providerTable->table[index].openEnum( ret = providerTable->table[index].openEnum(
dwScope, dwType, dwUsage, lpNet, &handle); dwScope, dwType, dwUsage, lpNet, &handle);
@ -760,6 +765,8 @@ DWORD WINAPI WNetOpenEnumW( DWORD dwScope, DWORD dwType, DWORD dwUsage,
ret = *lphEnum ? WN_SUCCESS : ret = *lphEnum ? WN_SUCCESS :
WN_OUT_OF_MEMORY; WN_OUT_OF_MEMORY;
} }
lpNet->lpRemoteName = RemoteName;
} }
else else
ret = WN_NOT_SUPPORTED; ret = WN_NOT_SUPPORTED;