3 using System.Runtime.InteropServices;
5 namespace System.Data.SqlClient
8 class SNINativeMethodWrapper
10 const string msg = "It is native method used by Microsoft System.Data implementation that Mono or non-Windows platform does not support.";
12 public delegate void SqlAsyncCallbackDelegate (IntPtr h, IntPtr h2, uint i);
14 public class ConsumerInfo
16 internal int defaultBufferSize;
18 internal SqlAsyncCallbackDelegate readDelegate;
19 internal SqlAsyncCallbackDelegate writeDelegate;
22 public class SNI_Error
24 internal char [] errorMessage;
25 internal string function;
26 internal int lineNumber;
27 internal uint nativeError;
28 internal ProviderEnum provider;
29 internal int sniError;
37 public enum ConsumerNumber
42 public enum ProviderEnum
50 SNI_QUERY_LOCALDB_HMODULE,
51 SNI_QUERY_CONN_BUFSIZE,
52 SNI_QUERY_CLIENT_ENCRYPT_POSSIBLE,
55 public enum SniSpecialErrors
58 MultiSubnetFailoverWithMoreThan64IPs,
59 MultiSubnetFailoverWithInstanceSpecified,
60 MultiSubnetFailoverWithNonTcpProtocol,
64 public static int SniMaxComposedSpnLength {
65 get { throw new NotSupportedException (msg); }
68 public static uint SNIInitialize ()
70 throw new NotSupportedException (msg);
73 public static uint SNITerminate ()
75 throw new NotSupportedException (msg);
78 public static uint SNISecInitPackage (ref uint maxLength)
80 throw new NotSupportedException (msg);
83 public static uint SNIReadAsync (SafeHandle handle, ref IntPtr data)
85 throw new NotSupportedException (msg);
88 public static uint SNIReadSyncOverAsync (SafeHandle handle, ref IntPtr data, int timeout)
90 throw new NotSupportedException (msg);
93 public static uint SNIOpen (ConsumerInfo info, SafeHandle handle, out IntPtr result, bool b)
95 throw new NotSupportedException (msg);
98 public static uint SNIOpenSyncEx (ConsumerInfo info, string serverName, ref IntPtr handle, byte [] spnBuffer, byte [] instanceName, bool flushCache, bool sync, int timeout, bool parallel)
100 throw new NotSupportedException (msg);
103 public static uint SNICheckConnection (SNIHandle handle)
105 throw new NotSupportedException (msg);
108 public static uint SNIClose (IntPtr result)
110 throw new NotSupportedException (msg);
113 public static uint SNIAddProvider (SafeHandle handle, ProviderEnum e, ref uint result)
115 throw new NotSupportedException (msg);
118 public static uint SNIRemoveProvider (SafeHandle handle, ProviderEnum e)
120 throw new NotSupportedException (msg);
123 public static uint SNISetInfo (SafeHandle handle, QTypes q, ref uint result)
125 throw new NotSupportedException (msg);
128 public static uint SniGetConnectionId (SafeHandle handle, ref System.Guid id)
130 throw new NotSupportedException (msg);
133 public static IntPtr SNIServerEnumOpen ()
135 throw new NotSupportedException (msg);
138 public static void SNIServerEnumClose (IntPtr handle)
140 throw new NotSupportedException (msg);
143 public static int SNIServerEnumRead (IntPtr handle, char [] buffer, int bufferSize, ref bool more)
145 throw new NotSupportedException (msg);
148 public static byte [] GetData ()
150 throw new NotSupportedException (msg);
153 public static void SetData (byte [] buffer)
155 throw new NotSupportedException (msg);
158 public static _AppDomain GetDefaultAppDomain ()
160 throw new NotSupportedException (msg);
163 public static void SNIPacketSetData (SafeHandle handle, byte[] data, int size)
165 throw new NotSupportedException (msg);
168 public static void SNIPacketSetData (SafeHandle handle, byte[] data, int size, SecureString [] securePasswords, int [] securePasswordOffsets)
170 throw new NotSupportedException (msg);
173 public static void SNIPacketReset (SafeHandle handle, IOType io, SafeHandle handle2, ConsumerNumber cn)
175 throw new NotSupportedException (msg);
178 public static uint SNISecGenClientContext (SafeHandle handle, byte [] bytes, uint size, byte[] bytes2, ref uint size2, byte[] bytes3)
180 throw new NotSupportedException (msg);
183 public static void SNIPacketAllocate (SafeHandle handle, IOType io, ref IntPtr result)
185 throw new NotSupportedException (msg);
188 public static void SNIPacketRelease (IntPtr packet)
190 throw new NotSupportedException (msg);
193 public static uint SNIPacketGetData (IntPtr packet, byte [] buffer, ref uint size)
195 throw new NotSupportedException (msg);
198 public static uint SNIWritePacket (SafeHandle handle, SNIPacket packet, bool sync)
200 throw new NotSupportedException (msg);
203 public static void SNIGetLastError (SNI_Error error)
205 throw new NotSupportedException (msg);
208 public static uint SNIOpenMarsSession (ConsumerInfo info, SNIHandle parent, ref IntPtr handle, bool sync)
210 throw new NotSupportedException (msg);
213 public static uint SNIWaitForSSLHandshakeToComplete (SafeHandle handle, int timeout)
215 throw new NotSupportedException (msg);
218 public static uint SNIQueryInfo (QTypes q, ref uint value)
220 throw new NotSupportedException (msg);
223 public static uint SNIQueryInfo (QTypes q, ref IntPtr value)
225 throw new NotSupportedException (msg);