Imported Upstream version 4.2.0.179

Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
Xamarin Public Jenkins
2015-08-26 07:17:56 -04:00
committed by Jo Shields
parent 183bba2c9a
commit 6992685b86
7507 changed files with 90259 additions and 657307 deletions

View File

@@ -46,7 +46,7 @@ namespace System.Data
return instanceName;
}
#if !MONO
internal static void ReleaseDLLHandles()
{
s_userInstanceDLLHandle = IntPtr.Zero;
@@ -304,6 +304,7 @@ namespace System.Data
if (s_configurableInstances == null)
{
Dictionary<string, InstanceInfo> tempConfigurableInstances = new Dictionary<string, InstanceInfo>(StringComparer.OrdinalIgnoreCase);
#if !NO_CONFIGURATION
object section = PrivilegedConfigurationManager.GetSection("system.data.localdb");
if (section != null) // if no section just skip creation
{
@@ -318,6 +319,7 @@ namespace System.Data
}
}
else
#endif
Bid.Trace( "<sc.LocalDBAPI.CreateLocalDBInstance> No system.data.localdb section found in configuration");
s_configurableInstances = tempConfigurableInstances;
}
@@ -351,7 +353,7 @@ namespace System.Data
instanceInfo.created=true; // mark instance as created
} // CreateLocalDbInstance
#endif
}
}

View File

@@ -802,6 +802,7 @@ namespace System.Data.SqlClient
}
}
#if !MOBILE
public void EnlistDistributedTransaction(System.EnterpriseServices.ITransaction transaction) {
if (IsContextConnection) {
throw SQL.NotAvailableOnContextConnection();
@@ -809,6 +810,7 @@ namespace System.Data.SqlClient
EnlistDistributedTransactionHelper(transaction);
}
#endif
override public void Open() {
IntPtr hscp;

View File

@@ -180,14 +180,16 @@ namespace System.Data.SqlClient
throw SQL.NotAvailableOnContextConnection();
}
NameValueCollection settings = (NameValueCollection)PrivilegedConfigurationManager.GetSection("system.data.sqlclient");
Stream XMLStream =null;
#if !NO_CONFIGURATION
NameValueCollection settings = (NameValueCollection)PrivilegedConfigurationManager.GetSection("system.data.sqlclient");
if (settings != null){
string [] values = settings.GetValues(_metaDataXml);
if (values != null) {
XMLStream = ADP.GetXmlStreamFromValues(values, _metaDataXml);
}
}
#endif
// if the xml was not obtained from machine.config use the embedded XML resource
if (XMLStream == null){
@@ -306,9 +308,11 @@ namespace System.Data.SqlClient
public static readonly SqlPerformanceCounters SingletonInstance = new SqlPerformanceCounters();
#if !MOBILE
[System.Diagnostics.PerformanceCounterPermissionAttribute(System.Security.Permissions.SecurityAction.Assert, PermissionAccess=PerformanceCounterPermissionAccess.Write, MachineName=".", CategoryName=CategoryName)]
private SqlPerformanceCounters() : base (CategoryName, CategoryHelp) {
}
#endif
}
}

View File

