Пример #1
0
 public static uint SNIWritePacket(SniNativeHandle pConn, SniPacket packet, bool sync)
 {
     if (sync)
     {
         return(SNIWriteSyncOverAsync(pConn, packet));
     }
     return(SNIWriteAsyncWrapper(pConn, packet));
 }
Пример #2
0
        public TdsStreamNative(string serverName, int timeout)
        {
            var status = SniLoadHandle.SingletonInstance.SniStatus;

            _sniNativeHandle = new SniNativeHandle(serverName, timeout, out InstanceNameBytes);
            ServerSpn        = Encoding.ASCII.GetString(_sniNativeHandle.SpnBuffer);
            InstanceName     = "";
            _sspi            = new SspiNative(_sniNativeHandle, _sniNativeHandle.SpnBuffer);
            SniNativeMethodWrapper.SniGetConnectionId(_sniNativeHandle, ref _clientConnectionId);
        }
Пример #3
0
 internal static extern unsafe uint SNISecGenClientContextWrapper(
     [In] SniNativeHandle pConn,
     [In][Out] byte[]?pIn,
     uint cbIn,
     [In][Out] byte[] pOut,
     [In] ref uint pcbOut,
     [MarshalAs(UnmanagedType.Bool)] out bool pfDone,
     byte *szServerInfo,
     uint cbServerInfo,
     [MarshalAs(UnmanagedType.LPWStr)] string pwszUserName,
     [MarshalAs(UnmanagedType.LPWStr)] string pwszPassword);
Пример #4
0
 internal static extern void SNIPacketReset([In] SniNativeHandle pConn, IOType IOType, SniPacket pPacket, ConsumerNumber ConsNum);
Пример #5
0
 private static extern uint SNIWriteSyncOverAsync(SniNativeHandle pConn, [In] SniPacket pPacket);
Пример #6
0
 private static extern uint SNIWriteAsyncWrapper(SniNativeHandle pConn, [In] SniPacket pPacket);
Пример #7
0
 private static extern uint SNIGetInfoWrapper([In] SniNativeHandle pConn, QTypes QType, out Guid pbQInfo);
Пример #8
0
 public static extern uint SNIReadSyncOverAsync(SniNativeHandle pConn, ref IntPtr ppNewPacket, int timeout);
Пример #9
0
 public static uint SniGetConnectionId(SniNativeHandle pConn, ref Guid connId) => SNIGetInfoWrapper(pConn, QTypes.SNI_QUERY_CONN_CONNID, out connId);