From faec978ad51bb6189868b646ce868d58d0ec0ea6 Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Wed, 1 Jun 2011 12:36:46 -0400 Subject: [PATCH] [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. --- dll/nfs41_np.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dll/nfs41_np.c b/dll/nfs41_np.c index be75070..b0019e0 100644 --- a/dll/nfs41_np.c +++ b/dll/nfs41_np.c @@ -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++; }