@@ -27,6 +27,7 @@ namespace System.Data.SqlClient {
using System.Runtime.ExceptionServices;
static internal class AsyncHelper {
#if !MONO
internal static Task CreateContinuationTask(Task task, Action onSuccess, SqlInternalConnectionTds connectionToDoom = null, Action<Exception> onFailure = null) {
if (task == null) {
onSuccess();
@@ -145,7 +146,7 @@ namespace System.Data.SqlClient {
}, TaskScheduler.Default
);
}
#endif
internal static void WaitForCompletion(Task task, int timeout, Action onTimeout = null, bool rethrowExceptions=true) {
try {
@@ -187,6 +188,7 @@ namespace System.Data.SqlClient {
[ResourceExposure(ResourceScope.None)]
[ResourceConsumption(ResourceScope.Process, ResourceScope.Process)]
private InOutOfProcHelper() {
#if !MONO
// Don't need to close this handle...
// SxS: we use this method to check if we are running inside the SQL Server process. This call should be safe in SxS environment.
IntPtr handle = SafeNativeMethods.GetModuleHandle(null);
@@ -201,6 +203,7 @@ namespace System.Data.SqlClient {
_inProc = true;
}
}
#endif
}
internal static bool InProc {
@@ -674,9 +677,11 @@ namespace System.Data.SqlClient {
static internal Exception BulkLoadMappingsNamesOrOrdinalsOnly() {
return ADP.InvalidOperation(Res.GetString(Res.SQL_BulkLoadMappingsNamesOrOrdinalsOnly));
}
#if !MONO
static internal Exception BulkLoadCannotConvertValue(Type sourcetype, MetaType metatype, Exception e) {
return ADP.InvalidOperation(Res.GetString(Res.SQL_BulkLoadCannotConvertValue, sourcetype.Name, metatype.TypeName), e);
}
#endif
static internal Exception BulkLoadNonMatchingColumnMapping() {
return ADP.InvalidOperation(Res.GetString(Res.SQL_BulkLoadNonMatchingColumnMapping));
}
@@ -768,7 +773,7 @@ namespace System.Data.SqlClient {
return ADP.Argument(msg);
}
}
#if !MONO
static internal Exception MultiSubnetFailoverWithMoreThan64IPs() {
string msg = GetSNIErrorMessage((int)SNINativeMethodWrapper.SniSpecialErrors.MultiSubnetFailoverWithMoreThan64IPs);
return ADP.InvalidOperation(msg);
@@ -783,7 +788,7 @@ namespace System.Data.SqlClient {
string msg = GetSNIErrorMessage((int)SNINativeMethodWrapper.SniSpecialErrors.MultiSubnetFailoverWithNonTcpProtocol);
return ADP.Argument(msg);
}
#endif
//
// Read-only routing
//
@@ -928,10 +933,12 @@ namespace System.Data.SqlClient {
static internal Exception NotificationsNotAvailableOnContextConnection() {
return ADP.InvalidOperation(Res.GetString(Res.SQL_NotificationsNotAvailableOnContextConnection));
}
#if !MONO
static internal Exception UnexpectedSmiEvent(Microsoft.SqlServer.Server.SmiEventSink_Default.UnexpectedEventType eventType) {
Debug.Assert(false, "UnexpectedSmiEvent: "+eventType.ToString()); // Assert here, because these exceptions will most likely be eaten by the server.
return ADP.InvalidOperation(Res.GetString(Res.SQL_UnexpectedSmiEvent, (int)eventType));
}
#endif
static internal Exception UserInstanceNotAvailableInProc() {
return ADP.InvalidOperation(Res.GetString(Res.SQL_UserInstanceNotAvailableInProc));
}
@@ -969,7 +976,7 @@ namespace System.Data.SqlClient {
static internal Exception SubclassMustOverride() {
return ADP.InvalidOperation(Res.GetString(Res.SqlMisc_SubclassMustOverride));
}
#if !MONO
/// <summary>
/// gets a message for SNI error (sniError must be valid, non-zero error code)
/// </summary>
@@ -979,7 +986,7 @@ namespace System.Data.SqlClient {
string errorMessageId = String.Format((IFormatProvider)null, "SNI_ERROR_{0}", sniError);
return Res.GetString(errorMessageId);
}
#endif
// BulkLoad
internal const string WriteToServer = "WriteToServer";

View File

@@ -33,6 +33,7 @@ namespace System.Data.SqlClient {
[ResourceExposure(ResourceScope.None)]
[ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)]
static internal void AliasRegistryLookup(ref string host, ref string protocol) {
#if !MOBILE
if (!ADP.IsEmpty(host)) {
const String folder = "SOFTWARE\\Microsoft\\MSSQLServer\\Client\\ConnectTo";
// Put a try...catch... around this so we don't abort ANY connection if we can't read the registry.
@@ -87,6 +88,7 @@ namespace System.Data.SqlClient {
}
}
}
#endif
}
// Encrypt password to be sent to SQL Server