-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[DllImportGenerator] Remove unnecessary DLLIMPORTGENERATOR_ENABLED ifdefs #61345
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,8 @@ internal static partial class Interop | |
{ | ||
internal static partial class Advapi32 | ||
{ | ||
#if DLLIMPORTGENERATOR_ENABLED | ||
[GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetWindowsAccountDomainSid", CharSet = CharSet.Unicode, SetLastError = true)] | ||
[GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetWindowsAccountDomainSid", SetLastError = true)] | ||
internal static partial int GetWindowsAccountDomainSid( | ||
#else | ||
[DllImport(Interop.Libraries.Advapi32, EntryPoint = "GetWindowsAccountDomainSid", CharSet = CharSet.Unicode, SetLastError = true)] | ||
internal static extern int GetWindowsAccountDomainSid( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have an analyzer that warns when specifying a CharSet and it's a nop? I assume that's how you spotted these? But if that's the case, why wasn't it previously firing for this #if case? Or is it just a suggestion right now that doesn't trigger warn-as-error build failures? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't. I just did a quick scan through the changes I had and manually updated a few things. |
||
#endif | ||
byte[] sid, | ||
byte[] resultSid, | ||
ref uint resultSidLength); | ||
|
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.
Was the addition of ExactSpelling here just an opportunistic addition? Should we be using it in other places we're not currently
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.
Yeah, this was just opportunistic - I just noticed that already had the
W
suffix while doing this.