From 406e7599477c9b94017dc530dde46d88991353b3 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Thu, 1 Dec 2022 09:59:42 -0500 Subject: [PATCH 1/2] Put back setting of field in DirectorySearcher.FindAll This was removed accidentally due to erroneously thinking it was a local rather than a field. --- .../src/System/DirectoryServices/DirectorySearcher.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectorySearcher.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectorySearcher.cs index 1ef524342a335..37f2018d70bc6 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectorySearcher.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectorySearcher.cs @@ -607,6 +607,8 @@ public DirectoryVirtualListView? VirtualListView private SearchResultCollection FindAll(bool findMoreThanOne) { + searchResult = null; + DirectoryEntry clonedRoot = SearchRoot!.CloneBrowsable(); UnsafeNativeMethods.IAds adsObject = clonedRoot.AdsObject; @@ -650,7 +652,9 @@ private SearchResultCollection FindAll(bool findMoreThanOne) properties = Array.Empty(); } - return new SearchResultCollection(clonedRoot, resultsHandle, properties, this); + SearchResultCollection result = new SearchResultCollection(clonedRoot, resultsHandle, properties, this); + searchResult = result; + return result; } private unsafe void SetSearchPreferences(UnsafeNativeMethods.IDirectorySearch adsSearch, bool findMoreThanOne) From d11c7a91de5912900dbcae21fb02e7d8e7f53bb4 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:11:25 -0800 Subject: [PATCH 2/2] OOB package changes. --- .../src/System.DirectoryServices.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj b/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj index 83a118e940de0..1590c8de8b423 100644 --- a/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj +++ b/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj @@ -8,6 +8,8 @@ CA1846: Prefer 'AsSpan' over 'Substring' when span-based overloads are available --> $(NoWarn);CA1845;CA1846;IDE0059;CA1822 true + true + 1 true true Provides easy access to Active Directory Domain Services.