SNINativeMethodWrapper.cs 5.4 KB

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