Skip to content

Commit 320f1e1

Browse files
authored
Put back setting of field in DirectorySearcher.FindAll (#79093)
This was removed accidentally due to erroneously thinking it was a local rather than a field.
1 parent 776a87d commit 320f1e1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectorySearcher.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,8 @@ public DirectoryVirtualListView? VirtualListView
607607

608608
private SearchResultCollection FindAll(bool findMoreThanOne)
609609
{
610+
searchResult = null;
611+
610612
DirectoryEntry clonedRoot = SearchRoot!.CloneBrowsable();
611613

612614
UnsafeNativeMethods.IAds adsObject = clonedRoot.AdsObject;
@@ -650,7 +652,9 @@ private SearchResultCollection FindAll(bool findMoreThanOne)
650652
properties = Array.Empty<string>();
651653
}
652654

653-
return new SearchResultCollection(clonedRoot, resultsHandle, properties, this);
655+
SearchResultCollection result = new SearchResultCollection(clonedRoot, resultsHandle, properties, this);
656+
searchResult = result;
657+
return result;
654658
}
655659

656660
private unsafe void SetSearchPreferences(UnsafeNativeMethods.IDirectorySearch adsSearch, bool findMoreThanOne)

0 commit comments

Comments
 (0)