private 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,
     [In] ref SNI_DNSCache_Info pDNSCachedInfo);
示例#2
0
 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);
示例#3
0
        internal static unsafe uint SNIOpenMarsSession(ConsumerInfo consumerInfo, SNIHandle parent, ref IntPtr pConn, bool fSync)
        {
            // initialize consumer info for MARS
            Sni_Consumer_Info native_consumerInfo = new Sni_Consumer_Info();

            MarshalConsumerInfo(consumerInfo, ref native_consumerInfo);

            return(SNIOpenWrapper(ref native_consumerInfo, "session:", parent, out pConn, fSync));
        }
示例#4
0
 private static void MarshalConsumerInfo(ConsumerInfo consumerInfo, ref Sni_Consumer_Info native_consumerInfo)
 {
     native_consumerInfo.DefaultUserDataLength = consumerInfo.defaultBufferSize;
     native_consumerInfo.fnReadComp            = null != consumerInfo.readDelegate
         ? Marshal.GetFunctionPointerForDelegate(consumerInfo.readDelegate)
         : IntPtr.Zero;
     native_consumerInfo.fnWriteComp = null != consumerInfo.writeDelegate
         ? Marshal.GetFunctionPointerForDelegate(consumerInfo.writeDelegate)
         : IntPtr.Zero;
     native_consumerInfo.ConsumerKey = consumerInfo.key;
 }
示例#5
0
 private static uint SNIOpenWrapper(
     [In] ref Sni_Consumer_Info pConsumerInfo,
     [MarshalAs(UnmanagedType.LPWStr)] string szConnect,
     [In] SNIHandle pConn,
     out IntPtr ppConn,
     [MarshalAs(UnmanagedType.Bool)] bool fSync)
 {
     return(s_is64bitProcess ?
            SNINativeManagedWrapperX64.SNIOpenWrapper(ref pConsumerInfo, szConnect, pConn, out ppConn, fSync) :
            SNINativeManagedWrapperX86.SNIOpenWrapper(ref pConsumerInfo, szConnect, pConn, out ppConn, fSync));
 }
 private static 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)
 {
     return(s_is64bitProcess ?
            SNINativeManagedWrapperX64.SNIOpenWrapper(ref pConsumerInfo, szConnect, pConn, out ppConn, fSync, ipPreference, ref pDNSCachedInfo) :
            SNINativeManagedWrapperX86.SNIOpenWrapper(ref pConsumerInfo, szConnect, pConn, out ppConn, fSync, ipPreference, ref pDNSCachedInfo));
 }
        internal static unsafe uint SNIOpenMarsSession(ConsumerInfo consumerInfo, SNIHandle parent, ref IntPtr pConn, bool fSync, SqlConnectionIPAddressPreference ipPreference, SQLDNSInfo cachedDNSInfo)
        {
            // initialize consumer info for MARS
            Sni_Consumer_Info native_consumerInfo = new Sni_Consumer_Info();

            MarshalConsumerInfo(consumerInfo, ref native_consumerInfo);

            SNI_DNSCache_Info native_cachedDNSInfo = new SNI_DNSCache_Info();

            native_cachedDNSInfo.wszCachedFQDN    = cachedDNSInfo?.FQDN;
            native_cachedDNSInfo.wszCachedTcpIPv4 = cachedDNSInfo?.AddrIPv4;
            native_cachedDNSInfo.wszCachedTcpIPv6 = cachedDNSInfo?.AddrIPv6;
            native_cachedDNSInfo.wszCachedTcpPort = cachedDNSInfo?.Port;

            return(SNIOpenWrapper(ref native_consumerInfo, "session:", parent, out pConn, fSync, ipPreference, ref native_cachedDNSInfo));
        }
 private static void MarshalConsumerInfo(ConsumerInfo consumerInfo, ref Sni_Consumer_Info native_consumerInfo)
 {
     native_consumerInfo.DefaultUserDataLength = consumerInfo.defaultBufferSize;
     native_consumerInfo.fnReadComp = null != consumerInfo.readDelegate
         ? Marshal.GetFunctionPointerForDelegate(consumerInfo.readDelegate)
         : IntPtr.Zero;
     native_consumerInfo.fnWriteComp = null != consumerInfo.writeDelegate
         ? Marshal.GetFunctionPointerForDelegate(consumerInfo.writeDelegate)
         : IntPtr.Zero;
     native_consumerInfo.ConsumerKey = consumerInfo.key;
 }
        internal static unsafe uint SNIOpenMarsSession(ConsumerInfo consumerInfo, SNIHandle parent, ref IntPtr pConn, bool fSync)
        {
            // initialize consumer info for MARS
            Sni_Consumer_Info native_consumerInfo = new Sni_Consumer_Info();
            MarshalConsumerInfo(consumerInfo, ref native_consumerInfo);

            return SNIOpenWrapper(ref native_consumerInfo, "session:", parent, out pConn, fSync);
        }