Merge pull request #3389 from lambdageek/bug-43099
[mono.git] / mcs / class / System.Data / ReferenceSources / SNINativeMethodWrapper.cs
1 using System;
2 using System.Security;
3 using System.Runtime.InteropServices;
4
5 namespace System.Data.SqlClient
6 {
7
8         class SNINativeMethodWrapper
9         {
10                 const string msg = "It is native method used by Microsoft System.Data implementation that Mono or non-Windows platform does not support.";
11
12                 public delegate void SqlAsyncCallbackDelegate (IntPtr h, IntPtr h2, uint i);
13
14                 public class ConsumerInfo
15                 {
16                         internal int defaultBufferSize;
17                         internal IntPtr key;
18                         internal SqlAsyncCallbackDelegate readDelegate;
19                         internal SqlAsyncCallbackDelegate writeDelegate;
20                 }
21                 
22                 public class SNI_Error
23                 {
24                         internal char [] errorMessage;
25                         internal string function;
26                         internal int lineNumber;
27                         internal uint nativeError;
28                         internal ProviderEnum provider;
29                         internal int sniError;
30                 }
31                 
32                 public enum IOType
33                 {
34                         WRITE
35                 }
36                 
37                 public enum ConsumerNumber
38                 {
39                         SNI_Consumer_SNI
40                 }
41                 
42                 public enum ProviderEnum
43                 {
44                         SMUX_PROV,
45                         SSL_PROV,
46                 }
47                 
48                 public enum QTypes
49                 {
50                         SNI_QUERY_LOCALDB_HMODULE,
51                         SNI_QUERY_CONN_BUFSIZE,
52                         SNI_QUERY_CLIENT_ENCRYPT_POSSIBLE,
53                 }
54                 
55                 public enum SniSpecialErrors
56                 {
57                         LocalDBErrorCode,
58                         MultiSubnetFailoverWithMoreThan64IPs,
59                         MultiSubnetFailoverWithInstanceSpecified,
60                         MultiSubnetFailoverWithNonTcpProtocol,
61                         MaxErrorValue,
62                 }
63                 
64                 public static int SniMaxComposedSpnLength {
65                         get { throw new NotSupportedException (msg); }
66                 }
67                 
68                 public static uint SNIInitialize ()
69                 {
70                         throw new NotSupportedException (msg);
71                 }
72                 
73                 public static uint SNITerminate ()
74                 {
75                         throw new NotSupportedException (msg);
76                 }
77
78                 public static uint SNISecInitPackage (ref uint maxLength)
79                 {
80                         throw new NotSupportedException (msg);
81                 }
82                 
83                 public static uint SNIReadAsync (SafeHandle handle, ref IntPtr data)
84                 {
85                         throw new NotSupportedException (msg);
86                 }
87                 
88                 public static uint SNIReadSyncOverAsync (SafeHandle handle, ref IntPtr data, int timeout)
89                 {
90                         throw new NotSupportedException (msg);
91                 }
92                 
93                 public static uint SNIOpen (ConsumerInfo info, SafeHandle handle, out IntPtr result, bool b)
94                 {
95                         throw new NotSupportedException (msg);
96                 }
97                 
98                 public static uint SNIOpenSyncEx (ConsumerInfo info, string serverName, ref IntPtr handle, byte [] spnBuffer, byte [] instanceName, bool flushCache, bool sync, int timeout, bool parallel)
99                 {
100                         throw new NotSupportedException (msg);
101                 }
102                 
103                 public static uint SNICheckConnection (SNIHandle handle)
104                 {
105                         throw new NotSupportedException (msg);
106                 }
107                 
108                 public static uint SNIClose (IntPtr result)
109                 {
110                         throw new NotSupportedException (msg);
111                 }
112                 
113                 public static uint SNIAddProvider (SafeHandle handle, ProviderEnum e, ref uint result)
114                 {
115                         throw new NotSupportedException (msg);
116                 }
117                         
118                 public static uint SNIRemoveProvider (SafeHandle handle, ProviderEnum e)
119                 {
120                         throw new NotSupportedException (msg);
121                 }
122                 
123                 public static uint SNISetInfo (SafeHandle handle, QTypes q, ref uint result)
124                 {
125                         throw new NotSupportedException (msg);
126                 }
127                 
128                 public static uint SniGetConnectionId (SafeHandle handle, ref System.Guid id)
129                 {
130                         throw new NotSupportedException (msg);
131                 }
132                 
133                 public static IntPtr SNIServerEnumOpen ()
134                 {
135                         throw new NotSupportedException (msg);
136                 }
137                 
138                 public static void SNIServerEnumClose (IntPtr handle)
139                 {
140                         throw new NotSupportedException (msg);
141                 }
142                 
143                 public static int SNIServerEnumRead (IntPtr handle, char [] buffer, int bufferSize, ref bool more)
144                 {
145                         throw new NotSupportedException (msg);
146                 }
147                 
148                 public static byte [] GetData ()
149                 {
150                         throw new NotSupportedException (msg);
151                 }
152                 
153                 public static void SetData (byte [] buffer)
154                 {
155                         throw new NotSupportedException (msg);
156                 }
157                 
158                 public static _AppDomain GetDefaultAppDomain ()
159                 {
160                         throw new NotSupportedException (msg);
161                 }
162
163                 public static void SNIPacketSetData (SafeHandle handle, byte[] data, int size)
164                 {
165                         throw new NotSupportedException (msg);
166                 }
167                 
168                 public static void SNIPacketSetData (SafeHandle handle, byte[] data, int size, SecureString [] securePasswords, int [] securePasswordOffsets)
169                 {
170                         throw new NotSupportedException (msg);
171                 }
172                 
173                 public static void SNIPacketReset (SafeHandle handle, IOType io, SafeHandle handle2, ConsumerNumber cn)
174                 {
175                         throw new NotSupportedException (msg);
176                 }
177                 
178                 public static uint SNISecGenClientContext (SafeHandle handle, byte [] bytes, uint size, byte[] bytes2, ref uint size2, byte[] bytes3)
179                 {
180                         throw new NotSupportedException (msg);
181                 }
182                 
183                 public static void SNIPacketAllocate (SafeHandle handle, IOType io, ref IntPtr result)
184                 {
185                         throw new NotSupportedException (msg);
186                 }
187                 
188                 public static void SNIPacketRelease (IntPtr packet)
189                 {
190                         throw new NotSupportedException (msg);
191                 }
192                 
193                 public static uint SNIPacketGetData (IntPtr packet, byte [] buffer, ref uint size)
194                 {
195                         throw new NotSupportedException (msg);
196                 }
197                 
198                 public static uint SNIWritePacket (SafeHandle handle, SNIPacket packet, bool sync)
199                 {
200                         throw new NotSupportedException (msg);
201                 }
202                 
203                 public static void SNIGetLastError (SNI_Error error)
204                 {
205                         throw new NotSupportedException (msg);
206                 }
207                 
208                 public static uint SNIOpenMarsSession (ConsumerInfo info, SNIHandle parent, ref IntPtr handle, bool sync)
209                 {
210                         throw new NotSupportedException (msg);
211                 }
212
213                 public static uint SNIWaitForSSLHandshakeToComplete (SafeHandle handle, int timeout)
214                 {
215                         throw new NotSupportedException (msg);
216                 }
217                 
218                 public static uint SNIQueryInfo (QTypes q, ref uint value)
219                 {
220                         throw new NotSupportedException (msg);
221                 }
222                 
223                 public static uint SNIQueryInfo (QTypes q, ref IntPtr value)
224                 {
225                         throw new NotSupportedException (msg);
226                 }
227         }
228 }