-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hotfix [3.1.2] | Backport ARM 64 support (#1908)
Hotfix [3.1.2] | Backport ARM 64 support #1908
- Loading branch information
1 parent
7a12115
commit b9671e8
Showing
18 changed files
with
596 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
150 changes: 150 additions & 0 deletions
150
...Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/Interop/SNINativeManagedWrapperARM64.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
using static Microsoft.Data.SqlClient.SNINativeMethodWrapper; | ||
|
||
namespace Microsoft.Data.SqlClient | ||
{ | ||
internal static class SNINativeManagedWrapperARM64 | ||
{ | ||
private const string SNI = "Microsoft.Data.SqlClient.SNI.arm64.dll"; | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIAddProviderWrapper")] | ||
internal static extern uint SNIAddProvider(SNIHandle pConn, ProviderEnum ProvNum, [In] ref uint pInfo); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIAddProviderWrapper")] | ||
internal static extern uint SNIAddProviderWrapper(SNIHandle pConn, ProviderEnum ProvNum, [In] ref SNICTAIPProviderInfo pInfo); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIAddProviderWrapper")] | ||
internal static extern uint SNIAddProviderWrapper(SNIHandle pConn, ProviderEnum ProvNum, [In] ref AuthProviderInfo pInfo); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNICheckConnectionWrapper")] | ||
internal static extern uint SNICheckConnection([In] SNIHandle pConn); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNICloseWrapper")] | ||
internal static extern uint SNIClose(IntPtr pConn); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern void SNIGetLastError(out SNI_Error pErrorStruct); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern void SNIPacketRelease(IntPtr pPacket); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIPacketResetWrapper")] | ||
internal static extern void SNIPacketReset([In] SNIHandle pConn, IOType IOType, SNIPacket pPacket, ConsumerNumber ConsNum); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNIQueryInfo(QTypes QType, ref uint pbQInfo); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNIQueryInfo(QTypes QType, ref IntPtr pbQInfo); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIReadAsyncWrapper")] | ||
internal static extern uint SNIReadAsync(SNIHandle pConn, ref IntPtr ppNewPacket); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNIReadSyncOverAsync(SNIHandle pConn, ref IntPtr ppNewPacket, int timeout); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIRemoveProviderWrapper")] | ||
internal static extern uint SNIRemoveProvider(SNIHandle pConn, ProviderEnum ProvNum); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNISecInitPackage(ref uint pcbMaxToken); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNISetInfoWrapper")] | ||
internal static extern uint SNISetInfo(SNIHandle pConn, QTypes QType, [In] ref uint pbQInfo); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNITerminate(); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIWaitForSSLHandshakeToCompleteWrapper")] | ||
internal static extern uint SNIWaitForSSLHandshakeToComplete([In] SNIHandle pConn, int dwMilliseconds, out uint pProtocolVersion); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint UnmanagedIsTokenRestricted([In] IntPtr token, [MarshalAs(UnmanagedType.Bool)] out bool isRestricted); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint GetSniMaxComposedSpnLength(); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, out Guid pbQInfo); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, [MarshalAs(UnmanagedType.Bool)] out bool pbQInfo); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, ref IntPtr pbQInfo); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, out ushort portNum); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)] | ||
internal static extern uint SNIGetPeerAddrStrWrapper([In] SNIHandle pConn, int bufferSize, StringBuilder addrBuffer, out uint addrLen); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, out ProviderEnum provNum); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIInitialize")] | ||
internal static extern uint SNIInitialize([In] IntPtr pmo); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNIOpenSyncExWrapper(ref SNI_CLIENT_CONSUMER_INFO pClientConsumerInfo, out IntPtr ppConn); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNIOpenWrapper( | ||
[In] ref Sni_Consumer_Info pConsumerInfo, | ||
[MarshalAs(UnmanagedType.LPWStr)] string szConnect, | ||
[In] SNIHandle pConn, | ||
out IntPtr ppConn, | ||
[MarshalAs(UnmanagedType.Bool)] bool fSync, | ||
SqlConnectionIPAddressPreference ipPreference, | ||
[In] ref SNI_DNSCache_Info pDNSCachedInfo); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern IntPtr SNIPacketAllocateWrapper([In] SafeHandle pConn, IOType IOType); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNIPacketGetDataWrapper([In] IntPtr packet, [In, Out] byte[] readBuffer, uint readBufferLength, out uint dataSize); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern unsafe void SNIPacketSetData(SNIPacket pPacket, [In] byte* pbBuf, uint cbBuf); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNISecGenClientContextWrapper")] | ||
internal static extern unsafe uint SNISecGenClientContextWrapper( | ||
[In] SNIHandle pConn, | ||
[In, Out] byte[] pIn, | ||
uint cbIn, | ||
[In, Out] byte[] pOut, | ||
[In] ref uint pcbOut, | ||
[MarshalAsAttribute(UnmanagedType.Bool)] out bool pfDone, | ||
byte* szServerInfo, | ||
uint cbServerInfo, | ||
[MarshalAsAttribute(UnmanagedType.LPWStr)] string pwszUserName, | ||
[MarshalAsAttribute(UnmanagedType.LPWStr)] string pwszPassword); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNIWriteAsyncWrapper(SNIHandle pConn, [In] SNIPacket pPacket); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern uint SNIWriteSyncOverAsync(SNIHandle pConn, [In] SNIPacket pPacket); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern IntPtr SNIClientCertificateFallbackWrapper(IntPtr pCallbackContext); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIServerEnumOpenWrapper")] | ||
internal static extern IntPtr SNIServerEnumOpen(); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIServerEnumCloseWrapper")] | ||
internal static extern void SNIServerEnumClose([In] IntPtr packet); | ||
|
||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIServerEnumReadWrapper", CharSet = CharSet.Unicode)] | ||
internal static extern int SNIServerEnumRead([In] IntPtr packet, | ||
[In, Out][MarshalAs(UnmanagedType.LPArray)] char[] readBuffer, | ||
[In] int bufferLength, | ||
[MarshalAs(UnmanagedType.Bool)] out bool more); | ||
} | ||
} |
Oops, something went wrong.