Skip to content
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] Switch away from setting CallingConvention field on GeneratedDllImport #61130

Merged
merged 1 commit into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@ internal static partial class Interop
{
internal static partial class Advapi32
{
#if DLLIMPORTGENERATOR_ENABLED
[GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertSecurityDescriptorToStringSecurityDescriptorW",
CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
internal static partial bool ConvertSdToStringSd(
#else
[DllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertSecurityDescriptorToStringSecurityDescriptorW",
CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
internal static extern bool ConvertSdToStringSd(
#endif
byte[] securityDescriptor,
/* DWORD */ uint requestedRevision,
uint securityInformation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@ internal static partial class Interop
{
internal static partial class Advapi32
{
#if DLLIMPORTGENERATOR_ENABLED
[GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW",
CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
internal static partial bool ConvertStringSdToSd(
#else
[DllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSecurityDescriptorToSecurityDescriptorW",
CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
internal static extern bool ConvertStringSdToSd(
#endif
string stringSd,
/* DWORD */ uint stringSdRevision,
out IntPtr resultSd,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,8 @@ internal static partial class Interop
{
internal static partial class Advapi32
{
#if DLLIMPORTGENERATOR_ENABLED
[GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "SetSecurityInfo", CallingConvention = CallingConvention.Winapi,
CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
[GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "SetSecurityInfo", ExactSpelling = true, SetLastError = true)]
internal static partial uint SetSecurityInfoByHandle(
#else
[DllImport(Interop.Libraries.Advapi32, EntryPoint = "SetSecurityInfo", CallingConvention = CallingConvention.Winapi,
CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
internal static extern /*DWORD*/ uint SetSecurityInfoByHandle(
#endif
SafeHandle handle,
/*DWORD*/ uint objectType,
/*DWORD*/ uint securityInformation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@ internal static partial class Interop
{
internal static partial class Advapi32
{
#if DLLIMPORTGENERATOR_ENABLED
[GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "SetNamedSecurityInfoW", CallingConvention = CallingConvention.Winapi,
[GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "SetNamedSecurityInfoW",
CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
internal static partial uint SetSecurityInfoByName(
#else
[DllImport(Interop.Libraries.Advapi32, EntryPoint = "SetNamedSecurityInfoW", CallingConvention = CallingConvention.Winapi,
CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
internal static extern /*DWORD*/ uint SetSecurityInfoByName(
#endif
string name,
/*DWORD*/ uint objectType,
/*DWORD*/ uint securityInformation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
<Reference Include="System.Memory" Condition="'$(TargetsWindows)' == 'true'" />
<Reference Include="System.Resources.ResourceManager" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" Condition="'$(TargetsWindows)' == 'true'" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.Handles" />
<Reference Include="System.Runtime.InteropServices" Condition="'$(TargetsWindows)' == 'true'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<Reference Include="System.Memory" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Thread" />
Expand Down