2 writes to _physicalStateObj
System.Data (2)
fx\src\data\System\Data\SqlClient\TdsParser.cs (2)
266_physicalStateObj = new TdsParserStateObject(this); 633_physicalStateObj = CreateSession(); // Create and open default MARS stateObj and connection.
274 references to _physicalStateObj
System.Data (274)
fx\src\data\System\Data\SqlClient\SqlConnection.cs (3)
1163if ((parser != null) && (parser._physicalStateObj != null)) { 1164parser._physicalStateObj.DecrementPendingCallbacks(release: false); 1287TdsParserStateObject stateObj = tdsConn.Parser._physicalStateObj;
fx\src\data\System\Data\SqlClient\SqlInternalConnectionTds.cs (29)
578return (!Parser.MARSOn && Parser._physicalStateObj.BcpLock); 671Threading.Tasks.Task executeTask = _parser.TdsExecuteSQLBatch("use " + database, ConnectionOptions.ConnectTimeout, null, _parser._physicalStateObj, sync: true); 673_parser.Run(RunBehavior.UntilDone, null, null, null, _parser._physicalStateObj); 721else if (!parser.MARSOn && parser._physicalStateObj._pendingData) { 722parser.DrainData(parser._physicalStateObj); 724Debug.Assert(!parser._physicalStateObj._pendingData, "Should not have a busy physicalStateObject at this point!"); 801isAlive = _parser._physicalStateObj.IsConnectionAlive(throwOnException); 873Debug.Assert(!_parser._physicalStateObj._pendingData, "Upon ResetConnection SqlInternalConnectionTds has pending data."); 888Threading.Tasks.Task executeTask = _parser.TdsExecuteSQLBatch("sp_reset_connection", 30, null, _parser._physicalStateObj, sync: true); 890_parser.Run(RunBehavior.UntilDone, null, null, null, _parser._physicalStateObj); 947if (!Parser.MARSOn && Parser._physicalStateObj.BcpLock) { 1032Threading.Tasks.Task executeTask = _parser.TdsExecuteSQLBatch(sqlBatch.ToString(), ConnectionOptions.ConnectTimeout, null, _parser._physicalStateObj, sync: true); 1034_parser.Run(RunBehavior.UntilDone, null, null, null, _parser._physicalStateObj); 1081TdsParserStateObject stateObj = _parser._physicalStateObj; 1193_parser.PropagateDistributedTransaction(cookie, ConnectionOptions.ConnectTimeout, _parser._physicalStateObj); 1201_parser.Run(RunBehavior.UntilDone, null, null, null, _parser._physicalStateObj); 1236Debug.Assert(SniContext.Snix_Login == Parser._physicalStateObj.SniContext, String.Format((IFormatProvider)null, "SniContext should be Snix_Login; actual Value: {0}", Parser._physicalStateObj.SniContext)); 1237_parser._physicalStateObj.SniContext = SniContext.Snix_EnableMars; 1249_parser._physicalStateObj.SniContext = SniContext.Snix_AutoEnlist; 1253_parser._physicalStateObj.SniContext=SniContext.Snix_Login; 1542Debug.Assert(SniContext.Undefined== Parser._physicalStateObj.SniContext, String.Format((IFormatProvider)null, "SniContext should be Undefined; actual Value: {0}", Parser._physicalStateObj.SniContext)); 1781Debug.Assert(SniContext.Undefined== Parser._physicalStateObj.SniContext, String.Format((IFormatProvider)null, "SniContext should be Undefined; actual Value: {0}", Parser._physicalStateObj.SniContext)); 1830Debug.Assert(SniContext.Undefined == Parser._physicalStateObj.SniContext, String.Format((IFormatProvider)null, "SniContext should be Undefined; actual Value: {0}", Parser._physicalStateObj.SniContext)); 1962_parser._physicalStateObj.SniContext = SniContext.Snix_Connect; 1980_parser._physicalStateObj.SniContext = SniContext.Snix_Login;
fx\src\data\System\Data\SqlClient\TdsParser.cs (234)
417_physicalStateObj.AddError(ProcessSNIError(_physicalStateObj)); 418_physicalStateObj.Dispose(); 419ThrowExceptionAndWarning(_physicalStateObj); 470_physicalStateObj.CreatePhysicalSNIHandle(serverInfo.ExtendedServerName, ignoreSniOpenTimeout, timerExpire, 473if (TdsEnums.SNI_SUCCESS != _physicalStateObj.Status) { 474_physicalStateObj.AddError(ProcessSNIError(_physicalStateObj)); 480_physicalStateObj.Dispose(); 482ThrowExceptionAndWarning(_physicalStateObj); 498_physicalStateObj.SniContext = SniContext.Snix_PreLoginBeforeSuccessfullWrite; // SQL BU DT 376766 499_physicalStateObj.TimeoutTime = timerExpire; 506UInt32 result = SNINativeMethodWrapper.SniGetConnectionId(_physicalStateObj.Handle, ref _connHandler._clientConnectionId); 516_physicalStateObj.SniContext = SniContext.Snix_PreLogin; 524_physicalStateObj.Dispose(); // Close previous connection 527_physicalStateObj.SniContext=SniContext.Snix_Connect; 528_physicalStateObj.CreatePhysicalSNIHandle(serverInfo.ExtendedServerName, ignoreSniOpenTimeout, timerExpire, out instanceName, _sniSpnBuffer, true, true, fParallel, transparentNetworkResolutionState, totalTimeout); 530if (TdsEnums.SNI_SUCCESS != _physicalStateObj.Status) { 531_physicalStateObj.AddError(ProcessSNIError(_physicalStateObj)); 533ThrowExceptionAndWarning(_physicalStateObj); 536UInt32 retCode = SNINativeMethodWrapper.SniGetConnectionId(_physicalStateObj.Handle, ref _connHandler._clientConnectionId); 581error = SNINativeMethodWrapper.SNIRemoveProvider(_physicalStateObj.Handle, SNINativeMethodWrapper.ProviderEnum.SSL_PROV); 583_physicalStateObj.AddError(ProcessSNIError(_physicalStateObj)); 584ThrowExceptionAndWarning(_physicalStateObj); 589_physicalStateObj.ClearAllWritePackets(); 596_pMarsPhysicalConObj = _physicalStateObj; 605_physicalStateObj.AddError(ProcessSNIError(_physicalStateObj)); 606ThrowExceptionAndWarning(_physicalStateObj); 629_physicalStateObj.AddError(ProcessSNIError(_physicalStateObj)); 630ThrowExceptionAndWarning(_physicalStateObj); 659session = _physicalStateObj; 677Debug.Assert(session == _physicalStateObj, "MARS is off, but session to close is not the _physicalStateObj"); 678_physicalStateObj.SniContext = SniContext.Snix_Close; 682_physicalStateObj.Dispose(); 686_physicalStateObj.Owner = null; 694var stateObj = _physicalStateObj; 727_physicalStateObj._outputMessageType = TdsEnums.MT_PRELOGIN; 743_physicalStateObj.WriteByte((byte)option); 746_physicalStateObj.WriteByte((byte)((offset & 0xff00) >> 8)); // send upper order byte 747_physicalStateObj.WriteByte((byte)(offset & 0x00ff)); // send lower order byte 858_physicalStateObj.WriteByte((byte)((optionDataSize & 0xff00) >> 8)); 859_physicalStateObj.WriteByte((byte)(optionDataSize & 0x00ff)); 863_physicalStateObj.WriteByte((byte)PreLoginOptions.LASTOPT); 866_physicalStateObj.WriteByteArray(payload, payloadLength, 0); 869_physicalStateObj.WritePacket(TdsEnums.HARDFLUSH); 880Debug.Assert(_physicalStateObj._syncOverAsync, "Should not attempt pends in a synchronous call"); 881bool result = _physicalStateObj.TryReadNetworkPacket(); 884if (_physicalStateObj._inBytesRead == 0) { 886_physicalStateObj.AddError(new SqlError(0, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, _server, SQLMessage.PreloginError(), "", 0)); 887_physicalStateObj.Dispose(); 888ThrowExceptionAndWarning(_physicalStateObj); 891if (!_physicalStateObj.TryProcessHeader()) { throw SQL.SynchronousCallMayNotPend(); } 893if (_physicalStateObj._inBytesPacket > TdsEnums.MAX_PACKET_SIZE || _physicalStateObj._inBytesPacket <= 0) { 896byte[] payload = new byte[_physicalStateObj._inBytesPacket]; 898Debug.Assert(_physicalStateObj._syncOverAsync, "Should not attempt pends in a synchronous call"); 899result = _physicalStateObj.TryReadByteArray(payload, 0, payload.Length); 948_physicalStateObj.AddError(new SqlError(TdsEnums.ENCRYPTION_NOT_SUPPORTED, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, _server, SQLMessage.EncryptionNotSupportedByServer(), "", 0)); 949_physicalStateObj.Dispose(); 950ThrowExceptionAndWarning(_physicalStateObj); 969_physicalStateObj.AddError(new SqlError(TdsEnums.ENCRYPTION_NOT_SUPPORTED, (byte)0x00, TdsEnums.FATAL_ERROR_CLASS, _server, SQLMessage.EncryptionNotSupportedByClient(), "", 0)); 970_physicalStateObj.Dispose(); 971ThrowExceptionAndWarning(_physicalStateObj); 1000error = SNINativeMethodWrapper.SNIAddProvider(_physicalStateObj.Handle, SNINativeMethodWrapper.ProviderEnum.SSL_PROV, ref info); 1003_physicalStateObj.AddError(ProcessSNIError(_physicalStateObj)); 1004ThrowExceptionAndWarning(_physicalStateObj); 1011error = SNINativeMethodWrapper.SNIWaitForSSLHandshakeToComplete(_physicalStateObj.Handle, _physicalStateObj.GetTimeoutRemaining()); 1014_physicalStateObj.AddError(ProcessSNIError(_physicalStateObj)); 1015ThrowExceptionAndWarning(_physicalStateObj); 1021_physicalStateObj.ClearAllWritePackets(); 1120if (!connectionIsDoomed && null != _physicalStateObj) { 1121if (_physicalStateObj._pendingData) { 1122DrainData(_physicalStateObj); 1125if (_physicalStateObj.HasOpenResult) { // SQL BU DT 383773 - need to decrement openResultCount for all pending operations. 1126_physicalStateObj.DecrementOpenResultCount(); 1164if (!_physicalStateObj.HasOwner) { 1165_physicalStateObj.SniContext = SniContext.Snix_Close; 1169_physicalStateObj.Dispose(); 1173_physicalStateObj.DecrementPendingCallbacks(false); 2427if (_physicalStateObj.SetPacketSize(packetSize)) { 2430_physicalStateObj.ClearAllWritePackets(); 2434UInt32 result = SNINativeMethodWrapper.SNISetInfo(_physicalStateObj.Handle, SNINativeMethodWrapper.QTypes.SNI_QUERY_CONN_BUFSIZE, ref unsignedPacketSize); 3677_physicalStateObj.WriteByte(0); 3680_physicalStateObj.WriteByte(sizeof(UInt32)+sizeof(byte)); 3681WriteUnsignedInt(collation.info, _physicalStateObj); 3682_physicalStateObj.WriteByte(collation.sortId); 6891_physicalStateObj.WriteByte(TdsEnums.FEATUREEXT_SRECOVERY); 6895WriteInt(0, _physicalStateObj); 6934WriteInt(8 + initialLength + currentLength, _physicalStateObj); // length of data w/o total length (initil+current+2*sizeof(DWORD)) 6935WriteInt(initialLength, _physicalStateObj); 6936WriteIdentifier(reconnectData._initialDatabase, _physicalStateObj); 6937WriteCollation(reconnectData._initialCollation, _physicalStateObj); 6938WriteIdentifier(reconnectData._initialLanguage, _physicalStateObj); 6941_physicalStateObj.WriteByte((byte)i); 6943_physicalStateObj.WriteByte((byte)reconnectData._initialState[i].Length); 6946_physicalStateObj.WriteByte(0xFF); 6947WriteInt(reconnectData._initialState[i].Length, _physicalStateObj); 6949_physicalStateObj.WriteByteArray(reconnectData._initialState[i], reconnectData._initialState[i].Length, 0); 6952WriteInt(currentLength, _physicalStateObj); 6953WriteIdentifier(reconnectData._database != reconnectData._initialDatabase ? reconnectData._database : null, _physicalStateObj); 6954WriteCollation(SqlCollation.AreSame(reconnectData._initialCollation, reconnectData._collation) ? null : reconnectData._collation, _physicalStateObj); 6955WriteIdentifier(reconnectData._language != reconnectData._initialLanguage ? reconnectData._language : null, _physicalStateObj); 6958_physicalStateObj.WriteByte((byte)i); 6960_physicalStateObj.WriteByte((byte)reconnectData._delta[i]._dataLength); 6963_physicalStateObj.WriteByte(0xFF); 6964WriteInt(reconnectData._delta[i]._dataLength, _physicalStateObj); 6966_physicalStateObj.WriteByteArray(reconnectData._delta[i]._data, reconnectData._delta[i]._dataLength, 0); 7001_physicalStateObj.WriteByte(TdsEnums.FEATUREEXT_FEDAUTH); 7024WriteInt(dataLen, _physicalStateObj); 7025_physicalStateObj.WriteByte(options); 7047_physicalStateObj.WriteByte(workflow); 7050WriteInt(fedAuthFeatureData.accessToken.Length, _physicalStateObj); 7051_physicalStateObj.WriteByteArray(fedAuthFeatureData.accessToken, fedAuthFeatureData.accessToken.Length, 0); 7066_physicalStateObj.WriteByte(TdsEnums.FEATUREEXT_TCE); 7067WriteInt (1, _physicalStateObj); 7068_physicalStateObj.WriteByte(TdsEnums.MAX_SUPPORTED_TCE_VERSION); 7079_physicalStateObj.WriteByte(TdsEnums.FEATUREEXT_GLOBALTRANSACTIONS); 7080WriteInt(0, _physicalStateObj); // we don't send any data 7092_physicalStateObj.WriteByte(TdsEnums.FEATUREEXT_AZURESQLSUPPORT); 7095WriteInt(s_FeatureExtDataAzureSQLSupportFeatureRequest.Length, _physicalStateObj); 7097_physicalStateObj.WriteByteArray(s_FeatureExtDataAzureSQLSupportFeatureRequest, s_FeatureExtDataAzureSQLSupportFeatureRequest.Length, 0); 7108_physicalStateObj.SetTimeoutSeconds(rec.timeout); 7165_physicalStateObj._outputMessageType = TdsEnums.MT_LOGIN7; 7205Debug.Assert(SniContext.Snix_Login==_physicalStateObj.SniContext, String.Format((IFormatProvider)null, "Unexpected SniContext. Expecting Snix_Login, actual value is '{0}'", _physicalStateObj.SniContext)); 7206_physicalStateObj.SniContext = SniContext.Snix_LoginSspi; 7211_physicalStateObj.SniContext=SniContext.Snix_Login; 7244WriteInt(length, _physicalStateObj); 7246WriteInt((TdsEnums.DENALI_MAJOR << 24) | (TdsEnums.DENALI_INCREMENT << 16) | TdsEnums.DENALI_MINOR, _physicalStateObj); 7249WriteUnsignedInt(recoverySessionData._tdsVersion, _physicalStateObj); 7251WriteInt(rec.packetSize, _physicalStateObj); 7252WriteInt(TdsEnums.CLIENT_PROG_VER, _physicalStateObj); 7253WriteInt(TdsParserStaticMethods.GetCurrentProcessIdForTdsLoginOnly(), _physicalStateObj); //MDAC 84718 7254WriteInt(0, _physicalStateObj); // connectionID is unused 7317WriteInt(log7Flags, _physicalStateObj); 7322WriteInt(0, _physicalStateObj); // ClientTimeZone is not used 7323WriteInt(0, _physicalStateObj); // LCID is unused by server 7331WriteShort(offset, _physicalStateObj); // host name offset 7332WriteShort(rec.hostName.Length, _physicalStateObj); 7338WriteShort(offset, _physicalStateObj); // userName offset 7339WriteShort(userName.Length, _physicalStateObj); 7343WriteShort(offset, _physicalStateObj); // password offset 7344WriteShort(encryptedPasswordLengthInBytes / 2, _physicalStateObj); 7349WriteShort(0, _physicalStateObj); // userName offset 7350WriteShort(0, _physicalStateObj); 7351WriteShort(0, _physicalStateObj); // password offset 7352WriteShort(0, _physicalStateObj); 7355WriteShort(offset, _physicalStateObj); // app name offset 7356WriteShort(rec.applicationName.Length, _physicalStateObj); 7359WriteShort(offset, _physicalStateObj); // server name offset 7360WriteShort(rec.serverName.Length, _physicalStateObj); 7363WriteShort(offset, _physicalStateObj); 7365WriteShort(4, _physicalStateObj); // length of ibFeatgureExtLong (which is a DWORD) 7369WriteShort(0, _physicalStateObj); // unused (was remote password ?) 7372WriteShort(offset, _physicalStateObj); // client interface name offset 7373WriteShort(clientInterfaceName.Length, _physicalStateObj); 7376WriteShort(offset, _physicalStateObj); // language name offset 7377WriteShort(rec.language.Length, _physicalStateObj); 7380WriteShort(offset, _physicalStateObj); // database name offset 7381WriteShort(rec.database.Length, _physicalStateObj); 7389_physicalStateObj.WriteByteArray(s_nicAddress, s_nicAddress.Length, 0); 7391WriteShort(offset, _physicalStateObj); // ibSSPI offset 7393WriteShort((int)outSSPILength, _physicalStateObj); 7397WriteShort(0, _physicalStateObj); 7400WriteShort(offset, _physicalStateObj); // DB filename offset 7401WriteShort(rec.attachDBFilename.Length, _physicalStateObj); 7404WriteShort(offset, _physicalStateObj); // reset password offset 7405WriteShort(encryptedChangePasswordLengthInBytes / 2, _physicalStateObj); 7407WriteInt(0, _physicalStateObj); // reserved for chSSPI 7410WriteString(rec.hostName, _physicalStateObj); 7415WriteString(userName, _physicalStateObj); 7418_physicalStateObj._tracePasswordOffset = _physicalStateObj._outBytesUsed; 7419_physicalStateObj._tracePasswordLength = encryptedPasswordLengthInBytes; 7422_physicalStateObj.WriteSecureString(rec.credential.Password); 7425_physicalStateObj.WriteByteArray(encryptedPassword, encryptedPasswordLengthInBytes, 0); 7429WriteString(rec.applicationName, _physicalStateObj); 7430WriteString(rec.serverName, _physicalStateObj); 7434WriteInt(feOffset, _physicalStateObj); 7437WriteString(clientInterfaceName, _physicalStateObj); 7438WriteString(rec.language, _physicalStateObj); 7439WriteString(rec.database, _physicalStateObj); 7443_physicalStateObj.WriteByteArray(outSSPIBuff, (int)outSSPILength, 0); 7445WriteString(rec.attachDBFilename, _physicalStateObj); 7448_physicalStateObj._traceChangePasswordOffset = _physicalStateObj._outBytesUsed; 7449_physicalStateObj._traceChangePasswordLength = encryptedChangePasswordLengthInBytes; 7451_physicalStateObj.WriteSecureString(rec.newSecurePassword); 7454_physicalStateObj.WriteByteArray(encryptedChangePassword, encryptedChangePasswordLengthInBytes, 0); 7476_physicalStateObj.WriteByte(0xFF); // terminator 7483_physicalStateObj._outputPacketNumber = 1; // end of message - reset to 1 - per ramas 7484_physicalStateObj.ResetBuffer(); 7490_physicalStateObj.WritePacket(TdsEnums.HARDFLUSH); 7491_physicalStateObj.ResetSecurePasswordsInfomation(); // Password information is needed only from Login process; done with writing login packet and should clear information 7492_physicalStateObj._pendingData = true; 7493_physicalStateObj._messageStatus = 0; 7507_physicalStateObj._outputMessageType = TdsEnums.MT_FEDAUTH; 7513WriteUnsignedInt((uint)accessToken.Length + sizeof(uint), _physicalStateObj); 7516WriteUnsignedInt((uint)accessToken.Length, _physicalStateObj); 7519_physicalStateObj.WriteByteArray(accessToken, accessToken.Length, 0); 7521_physicalStateObj.WritePacket(TdsEnums.HARDFLUSH); 7522_physicalStateObj._pendingData = true; 7523_physicalStateObj._messageStatus = 0; 7540if(0 != SNINativeMethodWrapper.SNISecGenClientContext(_physicalStateObj.Handle, receivedBuff, receivedLength, sendBuff, ref sendLength, _sniSpnBuffer)) 7548SniContext outerContext=_physicalStateObj.SniContext; 7549_physicalStateObj.SniContext = SniContext.Snix_ProcessSspi; 7554Debug.Assert(_physicalStateObj._syncOverAsync, "Should not attempt pends in a synchronous call"); 7555bool result = _physicalStateObj.TryReadByteArray(receivedBuff, 0, receivedLength); 7566_physicalStateObj.WriteByteArray(sendBuff, (int)sendLength, 0); 7569_physicalStateObj._outputMessageType = TdsEnums.MT_SSPI; 7572_physicalStateObj.WritePacket(TdsEnums.HARDFLUSH); 7573_physicalStateObj.SniContext=outerContext; 7580_physicalStateObj.AddError(new SqlError(0, (byte)0x00, (byte)TdsEnums.MIN_ERROR_CLASS, _server, error, procedure, 0)); 7581ThrowExceptionAndWarning(_physicalStateObj); 7631_physicalStateObj.AddError(new SqlError(0, (byte)0x00, (byte)TdsEnums.MIN_ERROR_CLASS, _server, Res.GetString(Res.SQL_ADALInitializeError, authentication.ToString("G"), result.ToString("X")), TdsEnums.INIT_ADAL_PACKAGE, 0)); 7633ThrowExceptionAndWarning(_physicalStateObj); 7977if ((!_fMARS) && (_physicalStateObj.HasOpenResult)) 8087if ((!_fMARS) && (_physicalStateObj.HasOpenResult)) 11422null == _physicalStateObj, 11444_physicalStateObj != null ? "(null)" : _physicalStateObj.ErrorCount.ToString((IFormatProvider)null), 11445_physicalStateObj != null ? "(null)" : _physicalStateObj.WarningCount.ToString((IFormatProvider)null), 11446_physicalStateObj != null ? "(null)" : _physicalStateObj.PreAttentionErrorCount.ToString((IFormatProvider)null), 11447_physicalStateObj != null ? "(null)" : _physicalStateObj.PreAttentionWarningCount.ToString((IFormatProvider)null),
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (8)
289Debug.Assert(null != _parser._physicalStateObj, "no physical session?"); 290Debug.Assert(null != _parser._physicalStateObj._inBuff, "no in buffer?"); 291Debug.Assert(null != _parser._physicalStateObj._outBuff, "no out buffer?"); 292Debug.Assert(_parser._physicalStateObj._outBuff.Length == 293_parser._physicalStateObj._inBuff.Length, "Unexpected unequal buffers."); 296SetPacketSize(_parser._physicalStateObj._outBuff.Length); 309_lastSuccessfulIOTimer = parser._physicalStateObj._lastSuccessfulIOTimer; 1116this == _parser._physicalStateObj,