[dll] fixing drive enumeration

setacl tool was calling into our dll to enumerate mounted drives. the
index was not updated after we returned the results and caused an
infinite loop.
This commit is contained in:
Olga Kornievskaia 2011-06-01 12:36:46 -04:00
parent bb8de9c266
commit faec978ad5

View file

@ -780,7 +780,8 @@ NPEnumResource(
if ( Status == WN_SUCCESS)
{
Status = WN_NO_MORE_ENTRIES;
for (Index = *(PULONG)hEnum; Index < pSharedMemory->NextAvailableIndex; Index++)
for (Index = *(PULONG)hEnum; EntriesCopied < *lpcCount &&
Index < pSharedMemory->NextAvailableIndex; Index++)
{
pNfsNetResource = &pSharedMemory->NetResources[Index];
@ -834,13 +835,9 @@ NPEnumResource(
StringCbCopyW( StringZone, sizeof(NFS41_PROVIDER_NAME_U), NFS41_PROVIDER_NAME_U );
StringZone += sizeof(NFS41_PROVIDER_NAME_U)/sizeof(WCHAR);
EntriesCopied++;
if(EntriesCopied >= *lpcCount)
{
Status = WN_SUCCESS;
break;
}
// set new bottom of string zone
StringZone = (PWCHAR)( (PBYTE) StringZone - SpaceNeeded );
Status = WN_SUCCESS;
}
pNetResource++;
}