-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix incorrect definition of LSA_FOREST_TRUST_RECORD in System.DirectoryServices #68274
Conversation
Tagging subscribers to this area: @dotnet/area-system-directoryservices, @jay98014 Issue DetailsFixes #68240 Added a test that just loads all types in Manually ran: Forest forest = Forest.GetCurrentForest();
foreach (var t in forest.GetAllTrustRelationships())
{
if (t is ForestTrustRelationshipInformation f)
{
Console.WriteLine("TopLevelNames");
foreach (var name in f.TopLevelNames)
{
Console.WriteLine($" {((TopLevelName)name).Name}");
}
Console.WriteLine("ExcludedTopLevelNames");
foreach (string name in f.ExcludedTopLevelNames)
{
Console.WriteLine($" {name}");
}
Console.WriteLine("TrustedDomainInformation");
foreach (var info in f.TrustedDomainInformation)
{
Console.WriteLine($" {((ForestTrustDomainInformation)info).DnsName}");
}
}
}
|
...System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/UnsafeNativeMethods.cs
Outdated
Show resolved
Hide resolved
...yServices/src/System/DirectoryServices/ActiveDirectory/ForestTrustRelationshipInformation.cs
Outdated
Show resolved
Hide resolved
[Fact] | ||
public void TestGetAllTypes() | ||
{ | ||
Type[] allTypes = typeof(DirectoryEntry).Assembly.GetTypes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether it would be possible (later) to write a test that did this for each of our implementation assemblies, without actually pasting in the test into every one.
Something like - a common file that was included in all test assemblies, with a test that enumerated all loaded assemblies and did GetTypes on them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened #68341 to track trying to do something like this.
Fixes #68240
Switch
LSA_FOREST_TRUST_DOMAIN_INFO
andLSA_FOREST_TRUST_BINARY_DATA
to be structs as well.Added a test that just loads all types in
System.DirectoryServices
.Manually ran:
cc @AaronRobinsonMSFT @jkoritzinsky I broke this back in December when we were switching things to the p/invoke source generator