-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Refactor interop usage in DirectoryServices #51325
Conversation
FYI: The motivation for these changes is to remove cruft and provide a clearer picture of what dependencies libraries have. This is to support the work that is going on for dotnet/core#5651. |
src/libraries/System.DirectoryServices/src/System/DirectoryServices/ExternDll.cs
Outdated
Show resolved
Hide resolved
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.
public static extern unsafe int ADsGetLastError(out int error, char* errorBuffer, int errorBufferLength, char* nameBuffer, int nameBufferLength); | ||
|
||
[DllImport(ExternDll.Activeds, CharSet = CharSet.Unicode)] | ||
[DllImport(global::Interop.Libraries.Activeds, CharSet = CharSet.Unicode)] |
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.
Why are all these global::
s necessary? Is there some kind of naming conflict this is working around?
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.
Is there some kind of naming conflict this is working around?
Yes, there is an Interop
namespace in this project.
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.
Ah, I see, the System.DirectoryServices.Interop
namespace. Presumably once we clean up the rest of the interop we can remove the "global::".
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.
Thanks for the clean up.
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.
Thanks so much for taking care of this @mthalman!
This is a partial implementation to more closely conform to the interop guidelines.
The goals here were the following:
[DllImport]
.