You've already forked linux-packaging-mono
Imported Upstream version 5.2.0.175
Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
parent
4bdbaf4a88
commit
966bba02bb
50
external/corefx/src/System.Data.Odbc/System.Data.Odbc.sln
vendored
Normal file
50
external/corefx/src/System.Data.Odbc/System.Data.Odbc.sln
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.Odbc.Tests", "tests\System.Data.Odbc.Tests.csproj", "{F3E72F35-0351-4D67-2209-725BCAD807BA}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{7BAD100F-AD6B-490A-AF7C-8E3854E812C0} = {7BAD100F-AD6B-490A-AF7C-8E3854E812C0}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.Odbc", "src\System.Data.Odbc.csproj", "{7BAD100F-AD6B-490A-AF7C-8E3854E812C0}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{D589374B-3331-4660-8DFB-512D66F8EC63} = {D589374B-3331-4660-8DFB-512D66F8EC63}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.Odbc", "ref\System.Data.Odbc.csproj", "{D589374B-3331-4660-8DFB-512D66F8EC63}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1A2F9F4A-A032-433E-B914-ADD5992BB178}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E107E9C1-E893-4E87-987E-04EF0DCEAEFD}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{2E666815-2EDB-464B-9DF6-380BF4789AD4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F3E72F35-0351-4D67-2209-725BCAD807BA}.Debug|Any CPU.ActiveCfg = netstandard-Windows_NT-Debug|Any CPU
|
||||
{F3E72F35-0351-4D67-2209-725BCAD807BA}.Debug|Any CPU.Build.0 = netstandard-Windows_NT-Debug|Any CPU
|
||||
{F3E72F35-0351-4D67-2209-725BCAD807BA}.Release|Any CPU.ActiveCfg = netstandard-Windows_NT-Release|Any CPU
|
||||
{F3E72F35-0351-4D67-2209-725BCAD807BA}.Release|Any CPU.Build.0 = netstandard-Windows_NT-Release|Any CPU
|
||||
{7BAD100F-AD6B-490A-AF7C-8E3854E812C0}.Debug|Any CPU.ActiveCfg = netstandard-Windows_NT-Debug|Any CPU
|
||||
{7BAD100F-AD6B-490A-AF7C-8E3854E812C0}.Debug|Any CPU.Build.0 = netstandard-Windows_NT-Debug|Any CPU
|
||||
{7BAD100F-AD6B-490A-AF7C-8E3854E812C0}.Release|Any CPU.ActiveCfg = netstandard-Windows_NT-Release|Any CPU
|
||||
{7BAD100F-AD6B-490A-AF7C-8E3854E812C0}.Release|Any CPU.Build.0 = netstandard-Windows_NT-Release|Any CPU
|
||||
{D589374B-3331-4660-8DFB-512D66F8EC63}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{D589374B-3331-4660-8DFB-512D66F8EC63}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{D589374B-3331-4660-8DFB-512D66F8EC63}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{D589374B-3331-4660-8DFB-512D66F8EC63}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{F3E72F35-0351-4D67-2209-725BCAD807BA} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{7BAD100F-AD6B-490A-AF7C-8E3854E812C0} = {E107E9C1-E893-4E87-987E-04EF0DCEAEFD}
|
||||
{D589374B-3331-4660-8DFB-512D66F8EC63} = {2E666815-2EDB-464B-9DF6-380BF4789AD4}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
8
external/corefx/src/System.Data.Odbc/dir.props
vendored
Normal file
8
external/corefx/src/System.Data.Odbc/dir.props
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\dir.props" />
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||||
<IsDesktopFacade>true</IsDesktopFacade>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
8
external/corefx/src/System.Data.Odbc/ref/Configurations.props
vendored
Normal file
8
external/corefx/src/System.Data.Odbc/ref/Configurations.props
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<BuildConfigurations>
|
||||
netstandard;
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
365
external/corefx/src/System.Data.Odbc/ref/System.Data.Odbc.cs
vendored
Normal file
365
external/corefx/src/System.Data.Odbc/ref/System.Data.Odbc.cs
vendored
Normal file
@@ -0,0 +1,365 @@
|
||||
namespace System.Data.Odbc
|
||||
{
|
||||
public sealed partial class OdbcCommand : System.Data.Common.DbCommand, System.ICloneable
|
||||
{
|
||||
public OdbcCommand() { }
|
||||
public OdbcCommand(string cmdText) { }
|
||||
public OdbcCommand(string cmdText, System.Data.Odbc.OdbcConnection connection) { }
|
||||
public OdbcCommand(string cmdText, System.Data.Odbc.OdbcConnection connection, System.Data.Odbc.OdbcTransaction transaction) { }
|
||||
public override string CommandText { get { throw null; } set { } }
|
||||
public override int CommandTimeout { get { throw null; } set { } }
|
||||
[System.ComponentModel.DefaultValueAttribute((System.Data.CommandType)(1))]
|
||||
public override System.Data.CommandType CommandType { get { throw null; } set { } }
|
||||
public new System.Data.Odbc.OdbcConnection Connection { get { throw null; } set { } }
|
||||
protected override System.Data.Common.DbConnection DbConnection { get { throw null; } set { } }
|
||||
protected override System.Data.Common.DbParameterCollection DbParameterCollection { get { throw null; } }
|
||||
protected override System.Data.Common.DbTransaction DbTransaction { get { throw null; } set { } }
|
||||
[System.ComponentModel.BrowsableAttribute(false)]
|
||||
[System.ComponentModel.DefaultValueAttribute(true)]
|
||||
[System.ComponentModel.DesignOnlyAttribute(true)]
|
||||
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
|
||||
public override bool DesignTimeVisible { get { throw null; } set { } }
|
||||
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(2))]
|
||||
public new System.Data.Odbc.OdbcParameterCollection Parameters { get { throw null; } }
|
||||
[System.ComponentModel.BrowsableAttribute(false)]
|
||||
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
|
||||
public new System.Data.Odbc.OdbcTransaction Transaction { get { throw null; } set { } }
|
||||
[System.ComponentModel.DefaultValueAttribute((System.Data.UpdateRowSource)(3))]
|
||||
public override System.Data.UpdateRowSource UpdatedRowSource { get { throw null; } set { } }
|
||||
public override void Cancel() { }
|
||||
protected override System.Data.Common.DbParameter CreateDbParameter() { throw null; }
|
||||
public new System.Data.Odbc.OdbcParameter CreateParameter() { throw null; }
|
||||
protected override void Dispose(bool disposing) { }
|
||||
protected override System.Data.Common.DbDataReader ExecuteDbDataReader(System.Data.CommandBehavior behavior) { throw null; }
|
||||
public override int ExecuteNonQuery() { throw null; }
|
||||
public new System.Data.Odbc.OdbcDataReader ExecuteReader() { throw null; }
|
||||
public new System.Data.Odbc.OdbcDataReader ExecuteReader(System.Data.CommandBehavior behavior) { throw null; }
|
||||
public override object ExecuteScalar() { throw null; }
|
||||
public override void Prepare() { }
|
||||
public void ResetCommandTimeout() { }
|
||||
object System.ICloneable.Clone() { throw null; }
|
||||
}
|
||||
public sealed partial class OdbcCommandBuilder : System.Data.Common.DbCommandBuilder
|
||||
{
|
||||
public OdbcCommandBuilder() { }
|
||||
public OdbcCommandBuilder(System.Data.Odbc.OdbcDataAdapter adapter) { }
|
||||
public new System.Data.Odbc.OdbcDataAdapter DataAdapter { get { throw null; } set { } }
|
||||
protected override void ApplyParameterInfo(System.Data.Common.DbParameter parameter, System.Data.DataRow datarow, System.Data.StatementType statementType, bool whereClause) { }
|
||||
public static void DeriveParameters(System.Data.Odbc.OdbcCommand command) { }
|
||||
public new System.Data.Odbc.OdbcCommand GetDeleteCommand() { throw null; }
|
||||
public new System.Data.Odbc.OdbcCommand GetDeleteCommand(bool useColumnsForParameterNames) { throw null; }
|
||||
public new System.Data.Odbc.OdbcCommand GetInsertCommand() { throw null; }
|
||||
public new System.Data.Odbc.OdbcCommand GetInsertCommand(bool useColumnsForParameterNames) { throw null; }
|
||||
protected override string GetParameterName(int parameterOrdinal) { throw null; }
|
||||
protected override string GetParameterName(string parameterName) { throw null; }
|
||||
protected override string GetParameterPlaceholder(int parameterOrdinal) { throw null; }
|
||||
public new System.Data.Odbc.OdbcCommand GetUpdateCommand() { throw null; }
|
||||
public new System.Data.Odbc.OdbcCommand GetUpdateCommand(bool useColumnsForParameterNames) { throw null; }
|
||||
public override string QuoteIdentifier(string unquotedIdentifier) { throw null; }
|
||||
public string QuoteIdentifier(string unquotedIdentifier, System.Data.Odbc.OdbcConnection connection) { throw null; }
|
||||
protected override void SetRowUpdatingHandler(System.Data.Common.DbDataAdapter adapter) { }
|
||||
public override string UnquoteIdentifier(string quotedIdentifier) { throw null; }
|
||||
public string UnquoteIdentifier(string quotedIdentifier, System.Data.Odbc.OdbcConnection connection) { throw null; }
|
||||
}
|
||||
public sealed partial class OdbcConnection : System.Data.Common.DbConnection, System.ICloneable
|
||||
{
|
||||
public OdbcConnection() { }
|
||||
public OdbcConnection(string connectionString) { }
|
||||
public override string ConnectionString { get { throw null; } set { } }
|
||||
[System.ComponentModel.DefaultValueAttribute(15)]
|
||||
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
|
||||
public new int ConnectionTimeout { get { throw null; } set { } }
|
||||
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
|
||||
public override string Database { get { throw null; } }
|
||||
[System.ComponentModel.BrowsableAttribute(false)]
|
||||
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
|
||||
public override string DataSource { get { throw null; } }
|
||||
[System.ComponentModel.BrowsableAttribute(false)]
|
||||
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
|
||||
public string Driver { get { throw null; } }
|
||||
[System.ComponentModel.BrowsableAttribute(false)]
|
||||
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
|
||||
public override string ServerVersion { get { throw null; } }
|
||||
[System.ComponentModel.BrowsableAttribute(false)]
|
||||
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
|
||||
public override System.Data.ConnectionState State { get { throw null; } }
|
||||
public event System.Data.Odbc.OdbcInfoMessageEventHandler InfoMessage { add { } remove { } }
|
||||
protected override System.Data.Common.DbTransaction BeginDbTransaction(System.Data.IsolationLevel isolationLevel) { throw null; }
|
||||
public new System.Data.Odbc.OdbcTransaction BeginTransaction() { throw null; }
|
||||
public new System.Data.Odbc.OdbcTransaction BeginTransaction(System.Data.IsolationLevel isolevel) { throw null; }
|
||||
public override void ChangeDatabase(string value) { }
|
||||
public override void Close() { }
|
||||
public new System.Data.Odbc.OdbcCommand CreateCommand() { throw null; }
|
||||
protected override System.Data.Common.DbCommand CreateDbCommand() { throw null; }
|
||||
protected override void Dispose(bool disposing) { }
|
||||
public override void Open() { }
|
||||
public static void ReleaseObjectPool() { }
|
||||
object System.ICloneable.Clone() { throw null; }
|
||||
}
|
||||
public sealed partial class OdbcConnectionStringBuilder : System.Data.Common.DbConnectionStringBuilder
|
||||
{
|
||||
public OdbcConnectionStringBuilder() { }
|
||||
public OdbcConnectionStringBuilder(string connectionString) { }
|
||||
[System.ComponentModel.DisplayNameAttribute("Driver")]
|
||||
public string Driver { get { throw null; } set { } }
|
||||
[System.ComponentModel.DisplayNameAttribute("Dsn")]
|
||||
public string Dsn { get { throw null; } set { } }
|
||||
public override object this[string keyword] { get { throw null; } set { } }
|
||||
public override System.Collections.ICollection Keys { get { throw null; } }
|
||||
public override void Clear() { }
|
||||
public override bool ContainsKey(string keyword) { throw null; }
|
||||
public override bool Remove(string keyword) { throw null; }
|
||||
public override bool TryGetValue(string keyword, out object value) { value = default(object); throw null; }
|
||||
}
|
||||
public sealed partial class OdbcDataAdapter : System.Data.Common.DbDataAdapter, System.Data.IDataAdapter, System.Data.IDbDataAdapter, System.ICloneable
|
||||
{
|
||||
public OdbcDataAdapter() { }
|
||||
public OdbcDataAdapter(System.Data.Odbc.OdbcCommand selectCommand) { }
|
||||
public OdbcDataAdapter(string selectCommandText, System.Data.Odbc.OdbcConnection selectConnection) { }
|
||||
public OdbcDataAdapter(string selectCommandText, string selectConnectionString) { }
|
||||
public new System.Data.Odbc.OdbcCommand DeleteCommand { get { throw null; } set { } }
|
||||
public new System.Data.Odbc.OdbcCommand InsertCommand { get { throw null; } set { } }
|
||||
public new System.Data.Odbc.OdbcCommand SelectCommand { get { throw null; } set { } }
|
||||
System.Data.IDbCommand System.Data.IDbDataAdapter.DeleteCommand { get { throw null; } set { } }
|
||||
System.Data.IDbCommand System.Data.IDbDataAdapter.InsertCommand { get { throw null; } set { } }
|
||||
System.Data.IDbCommand System.Data.IDbDataAdapter.SelectCommand { get { throw null; } set { } }
|
||||
System.Data.IDbCommand System.Data.IDbDataAdapter.UpdateCommand { get { throw null; } set { } }
|
||||
public new System.Data.Odbc.OdbcCommand UpdateCommand { get { throw null; } set { } }
|
||||
public event System.Data.Odbc.OdbcRowUpdatedEventHandler RowUpdated { add { } remove { } }
|
||||
public event System.Data.Odbc.OdbcRowUpdatingEventHandler RowUpdating { add { } remove { } }
|
||||
protected override System.Data.Common.RowUpdatedEventArgs CreateRowUpdatedEvent(System.Data.DataRow dataRow, System.Data.IDbCommand command, System.Data.StatementType statementType, System.Data.Common.DataTableMapping tableMapping) { throw null; }
|
||||
protected override System.Data.Common.RowUpdatingEventArgs CreateRowUpdatingEvent(System.Data.DataRow dataRow, System.Data.IDbCommand command, System.Data.StatementType statementType, System.Data.Common.DataTableMapping tableMapping) { throw null; }
|
||||
protected override void OnRowUpdated(System.Data.Common.RowUpdatedEventArgs value) { }
|
||||
protected override void OnRowUpdating(System.Data.Common.RowUpdatingEventArgs value) { }
|
||||
object System.ICloneable.Clone() { throw null; }
|
||||
}
|
||||
public sealed partial class OdbcDataReader : System.Data.Common.DbDataReader
|
||||
{
|
||||
internal OdbcDataReader() { }
|
||||
public override int Depth { get { throw null; } }
|
||||
public override int FieldCount { get { throw null; } }
|
||||
public override bool HasRows { get { throw null; } }
|
||||
public override bool IsClosed { get { throw null; } }
|
||||
public override object this[int i] { get { throw null; } }
|
||||
public override object this[string value] { get { throw null; } }
|
||||
public override int RecordsAffected { get { throw null; } }
|
||||
public override void Close() { }
|
||||
protected override void Dispose(bool disposing) { }
|
||||
public override bool GetBoolean(int i) { throw null; }
|
||||
public override byte GetByte(int i) { throw null; }
|
||||
public override long GetBytes(int i, long dataIndex, byte[] buffer, int bufferIndex, int length) { throw null; }
|
||||
public override char GetChar(int i) { throw null; }
|
||||
public override long GetChars(int i, long dataIndex, char[] buffer, int bufferIndex, int length) { throw null; }
|
||||
public override string GetDataTypeName(int i) { throw null; }
|
||||
public System.DateTime GetDate(int i) { throw null; }
|
||||
public override System.DateTime GetDateTime(int i) { throw null; }
|
||||
public override decimal GetDecimal(int i) { throw null; }
|
||||
public override double GetDouble(int i) { throw null; }
|
||||
public override System.Collections.IEnumerator GetEnumerator() { throw null; }
|
||||
public override System.Type GetFieldType(int i) { throw null; }
|
||||
public override float GetFloat(int i) { throw null; }
|
||||
public override System.Guid GetGuid(int i) { throw null; }
|
||||
public override short GetInt16(int i) { throw null; }
|
||||
public override int GetInt32(int i) { throw null; }
|
||||
public override long GetInt64(int i) { throw null; }
|
||||
public override string GetName(int i) { throw null; }
|
||||
public override int GetOrdinal(string value) { throw null; }
|
||||
public override System.Data.DataTable GetSchemaTable() { throw null; }
|
||||
public override string GetString(int i) { throw null; }
|
||||
public System.TimeSpan GetTime(int i) { throw null; }
|
||||
public override object GetValue(int i) { throw null; }
|
||||
public override int GetValues(object[] values) { throw null; }
|
||||
public override bool IsDBNull(int i) { throw null; }
|
||||
public override bool NextResult() { throw null; }
|
||||
public override bool Read() { throw null; }
|
||||
}
|
||||
public sealed partial class OdbcError
|
||||
{
|
||||
internal OdbcError() { }
|
||||
public string Message { get { throw null; } }
|
||||
public int NativeError { get { throw null; } }
|
||||
public string Source { get { throw null; } }
|
||||
public string SQLState { get { throw null; } }
|
||||
public override string ToString() { throw null; }
|
||||
}
|
||||
public sealed partial class OdbcErrorCollection : System.Collections.ICollection, System.Collections.IEnumerable
|
||||
{
|
||||
internal OdbcErrorCollection() { }
|
||||
public int Count { get { throw null; } }
|
||||
public System.Data.Odbc.OdbcError this[int i] { get { throw null; } }
|
||||
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
|
||||
object System.Collections.ICollection.SyncRoot { get { throw null; } }
|
||||
public void CopyTo(System.Array array, int i) { }
|
||||
public void CopyTo(System.Data.Odbc.OdbcError[] array, int i) { }
|
||||
public System.Collections.IEnumerator GetEnumerator() { throw null; }
|
||||
}
|
||||
public sealed partial class OdbcException : System.Data.Common.DbException
|
||||
{
|
||||
internal OdbcException() { }
|
||||
public System.Data.Odbc.OdbcErrorCollection Errors { get { throw null; } }
|
||||
public override string Source { get { throw null; } }
|
||||
[System.Security.Permissions.SecurityPermissionAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Flags=(System.Security.Permissions.SecurityPermissionFlag)(128))]
|
||||
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo si, System.Runtime.Serialization.StreamingContext context) { }
|
||||
}
|
||||
public sealed partial class OdbcFactory : System.Data.Common.DbProviderFactory
|
||||
{
|
||||
internal OdbcFactory() { }
|
||||
public static readonly System.Data.Odbc.OdbcFactory Instance;
|
||||
public override System.Data.Common.DbCommand CreateCommand() { throw null; }
|
||||
public override System.Data.Common.DbCommandBuilder CreateCommandBuilder() { throw null; }
|
||||
public override System.Data.Common.DbConnection CreateConnection() { throw null; }
|
||||
public override System.Data.Common.DbConnectionStringBuilder CreateConnectionStringBuilder() { throw null; }
|
||||
public override System.Data.Common.DbDataAdapter CreateDataAdapter() { throw null; }
|
||||
public override System.Data.Common.DbParameter CreateParameter() { throw null; }
|
||||
}
|
||||
public sealed partial class OdbcInfoMessageEventArgs : System.EventArgs
|
||||
{
|
||||
internal OdbcInfoMessageEventArgs() { }
|
||||
public System.Data.Odbc.OdbcErrorCollection Errors { get { throw null; } }
|
||||
public string Message { get { throw null; } }
|
||||
public override string ToString() { throw null; }
|
||||
}
|
||||
public delegate void OdbcInfoMessageEventHandler(object sender, System.Data.Odbc.OdbcInfoMessageEventArgs e);
|
||||
public static partial class OdbcMetaDataCollectionNames
|
||||
{
|
||||
public static readonly string Columns;
|
||||
public static readonly string Indexes;
|
||||
public static readonly string ProcedureColumns;
|
||||
public static readonly string ProcedureParameters;
|
||||
public static readonly string Procedures;
|
||||
public static readonly string Tables;
|
||||
public static readonly string Views;
|
||||
}
|
||||
public static partial class OdbcMetaDataColumnNames
|
||||
{
|
||||
public static readonly string BooleanFalseLiteral;
|
||||
public static readonly string BooleanTrueLiteral;
|
||||
public static readonly string SQLType;
|
||||
}
|
||||
public sealed partial class OdbcParameter : System.Data.Common.DbParameter, System.Data.IDataParameter, System.Data.IDbDataParameter, System.ICloneable
|
||||
{
|
||||
public OdbcParameter() { }
|
||||
public OdbcParameter(string name, System.Data.Odbc.OdbcType type) { }
|
||||
public OdbcParameter(string name, System.Data.Odbc.OdbcType type, int size) { }
|
||||
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(2))]
|
||||
public OdbcParameter(string parameterName, System.Data.Odbc.OdbcType odbcType, int size, System.Data.ParameterDirection parameterDirection, bool isNullable, byte precision, byte scale, string srcColumn, System.Data.DataRowVersion srcVersion, object value) { }
|
||||
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(2))]
|
||||
public OdbcParameter(string parameterName, System.Data.Odbc.OdbcType odbcType, int size, System.Data.ParameterDirection parameterDirection, byte precision, byte scale, string sourceColumn, System.Data.DataRowVersion sourceVersion, bool sourceColumnNullMapping, object value) { }
|
||||
public OdbcParameter(string name, System.Data.Odbc.OdbcType type, int size, string sourcecolumn) { }
|
||||
public OdbcParameter(string name, object value) { }
|
||||
public override System.Data.DbType DbType { get { throw null; } set { } }
|
||||
public override System.Data.ParameterDirection Direction { get { throw null; } set { } }
|
||||
public override bool IsNullable { get { throw null; } set { } }
|
||||
[System.ComponentModel.DefaultValueAttribute((System.Data.Odbc.OdbcType)(11))]
|
||||
[System.Data.Common.DbProviderSpecificTypePropertyAttribute(true)]
|
||||
public System.Data.Odbc.OdbcType OdbcType { get { throw null; } set { } }
|
||||
public override string ParameterName { get { throw null; } set { } }
|
||||
public new byte Precision { get { throw null; } set { } }
|
||||
public new byte Scale { get { throw null; } set { } }
|
||||
public override int Size { get { throw null; } set { } }
|
||||
public override string SourceColumn { get { throw null; } set { } }
|
||||
public override bool SourceColumnNullMapping { get { throw null; } set { } }
|
||||
public override System.Data.DataRowVersion SourceVersion { get { throw null; } set { } }
|
||||
public override object Value { get { throw null; } set { } }
|
||||
public override void ResetDbType() { }
|
||||
public void ResetOdbcType() { }
|
||||
object System.ICloneable.Clone() { throw null; }
|
||||
public override string ToString() { throw null; }
|
||||
}
|
||||
public sealed partial class OdbcParameterCollection : System.Data.Common.DbParameterCollection
|
||||
{
|
||||
internal OdbcParameterCollection() { }
|
||||
public override int Count { get { throw null; } }
|
||||
public override bool IsFixedSize { get { throw null; } }
|
||||
public override bool IsReadOnly { get { throw null; } }
|
||||
public override bool IsSynchronized { get { throw null; } }
|
||||
[System.ComponentModel.BrowsableAttribute(false)]
|
||||
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
|
||||
public new System.Data.Odbc.OdbcParameter this[int index] { get { throw null; } set { } }
|
||||
[System.ComponentModel.BrowsableAttribute(false)]
|
||||
[System.ComponentModel.DesignerSerializationVisibilityAttribute((System.ComponentModel.DesignerSerializationVisibility)(0))]
|
||||
public new System.Data.Odbc.OdbcParameter this[string parameterName] { get { throw null; } set { } }
|
||||
public override object SyncRoot { get { throw null; } }
|
||||
public System.Data.Odbc.OdbcParameter Add(System.Data.Odbc.OdbcParameter value) { throw null; }
|
||||
public override int Add(object value) { throw null; }
|
||||
public System.Data.Odbc.OdbcParameter Add(string parameterName, System.Data.Odbc.OdbcType odbcType) { throw null; }
|
||||
public System.Data.Odbc.OdbcParameter Add(string parameterName, System.Data.Odbc.OdbcType odbcType, int size) { throw null; }
|
||||
public System.Data.Odbc.OdbcParameter Add(string parameterName, System.Data.Odbc.OdbcType odbcType, int size, string sourceColumn) { throw null; }
|
||||
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
|
||||
[System.ObsoleteAttribute("Add(String parameterName, Object value) has been deprecated. Use AddWithValue(String parameterName, Object value). http://go.microsoft.com/fwlink/?linkid=14202", false)]
|
||||
public System.Data.Odbc.OdbcParameter Add(string parameterName, object value) { throw null; }
|
||||
public override void AddRange(System.Array values) { }
|
||||
public void AddRange(System.Data.Odbc.OdbcParameter[] values) { }
|
||||
public System.Data.Odbc.OdbcParameter AddWithValue(string parameterName, object value) { throw null; }
|
||||
public override void Clear() { }
|
||||
public bool Contains(System.Data.Odbc.OdbcParameter value) { throw null; }
|
||||
public override bool Contains(object value) { throw null; }
|
||||
public override bool Contains(string value) { throw null; }
|
||||
public override void CopyTo(System.Array array, int index) { }
|
||||
public void CopyTo(System.Data.Odbc.OdbcParameter[] array, int index) { }
|
||||
public override System.Collections.IEnumerator GetEnumerator() { throw null; }
|
||||
protected override System.Data.Common.DbParameter GetParameter(int index) { throw null; }
|
||||
protected override System.Data.Common.DbParameter GetParameter(string parameterName) { throw null; }
|
||||
public int IndexOf(System.Data.Odbc.OdbcParameter value) { throw null; }
|
||||
public override int IndexOf(object value) { throw null; }
|
||||
public override int IndexOf(string parameterName) { throw null; }
|
||||
public void Insert(int index, System.Data.Odbc.OdbcParameter value) { }
|
||||
public override void Insert(int index, object value) { }
|
||||
public void Remove(System.Data.Odbc.OdbcParameter value) { }
|
||||
public override void Remove(object value) { }
|
||||
public override void RemoveAt(int index) { }
|
||||
public override void RemoveAt(string parameterName) { }
|
||||
protected override void SetParameter(int index, System.Data.Common.DbParameter value) { }
|
||||
protected override void SetParameter(string parameterName, System.Data.Common.DbParameter value) { }
|
||||
}
|
||||
public sealed partial class OdbcRowUpdatedEventArgs : System.Data.Common.RowUpdatedEventArgs
|
||||
{
|
||||
public OdbcRowUpdatedEventArgs(System.Data.DataRow row, System.Data.IDbCommand command, System.Data.StatementType statementType, System.Data.Common.DataTableMapping tableMapping) : base (default(System.Data.DataRow), default(System.Data.IDbCommand), default(System.Data.StatementType), default(System.Data.Common.DataTableMapping)) { }
|
||||
public new System.Data.Odbc.OdbcCommand Command { get { throw null; } }
|
||||
}
|
||||
public delegate void OdbcRowUpdatedEventHandler(object sender, System.Data.Odbc.OdbcRowUpdatedEventArgs e);
|
||||
public sealed partial class OdbcRowUpdatingEventArgs : System.Data.Common.RowUpdatingEventArgs
|
||||
{
|
||||
public OdbcRowUpdatingEventArgs(System.Data.DataRow row, System.Data.IDbCommand command, System.Data.StatementType statementType, System.Data.Common.DataTableMapping tableMapping) : base (default(System.Data.DataRow), default(System.Data.IDbCommand), default(System.Data.StatementType), default(System.Data.Common.DataTableMapping)) { }
|
||||
protected override System.Data.IDbCommand BaseCommand { get { throw null; } set { } }
|
||||
public new System.Data.Odbc.OdbcCommand Command { get { throw null; } set { } }
|
||||
}
|
||||
public delegate void OdbcRowUpdatingEventHandler(object sender, System.Data.Odbc.OdbcRowUpdatingEventArgs e);
|
||||
public sealed partial class OdbcTransaction : System.Data.Common.DbTransaction
|
||||
{
|
||||
internal OdbcTransaction() { }
|
||||
public new System.Data.Odbc.OdbcConnection Connection { get { throw null; } }
|
||||
protected override System.Data.Common.DbConnection DbConnection { get { throw null; } }
|
||||
public override System.Data.IsolationLevel IsolationLevel { get { throw null; } }
|
||||
public override void Commit() { }
|
||||
protected override void Dispose(bool disposing) { }
|
||||
public override void Rollback() { }
|
||||
}
|
||||
public enum OdbcType
|
||||
{
|
||||
BigInt = 1,
|
||||
Binary = 2,
|
||||
Bit = 3,
|
||||
Char = 4,
|
||||
Date = 23,
|
||||
DateTime = 5,
|
||||
Decimal = 6,
|
||||
Double = 8,
|
||||
Image = 9,
|
||||
Int = 10,
|
||||
NChar = 11,
|
||||
NText = 12,
|
||||
Numeric = 7,
|
||||
NVarChar = 13,
|
||||
Real = 14,
|
||||
SmallDateTime = 16,
|
||||
SmallInt = 17,
|
||||
Text = 18,
|
||||
Time = 24,
|
||||
Timestamp = 19,
|
||||
TinyInt = 20,
|
||||
UniqueIdentifier = 15,
|
||||
VarBinary = 21,
|
||||
VarChar = 22,
|
||||
}
|
||||
}
|
||||
13
external/corefx/src/System.Data.Odbc/ref/System.Data.Odbc.csproj
vendored
Normal file
13
external/corefx/src/System.Data.Odbc/ref/System.Data.Odbc.csproj
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{D589374B-3331-4660-8DFB-512D66F8EC63}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<Compile Include="System.Data.Odbc.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
1087
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/AdapterUtil.cs
vendored
Normal file
1087
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/AdapterUtil.cs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
544
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/DBConnectionString.cs
vendored
Normal file
544
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/DBConnectionString.cs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1080
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionOptions.cs
vendored
Normal file
1080
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionOptions.cs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
58
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionPoolKey.cs
vendored
Normal file
58
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionPoolKey.cs
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.Data.Common
|
||||
{
|
||||
// DbConnectionPoolKey: Base class implementation of a key to connection pool groups
|
||||
// Only connection string is used as a key
|
||||
internal class DbConnectionPoolKey : ICloneable
|
||||
{
|
||||
private string _connectionString;
|
||||
|
||||
internal DbConnectionPoolKey(string connectionString)
|
||||
{
|
||||
_connectionString = connectionString;
|
||||
}
|
||||
|
||||
protected DbConnectionPoolKey(DbConnectionPoolKey key)
|
||||
{
|
||||
_connectionString = key.ConnectionString;
|
||||
}
|
||||
|
||||
object ICloneable.Clone()
|
||||
{
|
||||
return new DbConnectionPoolKey(this);
|
||||
}
|
||||
|
||||
internal virtual string ConnectionString
|
||||
{
|
||||
get
|
||||
{
|
||||
return _connectionString;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_connectionString = value;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null || obj.GetType() != typeof(DbConnectionPoolKey))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
DbConnectionPoolKey key = obj as DbConnectionPoolKey;
|
||||
|
||||
return (key != null && _connectionString == key._connectionString);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return _connectionString == null ? 0 : _connectionString.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
258
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionStringCommon.cs
vendored
Normal file
258
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/DbConnectionStringCommon.cs
vendored
Normal file
@@ -0,0 +1,258 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
|
||||
namespace System.Data.Common
|
||||
{
|
||||
internal static class DbConnectionStringDefaults
|
||||
{
|
||||
// all
|
||||
// internal const string NamedConnection = "";
|
||||
|
||||
// Odbc
|
||||
internal const string Driver = "";
|
||||
internal const string Dsn = "";
|
||||
|
||||
// OleDb
|
||||
internal const bool AdoNetPooler = false;
|
||||
internal const string FileName = "";
|
||||
internal const int OleDbServices = ~(/*DBPROPVAL_OS_AGR_AFTERSESSION*/0x00000008 | /*DBPROPVAL_OS_CLIENTCURSOR*/0x00000004); // -13
|
||||
internal const string Provider = "";
|
||||
|
||||
// OracleClient
|
||||
internal const bool Unicode = false;
|
||||
internal const bool OmitOracleConnectionName = false;
|
||||
|
||||
// SqlClient
|
||||
//internal const ApplicationIntent ApplicationIntent = System.Data.SqlClient.ApplicationIntent.ReadWrite;
|
||||
internal const string ApplicationName = ".Net SqlClient Data Provider";
|
||||
internal const bool AsynchronousProcessing = false;
|
||||
internal const string AttachDBFilename = "";
|
||||
internal const int ConnectTimeout = 15;
|
||||
internal const bool ConnectionReset = true;
|
||||
internal const bool ContextConnection = false;
|
||||
internal const string CurrentLanguage = "";
|
||||
internal const string DataSource = "";
|
||||
internal const bool Encrypt = false;
|
||||
internal const bool Enlist = true;
|
||||
internal const string FailoverPartner = "";
|
||||
internal const string InitialCatalog = "";
|
||||
internal const bool IntegratedSecurity = false;
|
||||
internal const int LoadBalanceTimeout = 0; // default of 0 means don't use
|
||||
internal const bool MultipleActiveResultSets = false;
|
||||
internal const bool MultiSubnetFailover = false;
|
||||
internal const bool TransparentNetworkIPResolution = true;
|
||||
internal const int MaxPoolSize = 100;
|
||||
internal const int MinPoolSize = 0;
|
||||
internal const string NetworkLibrary = "";
|
||||
internal const int PacketSize = 8000;
|
||||
internal const string Password = "";
|
||||
internal const bool PersistSecurityInfo = false;
|
||||
internal const bool Pooling = true;
|
||||
internal const bool TrustServerCertificate = false;
|
||||
internal const string TypeSystemVersion = "Latest";
|
||||
internal const string UserID = "";
|
||||
internal const bool UserInstance = false;
|
||||
internal const bool Replication = false;
|
||||
internal const string WorkstationID = "";
|
||||
internal const string TransactionBinding = "Implicit Unbind";
|
||||
internal const int ConnectRetryCount = 1;
|
||||
internal const int ConnectRetryInterval = 10;
|
||||
//internal static readonly SqlAuthenticationMethod Authentication = SqlAuthenticationMethod.NotSpecified;
|
||||
//internal static readonly SqlConnectionColumnEncryptionSetting ColumnEncryptionSetting = SqlConnectionColumnEncryptionSetting.Disabled;
|
||||
//internal const PoolBlockingPeriod PoolBlockingPeriod = SqlClient.PoolBlockingPeriod.Auto;
|
||||
}
|
||||
|
||||
internal static class DbConnectionStringKeywords
|
||||
{
|
||||
// all
|
||||
// internal const string NamedConnection = "Named Connection";
|
||||
|
||||
// Odbc
|
||||
internal const string Driver = "Driver";
|
||||
internal const string Dsn = "Dsn";
|
||||
internal const string FileDsn = "FileDsn";
|
||||
internal const string SaveFile = "SaveFile";
|
||||
|
||||
// OleDb
|
||||
internal const string FileName = "File Name";
|
||||
internal const string OleDbServices = "OLE DB Services";
|
||||
internal const string Provider = "Provider";
|
||||
|
||||
// OracleClient
|
||||
internal const string Unicode = "Unicode";
|
||||
internal const string OmitOracleConnectionName = "Omit Oracle Connection Name";
|
||||
|
||||
// SqlClient
|
||||
internal const string ApplicationIntent = "ApplicationIntent";
|
||||
internal const string ApplicationName = "Application Name";
|
||||
internal const string AsynchronousProcessing = "Asynchronous Processing";
|
||||
internal const string AttachDBFilename = "AttachDbFilename";
|
||||
internal const string ConnectTimeout = "Connect Timeout";
|
||||
internal const string ConnectionReset = "Connection Reset";
|
||||
internal const string ContextConnection = "Context Connection";
|
||||
internal const string CurrentLanguage = "Current Language";
|
||||
internal const string Encrypt = "Encrypt";
|
||||
internal const string FailoverPartner = "Failover Partner";
|
||||
internal const string InitialCatalog = "Initial Catalog";
|
||||
internal const string MultipleActiveResultSets = "MultipleActiveResultSets";
|
||||
internal const string MultiSubnetFailover = "MultiSubnetFailover";
|
||||
internal const string TransparentNetworkIPResolution = "TransparentNetworkIPResolution";
|
||||
internal const string NetworkLibrary = "Network Library";
|
||||
internal const string PacketSize = "Packet Size";
|
||||
internal const string Replication = "Replication";
|
||||
internal const string TransactionBinding = "Transaction Binding";
|
||||
internal const string TrustServerCertificate = "TrustServerCertificate";
|
||||
internal const string TypeSystemVersion = "Type System Version";
|
||||
internal const string UserInstance = "User Instance";
|
||||
internal const string WorkstationID = "Workstation ID";
|
||||
internal const string ConnectRetryCount = "ConnectRetryCount";
|
||||
internal const string ConnectRetryInterval = "ConnectRetryInterval";
|
||||
internal const string Authentication = "Authentication";
|
||||
internal const string Certificate = "Certificate";
|
||||
internal const string ColumnEncryptionSetting = "Column Encryption Setting";
|
||||
internal const string PoolBlockingPeriod = "PoolBlockingPeriod";
|
||||
|
||||
// common keywords (OleDb, OracleClient, SqlClient)
|
||||
internal const string DataSource = "Data Source";
|
||||
internal const string IntegratedSecurity = "Integrated Security";
|
||||
internal const string Password = "Password";
|
||||
internal const string PersistSecurityInfo = "Persist Security Info";
|
||||
internal const string UserID = "User ID";
|
||||
|
||||
// managed pooling (OracleClient, SqlClient)
|
||||
internal const string Enlist = "Enlist";
|
||||
internal const string LoadBalanceTimeout = "Load Balance Timeout";
|
||||
internal const string MaxPoolSize = "Max Pool Size";
|
||||
internal const string Pooling = "Pooling";
|
||||
internal const string MinPoolSize = "Min Pool Size";
|
||||
}
|
||||
|
||||
internal static class DbConnectionOptionKeywords
|
||||
{
|
||||
// Odbc
|
||||
internal const string Driver = "driver";
|
||||
internal const string Pwd = "pwd";
|
||||
internal const string UID = "uid";
|
||||
|
||||
// OleDb
|
||||
internal const string DataProvider = "data provider";
|
||||
internal const string ExtendedProperties = "extended properties";
|
||||
internal const string FileName = "file name";
|
||||
internal const string Provider = "provider";
|
||||
internal const string RemoteProvider = "remote provider";
|
||||
|
||||
// common keywords (OleDb, OracleClient, SqlClient)
|
||||
internal const string Password = "password";
|
||||
internal const string UserID = "user id";
|
||||
}
|
||||
|
||||
|
||||
internal static class DbConnectionStringBuilderUtil
|
||||
{
|
||||
internal static bool ConvertToBoolean(object value)
|
||||
{
|
||||
Debug.Assert(null != value, "ConvertToBoolean(null)");
|
||||
string svalue = (value as string);
|
||||
if (null != svalue)
|
||||
{
|
||||
if (StringComparer.OrdinalIgnoreCase.Equals(svalue, "true") || StringComparer.OrdinalIgnoreCase.Equals(svalue, "yes"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (StringComparer.OrdinalIgnoreCase.Equals(svalue, "false") || StringComparer.OrdinalIgnoreCase.Equals(svalue, "no"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
string tmp = svalue.Trim(); // Remove leading & trailing white space.
|
||||
if (StringComparer.OrdinalIgnoreCase.Equals(tmp, "true") || StringComparer.OrdinalIgnoreCase.Equals(tmp, "yes"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (StringComparer.OrdinalIgnoreCase.Equals(tmp, "false") || StringComparer.OrdinalIgnoreCase.Equals(tmp, "no"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return bool.Parse(svalue);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return ((IConvertible)value).ToBoolean(CultureInfo.InvariantCulture);
|
||||
}
|
||||
catch (InvalidCastException e)
|
||||
{
|
||||
throw ADP.ConvertFailed(value.GetType(), typeof(bool), e);
|
||||
}
|
||||
}
|
||||
|
||||
internal static bool ConvertToIntegratedSecurity(object value)
|
||||
{
|
||||
Debug.Assert(null != value, "ConvertToIntegratedSecurity(null)");
|
||||
string svalue = (value as string);
|
||||
if (null != svalue)
|
||||
{
|
||||
if (StringComparer.OrdinalIgnoreCase.Equals(svalue, "sspi") || StringComparer.OrdinalIgnoreCase.Equals(svalue, "true") || StringComparer.OrdinalIgnoreCase.Equals(svalue, "yes"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (StringComparer.OrdinalIgnoreCase.Equals(svalue, "false") || StringComparer.OrdinalIgnoreCase.Equals(svalue, "no"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
string tmp = svalue.Trim(); // Remove leading & trailing white space.
|
||||
if (StringComparer.OrdinalIgnoreCase.Equals(tmp, "sspi") || StringComparer.OrdinalIgnoreCase.Equals(tmp, "true") || StringComparer.OrdinalIgnoreCase.Equals(tmp, "yes"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (StringComparer.OrdinalIgnoreCase.Equals(tmp, "false") || StringComparer.OrdinalIgnoreCase.Equals(tmp, "no"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return bool.Parse(svalue);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return ((IConvertible)value).ToBoolean(CultureInfo.InvariantCulture);
|
||||
}
|
||||
catch (InvalidCastException e)
|
||||
{
|
||||
throw ADP.ConvertFailed(value.GetType(), typeof(bool), e);
|
||||
}
|
||||
}
|
||||
|
||||
internal static int ConvertToInt32(object value)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((IConvertible)value).ToInt32(CultureInfo.InvariantCulture);
|
||||
}
|
||||
catch (InvalidCastException e)
|
||||
{
|
||||
throw ADP.ConvertFailed(value.GetType(), typeof(int), e);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string ConvertToString(object value)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ((IConvertible)value).ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
catch (InvalidCastException e)
|
||||
{
|
||||
throw ADP.ConvertFailed(value.GetType(), typeof(string), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/ExternDll.Linux.cs
vendored
Normal file
12
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/ExternDll.Linux.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.Data.Common
|
||||
{
|
||||
internal static class ExternDll
|
||||
{
|
||||
public const string Odbc32 = "odbc.so.2";
|
||||
}
|
||||
}
|
||||
|
||||
12
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/ExternDll.Osx.cs
vendored
Normal file
12
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/ExternDll.Osx.cs
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.Data.Common
|
||||
{
|
||||
internal static class ExternDll
|
||||
{
|
||||
public const string Odbc32 = "odbc.2";
|
||||
}
|
||||
}
|
||||
|
||||
11
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/ExternDll.Windows.cs
vendored
Normal file
11
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/ExternDll.Windows.cs
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.Data.Common
|
||||
{
|
||||
internal static class ExternDll
|
||||
{
|
||||
public const string Odbc32 = "odbc32.dll";
|
||||
}
|
||||
}
|
||||
291
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/MultipartIdentifier.cs
vendored
Normal file
291
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/MultipartIdentifier.cs
vendored
Normal file
@@ -0,0 +1,291 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Text;
|
||||
|
||||
namespace System.Data.Common
|
||||
{
|
||||
internal class MultipartIdentifier
|
||||
{
|
||||
private const int MaxParts = 4;
|
||||
internal const int ServerIndex = 0;
|
||||
internal const int CatalogIndex = 1;
|
||||
internal const int SchemaIndex = 2;
|
||||
internal const int TableIndex = 3;
|
||||
|
||||
/*
|
||||
Left quote strings need to correspond 1 to 1 with the right quote strings
|
||||
example: "ab" "cd", passed in for the left and the right quote
|
||||
would set a or b as a starting quote character.
|
||||
If a is the starting quote char then c would be the ending quote char
|
||||
otherwise if b is the starting quote char then d would be the ending quote character.
|
||||
*/
|
||||
internal static string[] ParseMultipartIdentifier(string name, string leftQuote, string rightQuote, string property, bool ThrowOnEmptyMultipartName)
|
||||
{
|
||||
return ParseMultipartIdentifier(name, leftQuote, rightQuote, '.', MaxParts, true, property, ThrowOnEmptyMultipartName);
|
||||
}
|
||||
|
||||
private enum MPIState
|
||||
{
|
||||
MPI_Value,
|
||||
MPI_ParseNonQuote,
|
||||
MPI_LookForSeparator,
|
||||
MPI_LookForNextCharOrSeparator,
|
||||
MPI_ParseQuote,
|
||||
MPI_RightQuote,
|
||||
}
|
||||
|
||||
/* Core function for parsing the multipart identifier string.
|
||||
* parameters: name - string to parse
|
||||
* leftquote: set of characters which are valid quoting characters to initiate a quote
|
||||
* rightquote: set of characters which are valid to stop a quote, array index's correspond to the leftquote array.
|
||||
* separator: separator to use
|
||||
* limit: number of names to parse out
|
||||
* removequote:to remove the quotes on the returned string
|
||||
*/
|
||||
private static void IncrementStringCount(string name, string[] ary, ref int position, string property)
|
||||
{
|
||||
++position;
|
||||
int limit = ary.Length;
|
||||
if (position >= limit)
|
||||
{
|
||||
throw ADP.InvalidMultipartNameToManyParts(property, name, limit);
|
||||
}
|
||||
ary[position] = string.Empty;
|
||||
}
|
||||
|
||||
private static bool IsWhitespace(char ch)
|
||||
{
|
||||
return Char.IsWhiteSpace(ch);
|
||||
}
|
||||
|
||||
internal static string[] ParseMultipartIdentifier(string name, string leftQuote, string rightQuote, char separator, int limit, bool removequotes, string property, bool ThrowOnEmptyMultipartName)
|
||||
{
|
||||
if (limit <= 0)
|
||||
{
|
||||
throw ADP.InvalidMultipartNameToManyParts(property, name, limit);
|
||||
}
|
||||
|
||||
if (-1 != leftQuote.IndexOf(separator) || -1 != rightQuote.IndexOf(separator) || leftQuote.Length != rightQuote.Length)
|
||||
{
|
||||
throw ADP.InvalidMultipartNameIncorrectUsageOfQuotes(property, name);
|
||||
}
|
||||
|
||||
string[] parsedNames = new string[limit]; // return string array
|
||||
int stringCount = 0; // index of current string in the buffer
|
||||
MPIState state = MPIState.MPI_Value; // Initialize the starting state
|
||||
|
||||
StringBuilder sb = new StringBuilder(name.Length); // String buffer to hold the string being currently built, init the string builder so it will never be resized
|
||||
StringBuilder whitespaceSB = null; // String buffer to hold white space used when parsing nonquoted strings 'a b . c d' = 'a b' and 'c d'
|
||||
char rightQuoteChar = ' '; // Right quote character to use given the left quote character found.
|
||||
for (int index = 0; index < name.Length; ++index)
|
||||
{
|
||||
char testchar = name[index];
|
||||
switch (state)
|
||||
{
|
||||
case MPIState.MPI_Value:
|
||||
{
|
||||
int quoteIndex;
|
||||
if (IsWhitespace(testchar))
|
||||
{ // Is White Space then skip the whitespace
|
||||
continue;
|
||||
}
|
||||
else
|
||||
if (testchar == separator)
|
||||
{ // If we found a separator, no string was found, initialize the string we are parsing to Empty and the next one to Empty.
|
||||
// This is NOT a redundant setting of string.Empty it solves the case where we are parsing ".foo" and we should be returning null, null, empty, foo
|
||||
parsedNames[stringCount] = string.Empty;
|
||||
IncrementStringCount(name, parsedNames, ref stringCount, property);
|
||||
}
|
||||
else
|
||||
if (-1 != (quoteIndex = leftQuote.IndexOf(testchar)))
|
||||
{ // If we are a left quote
|
||||
rightQuoteChar = rightQuote[quoteIndex]; // record the corresponding right quote for the left quote
|
||||
sb.Length = 0;
|
||||
if (!removequotes)
|
||||
{
|
||||
sb.Append(testchar);
|
||||
}
|
||||
state = MPIState.MPI_ParseQuote;
|
||||
}
|
||||
else
|
||||
if (-1 != rightQuote.IndexOf(testchar))
|
||||
{ // If we shouldn't see a right quote
|
||||
throw ADP.InvalidMultipartNameIncorrectUsageOfQuotes(property, name);
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Length = 0;
|
||||
sb.Append(testchar);
|
||||
state = MPIState.MPI_ParseNonQuote;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case MPIState.MPI_ParseNonQuote:
|
||||
{
|
||||
if (testchar == separator)
|
||||
{
|
||||
parsedNames[stringCount] = sb.ToString(); // set the currently parsed string
|
||||
IncrementStringCount(name, parsedNames, ref stringCount, property);
|
||||
state = MPIState.MPI_Value;
|
||||
}
|
||||
else // Quotes are not valid inside a non-quoted name
|
||||
if (-1 != rightQuote.IndexOf(testchar))
|
||||
{
|
||||
throw ADP.InvalidMultipartNameIncorrectUsageOfQuotes(property, name);
|
||||
}
|
||||
else
|
||||
if (-1 != leftQuote.IndexOf(testchar))
|
||||
{
|
||||
throw ADP.InvalidMultipartNameIncorrectUsageOfQuotes(property, name);
|
||||
}
|
||||
else
|
||||
if (IsWhitespace(testchar))
|
||||
{ // If it is Whitespace
|
||||
parsedNames[stringCount] = sb.ToString(); // Set the currently parsed string
|
||||
if (null == whitespaceSB)
|
||||
{
|
||||
whitespaceSB = new StringBuilder();
|
||||
}
|
||||
whitespaceSB.Length = 0;
|
||||
whitespaceSB.Append(testchar); // start to record the white space, if we are parsing a name like "foo bar" we should return "foo bar"
|
||||
state = MPIState.MPI_LookForNextCharOrSeparator;
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append(testchar);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case MPIState.MPI_LookForNextCharOrSeparator:
|
||||
{
|
||||
if (!IsWhitespace(testchar))
|
||||
{ // If it is not whitespace
|
||||
if (testchar == separator)
|
||||
{
|
||||
IncrementStringCount(name, parsedNames, ref stringCount, property);
|
||||
state = MPIState.MPI_Value;
|
||||
}
|
||||
else
|
||||
{ // If its not a separator and not whitespace
|
||||
sb.Append(whitespaceSB);
|
||||
sb.Append(testchar);
|
||||
parsedNames[stringCount] = sb.ToString(); // Need to set the name here in case the string ends here.
|
||||
state = MPIState.MPI_ParseNonQuote;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
whitespaceSB.Append(testchar);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case MPIState.MPI_ParseQuote:
|
||||
{
|
||||
if (testchar == rightQuoteChar)
|
||||
{ // if se are on a right quote see if we are escaping the right quote or ending the quoted string
|
||||
if (!removequotes)
|
||||
{
|
||||
sb.Append(testchar);
|
||||
}
|
||||
state = MPIState.MPI_RightQuote;
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Append(testchar); // Append what we are currently parsing
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case MPIState.MPI_RightQuote:
|
||||
{
|
||||
if (testchar == rightQuoteChar)
|
||||
{ // If the next char is a another right quote then we were escaping the right quote
|
||||
sb.Append(testchar);
|
||||
state = MPIState.MPI_ParseQuote;
|
||||
}
|
||||
else
|
||||
if (testchar == separator)
|
||||
{ // If its a separator then record what we've parsed
|
||||
parsedNames[stringCount] = sb.ToString();
|
||||
IncrementStringCount(name, parsedNames, ref stringCount, property);
|
||||
state = MPIState.MPI_Value;
|
||||
}
|
||||
else
|
||||
if (!IsWhitespace(testchar))
|
||||
{ // If it is not white space we got problems
|
||||
throw ADP.InvalidMultipartNameIncorrectUsageOfQuotes(property, name);
|
||||
}
|
||||
else
|
||||
{ // It is a whitespace character so the following char should be whitespace, separator, or end of string anything else is bad
|
||||
parsedNames[stringCount] = sb.ToString();
|
||||
state = MPIState.MPI_LookForSeparator;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case MPIState.MPI_LookForSeparator:
|
||||
{
|
||||
if (!IsWhitespace(testchar))
|
||||
{ // If it is not whitespace
|
||||
if (testchar == separator)
|
||||
{ // If it is a separator
|
||||
IncrementStringCount(name, parsedNames, ref stringCount, property);
|
||||
state = MPIState.MPI_Value;
|
||||
}
|
||||
else
|
||||
{ // Otherwise not a separator
|
||||
throw ADP.InvalidMultipartNameIncorrectUsageOfQuotes(property, name);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Resolve final states after parsing the string
|
||||
switch (state)
|
||||
{
|
||||
case MPIState.MPI_Value: // These states require no extra action
|
||||
case MPIState.MPI_LookForSeparator:
|
||||
case MPIState.MPI_LookForNextCharOrSeparator:
|
||||
break;
|
||||
|
||||
case MPIState.MPI_ParseNonQuote: // Dump what ever was parsed
|
||||
case MPIState.MPI_RightQuote:
|
||||
parsedNames[stringCount] = sb.ToString();
|
||||
break;
|
||||
|
||||
case MPIState.MPI_ParseQuote: // Invalid Ending States
|
||||
default:
|
||||
throw ADP.InvalidMultipartNameIncorrectUsageOfQuotes(property, name);
|
||||
}
|
||||
|
||||
if (parsedNames[0] == null)
|
||||
{
|
||||
if (ThrowOnEmptyMultipartName)
|
||||
{
|
||||
throw ADP.InvalidMultipartName(property, name); // Name is entirely made up of whitespace
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Shuffle the parsed name, from left justification to right justification, i.e. [a][b][null][null] goes to [null][null][a][b]
|
||||
int offset = limit - stringCount - 1;
|
||||
if (offset > 0)
|
||||
{
|
||||
for (int x = limit - 1; x >= offset; --x)
|
||||
{
|
||||
parsedNames[x] = parsedNames[x - offset];
|
||||
parsedNames[x - offset] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return parsedNames;
|
||||
}
|
||||
}
|
||||
}
|
||||
69
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/NameValuePair.cs
vendored
Normal file
69
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/NameValuePair.cs
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace System.Data.Common
|
||||
{
|
||||
[Serializable] // MDAC 83147
|
||||
internal sealed class NameValuePair
|
||||
{
|
||||
private readonly string _name;
|
||||
private readonly string _value;
|
||||
[OptionalField(VersionAdded = 2)]
|
||||
private readonly int _length;
|
||||
private NameValuePair _next;
|
||||
|
||||
internal NameValuePair(string name, string value, int length)
|
||||
{
|
||||
System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(name), "empty keyname");
|
||||
_name = name;
|
||||
_value = value;
|
||||
_length = length;
|
||||
}
|
||||
|
||||
internal int Length
|
||||
{
|
||||
get
|
||||
{
|
||||
// this property won't exist when deserialized from Everett to Whidbey
|
||||
// it shouldn't matter for DbConnectionString/DbDataPermission
|
||||
// which should only use Length during construction
|
||||
// not deserialization or post-ctor runtime
|
||||
Debug.Assert(0 < _length, "NameValuePair zero Length usage");
|
||||
return _length;
|
||||
}
|
||||
}
|
||||
internal string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
}
|
||||
internal NameValuePair Next
|
||||
{
|
||||
get
|
||||
{
|
||||
return _next;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((null != _next) || (null == value))
|
||||
{
|
||||
throw ADP.InternalError(ADP.InternalErrorCode.NameValuePairNext);
|
||||
}
|
||||
_next = value;
|
||||
}
|
||||
}
|
||||
internal string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return _value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
290
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/NameValuePermission.cs
vendored
Normal file
290
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/NameValuePermission.cs
vendored
Normal file
@@ -0,0 +1,290 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Collections;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace System.Data.Common
|
||||
{
|
||||
[Serializable] // MDAC 83147
|
||||
internal sealed class NameValuePermission : IComparable
|
||||
{
|
||||
// reused as both key and value nodes
|
||||
// key nodes link to value nodes
|
||||
// value nodes link to key nodes
|
||||
private string _value;
|
||||
|
||||
// value node with (null != _restrictions) are allowed to match connection strings
|
||||
private DBConnectionString _entry;
|
||||
|
||||
private NameValuePermission[] _tree; // with branches
|
||||
|
||||
internal static readonly NameValuePermission Default = null;// = new NameValuePermission(String.Empty, new string[] { "File Name" }, KeyRestrictionBehavior.AllowOnly);
|
||||
|
||||
internal NameValuePermission()
|
||||
{ // root node
|
||||
}
|
||||
|
||||
private NameValuePermission(string keyword)
|
||||
{
|
||||
_value = keyword;
|
||||
}
|
||||
|
||||
private NameValuePermission(string value, DBConnectionString entry)
|
||||
{
|
||||
_value = value;
|
||||
_entry = entry;
|
||||
}
|
||||
|
||||
private NameValuePermission(NameValuePermission permit)
|
||||
{ // deep-copy
|
||||
_value = permit._value;
|
||||
_entry = permit._entry;
|
||||
_tree = permit._tree;
|
||||
if (null != _tree)
|
||||
{
|
||||
NameValuePermission[] tree = (_tree.Clone() as NameValuePermission[]);
|
||||
for (int i = 0; i < tree.Length; ++i)
|
||||
{
|
||||
if (null != tree[i])
|
||||
{ // WebData 98488
|
||||
tree[i] = tree[i].CopyNameValue(); // deep copy
|
||||
}
|
||||
}
|
||||
_tree = tree;
|
||||
}
|
||||
}
|
||||
|
||||
int IComparable.CompareTo(object a)
|
||||
{
|
||||
return StringComparer.Ordinal.Compare(_value, ((NameValuePermission)a)._value);
|
||||
}
|
||||
|
||||
internal static void AddEntry(NameValuePermission kvtree, ArrayList entries, DBConnectionString entry)
|
||||
{
|
||||
Debug.Assert(null != entry, "null DBConnectionString");
|
||||
|
||||
if (null != entry.KeyChain)
|
||||
{
|
||||
for (NameValuePair keychain = entry.KeyChain; null != keychain; keychain = keychain.Next)
|
||||
{
|
||||
NameValuePermission kv;
|
||||
|
||||
kv = kvtree.CheckKeyForValue(keychain.Name);
|
||||
if (null == kv)
|
||||
{
|
||||
kv = new NameValuePermission(keychain.Name);
|
||||
kvtree.Add(kv); // add directly into live tree
|
||||
}
|
||||
kvtree = kv;
|
||||
|
||||
kv = kvtree.CheckKeyForValue(keychain.Value);
|
||||
if (null == kv)
|
||||
{
|
||||
DBConnectionString insertValue = ((null != keychain.Next) ? null : entry);
|
||||
kv = new NameValuePermission(keychain.Value, insertValue);
|
||||
kvtree.Add(kv); // add directly into live tree
|
||||
if (null != insertValue)
|
||||
{
|
||||
entries.Add(insertValue);
|
||||
}
|
||||
}
|
||||
else if (null == keychain.Next)
|
||||
{ // shorter chain potential
|
||||
if (null != kv._entry)
|
||||
{
|
||||
Debug.Assert(entries.Contains(kv._entry), "entries doesn't contain entry");
|
||||
entries.Remove(kv._entry);
|
||||
kv._entry = kv._entry.Intersect(entry); // union new restrictions into existing tree
|
||||
}
|
||||
else
|
||||
{
|
||||
kv._entry = entry;
|
||||
}
|
||||
entries.Add(kv._entry);
|
||||
}
|
||||
kvtree = kv;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // global restrictions, MDAC 84443
|
||||
DBConnectionString kentry = kvtree._entry;
|
||||
if (null != kentry)
|
||||
{
|
||||
Debug.Assert(entries.Contains(kentry), "entries doesn't contain entry");
|
||||
entries.Remove(kentry);
|
||||
kvtree._entry = kentry.Intersect(entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
kvtree._entry = entry;
|
||||
}
|
||||
entries.Add(kvtree._entry);
|
||||
}
|
||||
}
|
||||
|
||||
internal void Intersect(ArrayList entries, NameValuePermission target)
|
||||
{
|
||||
if (null == target)
|
||||
{
|
||||
_tree = null;
|
||||
_entry = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (null != _entry)
|
||||
{
|
||||
entries.Remove(_entry);
|
||||
_entry = _entry.Intersect(target._entry);
|
||||
entries.Add(_entry);
|
||||
}
|
||||
else if (null != target._entry)
|
||||
{
|
||||
_entry = target._entry.Intersect(null);
|
||||
entries.Add(_entry);
|
||||
}
|
||||
|
||||
if (null != _tree)
|
||||
{
|
||||
int count = _tree.Length;
|
||||
for (int i = 0; i < _tree.Length; ++i)
|
||||
{
|
||||
NameValuePermission kvtree = target.CheckKeyForValue(_tree[i]._value);
|
||||
if (null != kvtree)
|
||||
{ // does target tree contain our value
|
||||
_tree[i].Intersect(entries, kvtree);
|
||||
}
|
||||
else
|
||||
{
|
||||
_tree[i] = null;
|
||||
--count;
|
||||
}
|
||||
}
|
||||
if (0 == count)
|
||||
{
|
||||
_tree = null;
|
||||
}
|
||||
else if (count < _tree.Length)
|
||||
{
|
||||
NameValuePermission[] kvtree = new NameValuePermission[count];
|
||||
for (int i = 0, j = 0; i < _tree.Length; ++i)
|
||||
{
|
||||
if (null != _tree[i])
|
||||
{
|
||||
kvtree[j++] = _tree[i];
|
||||
}
|
||||
}
|
||||
_tree = kvtree;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Add(NameValuePermission permit)
|
||||
{
|
||||
NameValuePermission[] tree = _tree;
|
||||
int length = ((null != tree) ? tree.Length : 0);
|
||||
NameValuePermission[] newtree = new NameValuePermission[1 + length];
|
||||
for (int i = 0; i < newtree.Length - 1; ++i)
|
||||
{
|
||||
newtree[i] = tree[i];
|
||||
}
|
||||
newtree[length] = permit;
|
||||
Array.Sort(newtree);
|
||||
_tree = newtree;
|
||||
}
|
||||
|
||||
internal bool CheckValueForKeyPermit(DBConnectionString parsetable)
|
||||
{
|
||||
if (null == parsetable)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool hasMatch = false;
|
||||
NameValuePermission[] keytree = _tree; // _tree won't mutate but Add will replace it
|
||||
if (null != keytree)
|
||||
{
|
||||
hasMatch = parsetable.IsEmpty; // MDAC 86773
|
||||
if (!hasMatch)
|
||||
{
|
||||
// which key do we follow the key-value chain on
|
||||
for (int i = 0; i < keytree.Length; ++i)
|
||||
{
|
||||
NameValuePermission permitKey = keytree[i];
|
||||
if (null != permitKey)
|
||||
{
|
||||
string keyword = permitKey._value;
|
||||
#if DEBUG
|
||||
Debug.Assert(null == permitKey._entry, "key member has no restrictions");
|
||||
#endif
|
||||
if (parsetable.ContainsKey(keyword))
|
||||
{
|
||||
string valueInQuestion = (string)parsetable[keyword];
|
||||
|
||||
// keyword is restricted to certain values
|
||||
NameValuePermission permitValue = permitKey.CheckKeyForValue(valueInQuestion);
|
||||
if (null != permitValue)
|
||||
{
|
||||
//value does match - continue the chain down that branch
|
||||
if (permitValue.CheckValueForKeyPermit(parsetable))
|
||||
{
|
||||
hasMatch = true;
|
||||
// adding a break statement is tempting, but wrong
|
||||
// user can safetly extend their restrictions for current rule to include missing keyword
|
||||
// i.e. Add("provider=sqloledb;integrated security=sspi", "data provider=", KeyRestrictionBehavior.AllowOnly);
|
||||
// i.e. Add("data provider=msdatashape;provider=sqloledb;integrated security=sspi", "", KeyRestrictionBehavior.AllowOnly);
|
||||
}
|
||||
else
|
||||
{ // failed branch checking
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // value doesn't match to expected values - fail here
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// else try next keyword
|
||||
}
|
||||
}
|
||||
// partial chain match, either leaf-node by shorter chain or fail mid-chain if (null == _restrictions)
|
||||
}
|
||||
|
||||
DBConnectionString entry = _entry;
|
||||
if (null != entry)
|
||||
{
|
||||
// also checking !hasMatch is tempting, but wrong
|
||||
// user can safetly extend their restrictions for current rule to include missing keyword
|
||||
// i.e. Add("provider=sqloledb;integrated security=sspi", "data provider=", KeyRestrictionBehavior.AllowOnly);
|
||||
// i.e. Add("provider=sqloledb;", "integrated security=;", KeyRestrictionBehavior.AllowOnly);
|
||||
hasMatch = entry.IsSupersetOf(parsetable);
|
||||
}
|
||||
|
||||
return hasMatch; // mid-chain failure
|
||||
}
|
||||
|
||||
private NameValuePermission CheckKeyForValue(string keyInQuestion)
|
||||
{
|
||||
NameValuePermission[] valuetree = _tree; // _tree won't mutate but Add will replace it
|
||||
if (null != valuetree)
|
||||
{
|
||||
for (int i = 0; i < valuetree.Length; ++i)
|
||||
{
|
||||
NameValuePermission permitValue = valuetree[i];
|
||||
if (String.Equals(keyInQuestion, permitValue._value, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return permitValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
internal NameValuePermission CopyNameValue()
|
||||
{
|
||||
return new NameValuePermission(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
130
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/ReadOnlyCollection.cs
vendored
Normal file
130
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/ReadOnlyCollection.cs
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace System.Data.Common
|
||||
{
|
||||
[Serializable()]
|
||||
internal sealed class ReadOnlyCollection<T> : System.Collections.ICollection, ICollection<T>
|
||||
{
|
||||
private T[] _items;
|
||||
|
||||
internal ReadOnlyCollection(T[] items)
|
||||
{
|
||||
_items = items;
|
||||
#if DEBUG
|
||||
for (int i = 0; i < items.Length; ++i)
|
||||
{
|
||||
Debug.Assert(null != items[i], "null item");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public void CopyTo(T[] array, int arrayIndex)
|
||||
{
|
||||
Array.Copy(_items, 0, array, arrayIndex, _items.Length);
|
||||
}
|
||||
|
||||
void System.Collections.ICollection.CopyTo(Array array, int arrayIndex)
|
||||
{
|
||||
Array.Copy(_items, 0, array, arrayIndex, _items.Length);
|
||||
}
|
||||
|
||||
|
||||
IEnumerator<T> IEnumerable<T>.GetEnumerator()
|
||||
{
|
||||
return new Enumerator<T>(_items);
|
||||
}
|
||||
|
||||
public System.Collections.IEnumerator GetEnumerator()
|
||||
{
|
||||
return new Enumerator<T>(_items);
|
||||
}
|
||||
|
||||
bool System.Collections.ICollection.IsSynchronized
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
Object System.Collections.ICollection.SyncRoot
|
||||
{
|
||||
get { return _items; }
|
||||
}
|
||||
|
||||
bool ICollection<T>.IsReadOnly
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
void ICollection<T>.Add(T value)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
void ICollection<T>.Clear()
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
bool ICollection<T>.Contains(T value)
|
||||
{
|
||||
return Array.IndexOf(_items, value) >= 0;
|
||||
}
|
||||
|
||||
bool ICollection<T>.Remove(T value)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get { return _items.Length; }
|
||||
}
|
||||
|
||||
[Serializable()]
|
||||
internal struct Enumerator<K> : IEnumerator<K>, System.Collections.IEnumerator
|
||||
{ // based on List<T>.Enumerator
|
||||
private K[] _items;
|
||||
private int _index;
|
||||
|
||||
internal Enumerator(K[] items)
|
||||
{
|
||||
_items = items;
|
||||
_index = -1;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
public bool MoveNext()
|
||||
{
|
||||
return (++_index < _items.Length);
|
||||
}
|
||||
|
||||
public K Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return _items[_index];
|
||||
}
|
||||
}
|
||||
|
||||
Object System.Collections.IEnumerator.Current
|
||||
{
|
||||
get
|
||||
{
|
||||
return _items[_index];
|
||||
}
|
||||
}
|
||||
|
||||
void System.Collections.IEnumerator.Reset()
|
||||
{
|
||||
_index = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
25
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/SafeNativeMethods.cs
vendored
Normal file
25
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/SafeNativeMethods.cs
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Data.Common
|
||||
{
|
||||
internal class SafeNativeMethods
|
||||
{
|
||||
internal static IntPtr LocalAlloc(IntPtr initialSize)
|
||||
{
|
||||
var handle = Marshal.AllocHGlobal(initialSize);
|
||||
ZeroMemory(handle, (int)initialSize);
|
||||
return handle;
|
||||
}
|
||||
|
||||
internal static void LocalFree(IntPtr ptr)
|
||||
{
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
}
|
||||
|
||||
internal static void ZeroMemory(IntPtr ptr, int length)
|
||||
{
|
||||
var zeroes = new byte[length];
|
||||
Marshal.Copy(zeroes, 0, ptr, length);
|
||||
}
|
||||
}
|
||||
}
|
||||
459
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/UnsafeNativeMethods.cs
vendored
Normal file
459
external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/UnsafeNativeMethods.cs
vendored
Normal file
@@ -0,0 +1,459 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Data.Odbc;
|
||||
using System.Runtime.ConstrainedExecution;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Security;
|
||||
using System.Text;
|
||||
|
||||
namespace System.Data.Common
|
||||
{
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
internal static partial class UnsafeNativeMethods
|
||||
{
|
||||
|
||||
//
|
||||
// ODBC32
|
||||
//
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLAllocHandle(
|
||||
/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
|
||||
/*SQLHANDLE*/IntPtr InputHandle,
|
||||
/*SQLHANDLE* */out IntPtr OutputHandle);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLAllocHandle(
|
||||
/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
|
||||
/*SQLHANDLE*/OdbcHandle InputHandle,
|
||||
/*SQLHANDLE* */out IntPtr OutputHandle);
|
||||
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLBindCol(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
/*SQLUSMALLINT*/UInt16 ColumnNumber,
|
||||
/*SQLSMALLINT*/ODBC32.SQL_C TargetType,
|
||||
/*SQLPOINTER*/HandleRef TargetValue,
|
||||
/*SQLLEN*/IntPtr BufferLength,
|
||||
/*SQLLEN* */IntPtr StrLen_or_Ind);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLBindCol(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
/*SQLUSMALLINT*/UInt16 ColumnNumber,
|
||||
/*SQLSMALLINT*/ODBC32.SQL_C TargetType,
|
||||
/*SQLPOINTER*/IntPtr TargetValue,
|
||||
/*SQLLEN*/IntPtr BufferLength,
|
||||
/*SQLLEN* */IntPtr StrLen_or_Ind);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLBindParameter(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
/*SQLUSMALLINT*/UInt16 ParameterNumber,
|
||||
/*SQLSMALLINT*/Int16 ParamDirection,
|
||||
/*SQLSMALLINT*/ODBC32.SQL_C SQLCType,
|
||||
/*SQLSMALLINT*/Int16 SQLType,
|
||||
/*SQLULEN*/IntPtr cbColDef,
|
||||
/*SQLSMALLINT*/IntPtr ibScale,
|
||||
/*SQLPOINTER*/HandleRef rgbValue,
|
||||
/*SQLLEN*/IntPtr BufferLength,
|
||||
/*SQLLEN* */HandleRef StrLen_or_Ind);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLCancel(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLCloseCursor(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLColAttributeW(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
/*SQLUSMALLINT*/Int16 ColumnNumber,
|
||||
/*SQLUSMALLINT*/Int16 FieldIdentifier,
|
||||
/*SQLPOINTER*/CNativeBuffer CharacterAttribute,
|
||||
/*SQLSMALLINT*/Int16 BufferLength,
|
||||
/*SQLSMALLINT* */out Int16 StringLength,
|
||||
/*SQLPOINTER*/out IntPtr NumericAttribute);
|
||||
|
||||
// note: in sql.h this is defined differently for the 64Bit platform.
|
||||
// However, for us the code is not different for SQLPOINTER or SQLLEN ...
|
||||
// frome sql.h:
|
||||
// #ifdef _WIN64
|
||||
// SQLRETURN SQL_API SQLColAttribute (SQLHSTMT StatementHandle,
|
||||
// SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier,
|
||||
// SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength,
|
||||
// SQLSMALLINT *StringLength, SQLLEN *NumericAttribute);
|
||||
// #else
|
||||
// SQLRETURN SQL_API SQLColAttribute (SQLHSTMT StatementHandle,
|
||||
// SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier,
|
||||
// SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength,
|
||||
// SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute);
|
||||
// #endif
|
||||
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLColumnsW(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string CatalogName,
|
||||
/*SQLSMALLINT*/Int16 NameLen1,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string SchemaName,
|
||||
/*SQLSMALLINT*/Int16 NameLen2,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string TableName,
|
||||
/*SQLSMALLINT*/Int16 NameLen3,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string ColumnName,
|
||||
/*SQLSMALLINT*/Int16 NameLen4);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLDisconnect(
|
||||
/*SQLHDBC*/IntPtr ConnectionHandle);
|
||||
|
||||
[DllImport(ExternDll.Odbc32, CharSet = CharSet.Unicode)]
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLDriverConnectW(
|
||||
/*SQLHDBC*/OdbcConnectionHandle hdbc,
|
||||
/*SQLHWND*/IntPtr hwnd,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string connectionstring,
|
||||
/*SQLSMALLINT*/Int16 cbConnectionstring,
|
||||
/*SQLCHAR* */IntPtr connectionstringout,
|
||||
/*SQLSMALLINT*/Int16 cbConnectionstringoutMax,
|
||||
/*SQLSMALLINT* */out Int16 cbConnectionstringout,
|
||||
/*SQLUSMALLINT*/Int16 fDriverCompletion);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLEndTran(
|
||||
/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
|
||||
/*SQLHANDLE*/IntPtr Handle,
|
||||
/*SQLSMALLINT*/Int16 CompletionType);
|
||||
|
||||
[DllImport(ExternDll.Odbc32, CharSet = CharSet.Unicode)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLExecDirectW(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string StatementText,
|
||||
/*SQLINTEGER*/Int32 TextLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLExecute(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLFetch(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLFreeHandle(
|
||||
/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
|
||||
/*SQLHSTMT*/IntPtr StatementHandle);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLFreeStmt(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
/*SQLUSMALLINT*/ODBC32.STMT Option);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetConnectAttrW(
|
||||
/*SQLHBDC*/OdbcConnectionHandle ConnectionHandle,
|
||||
/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
|
||||
/*SQLPOINTER*/byte[] Value,
|
||||
/*SQLINTEGER*/Int32 BufferLength,
|
||||
/*SQLINTEGER* */out Int32 StringLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetData(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
/*SQLUSMALLINT*/UInt16 ColumnNumber,
|
||||
/*SQLSMALLINT*/ODBC32.SQL_C TargetType,
|
||||
/*SQLPOINTER*/CNativeBuffer TargetValue,
|
||||
/*SQLLEN*/IntPtr BufferLength, // sql.h differs from MSDN
|
||||
/*SQLLEN* */out IntPtr StrLen_or_Ind);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetDescFieldW(
|
||||
/*SQLHSTMT*/OdbcDescriptorHandle StatementHandle,
|
||||
/*SQLUSMALLINT*/Int16 RecNumber,
|
||||
/*SQLUSMALLINT*/ODBC32.SQL_DESC FieldIdentifier,
|
||||
/*SQLPOINTER*/CNativeBuffer ValuePointer,
|
||||
/*SQLINTEGER*/Int32 BufferLength,
|
||||
/*SQLINTEGER* */out Int32 StringLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32, CharSet = CharSet.Unicode)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetDiagRecW(
|
||||
/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType,
|
||||
/*SQLHANDLE*/OdbcHandle Handle,
|
||||
/*SQLSMALLINT*/Int16 RecNumber,
|
||||
/*SQLCHAR* */ StringBuilder rchState,
|
||||
/*SQLINTEGER* */out Int32 NativeError,
|
||||
/*SQLCHAR* */StringBuilder MessageText,
|
||||
/*SQLSMALLINT*/Int16 BufferLength,
|
||||
/*SQLSMALLINT* */out Int16 TextLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32, CharSet = CharSet.Unicode)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetDiagFieldW(
|
||||
/*SQLSMALLINT*/ ODBC32.SQL_HANDLE HandleType,
|
||||
/*SQLHANDLE*/ OdbcHandle Handle,
|
||||
/*SQLSMALLINT*/ Int16 RecNumber,
|
||||
/*SQLSMALLINT*/ Int16 DiagIdentifier,
|
||||
[MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLPOINTER*/ StringBuilder rchState,
|
||||
/*SQLSMALLINT*/ Int16 BufferLength,
|
||||
/*SQLSMALLINT* */ out Int16 StringLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetFunctions(
|
||||
/*SQLHBDC*/OdbcConnectionHandle hdbc,
|
||||
/*SQLUSMALLINT*/ODBC32.SQL_API fFunction,
|
||||
/*SQLUSMALLINT* */out Int16 pfExists);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetInfoW(
|
||||
/*SQLHBDC*/OdbcConnectionHandle hdbc,
|
||||
/*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType,
|
||||
/*SQLPOINTER*/byte[] rgbInfoValue,
|
||||
/*SQLSMALLINT*/Int16 cbInfoValueMax,
|
||||
/*SQLSMALLINT* */out Int16 pcbInfoValue);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetInfoW(
|
||||
/*SQLHBDC*/OdbcConnectionHandle hdbc,
|
||||
/*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType,
|
||||
/*SQLPOINTER*/byte[] rgbInfoValue,
|
||||
/*SQLSMALLINT*/Int16 cbInfoValueMax,
|
||||
/*SQLSMALLINT* */IntPtr pcbInfoValue);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetStmtAttrW(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
|
||||
/*SQLPOINTER*/out IntPtr Value,
|
||||
/*SQLINTEGER*/Int32 BufferLength,
|
||||
/*SQLINTEGER*/out Int32 StringLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetTypeInfo(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
/*SQLSMALLINT*/Int16 fSqlType);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLMoreResults(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLNumResultCols(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
/*SQLSMALLINT* */out Int16 ColumnCount);
|
||||
|
||||
[DllImport(ExternDll.Odbc32, CharSet = CharSet.Unicode)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLPrepareW(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string StatementText,
|
||||
/*SQLINTEGER*/Int32 TextLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32, CharSet = CharSet.Unicode)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLPrimaryKeysW(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string CatalogName,
|
||||
/*SQLSMALLINT*/Int16 NameLen1,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */ string SchemaName,
|
||||
/*SQLSMALLINT*/Int16 NameLen2,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string TableName,
|
||||
/*SQLSMALLINT*/Int16 NameLen3);
|
||||
|
||||
[DllImport(ExternDll.Odbc32, CharSet = CharSet.Unicode)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLProcedureColumnsW(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] /*SQLCHAR* */ string CatalogName,
|
||||
/*SQLSMALLINT*/Int16 NameLen1,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] /*SQLCHAR* */ string SchemaName,
|
||||
/*SQLSMALLINT*/Int16 NameLen2,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] /*SQLCHAR* */ string ProcName,
|
||||
/*SQLSMALLINT*/Int16 NameLen3,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] /*SQLCHAR* */ string ColumnName,
|
||||
/*SQLSMALLINT*/Int16 NameLen4);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLProceduresW(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] /*SQLCHAR* */ string CatalogName,
|
||||
/*SQLSMALLINT*/Int16 NameLen1,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] /*SQLCHAR* */ string SchemaName,
|
||||
/*SQLSMALLINT*/Int16 NameLen2,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] /*SQLCHAR* */ string ProcName,
|
||||
/*SQLSMALLINT*/Int16 NameLen3);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLRowCount(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
/*SQLLEN* */out IntPtr RowCount);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetConnectAttrW(
|
||||
/*SQLHBDC*/OdbcConnectionHandle ConnectionHandle,
|
||||
/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
|
||||
/*SQLPOINTER*/System.Transactions.IDtcTransaction Value,
|
||||
/*SQLINTEGER*/Int32 StringLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32, CharSet = CharSet.Unicode)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetConnectAttrW(
|
||||
/*SQLHBDC*/OdbcConnectionHandle ConnectionHandle,
|
||||
/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
|
||||
/*SQLPOINTER*/string Value,
|
||||
/*SQLINTEGER*/Int32 StringLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetConnectAttrW(
|
||||
/*SQLHBDC*/OdbcConnectionHandle ConnectionHandle,
|
||||
/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
|
||||
/*SQLPOINTER*/IntPtr Value,
|
||||
/*SQLINTEGER*/Int32 StringLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetConnectAttrW( // used only for AutoCommitOn
|
||||
/*SQLHBDC*/IntPtr ConnectionHandle,
|
||||
/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
|
||||
/*SQLPOINTER*/IntPtr Value,
|
||||
/*SQLINTEGER*/Int32 StringLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetDescFieldW(
|
||||
/*SQLHSTMT*/OdbcDescriptorHandle StatementHandle,
|
||||
/*SQLSMALLINT*/Int16 ColumnNumber,
|
||||
/*SQLSMALLINT*/ODBC32.SQL_DESC FieldIdentifier,
|
||||
/*SQLPOINTER*/HandleRef CharacterAttribute,
|
||||
/*SQLINTEGER*/Int32 BufferLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetDescFieldW(
|
||||
/*SQLHSTMT*/OdbcDescriptorHandle StatementHandle,
|
||||
/*SQLSMALLINT*/Int16 ColumnNumber,
|
||||
/*SQLSMALLINT*/ODBC32.SQL_DESC FieldIdentifier,
|
||||
/*SQLPOINTER*/IntPtr CharacterAttribute,
|
||||
/*SQLINTEGER*/Int32 BufferLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
// user can set SQL_ATTR_CONNECTION_POOLING attribute with envHandle = null, this attribute is process-level attribute
|
||||
[ResourceExposure(ResourceScope.Process)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetEnvAttr(
|
||||
/*SQLHENV*/OdbcEnvironmentHandle EnvironmentHandle,
|
||||
/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute,
|
||||
/*SQLPOINTER*/IntPtr Value,
|
||||
/*SQLINTEGER*/ODBC32.SQL_IS StringLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetStmtAttrW(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
/*SQLINTEGER*/Int32 Attribute,
|
||||
/*SQLPOINTER*/IntPtr Value,
|
||||
/*SQLINTEGER*/Int32 StringLength);
|
||||
|
||||
[DllImport(ExternDll.Odbc32, CharSet = CharSet.Unicode)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSpecialColumnsW(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
/*SQLUSMALLINT*/ODBC32.SQL_SPECIALCOLS IdentifierType,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string CatalogName,
|
||||
/*SQLSMALLINT*/Int16 NameLen1,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string SchemaName,
|
||||
/*SQLSMALLINT*/Int16 NameLen2,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string TableName,
|
||||
/*SQLSMALLINT*/Int16 NameLen3,
|
||||
/*SQLUSMALLINT*/ODBC32.SQL_SCOPE Scope,
|
||||
/*SQLUSMALLINT*/ ODBC32.SQL_NULLABILITY Nullable);
|
||||
|
||||
[DllImport(ExternDll.Odbc32, CharSet = CharSet.Unicode)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLStatisticsW(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string CatalogName,
|
||||
/*SQLSMALLINT*/Int16 NameLen1,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string SchemaName,
|
||||
/*SQLSMALLINT*/Int16 NameLen2,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string TableName,
|
||||
/*SQLSMALLINT*/Int16 NameLen3,
|
||||
/*SQLUSMALLINT*/Int16 Unique,
|
||||
/*SQLUSMALLINT*/Int16 Reserved);
|
||||
|
||||
[DllImport(ExternDll.Odbc32)]
|
||||
[ResourceExposure(ResourceScope.None)]
|
||||
internal static extern /*SQLRETURN*/ODBC32.RetCode SQLTablesW(
|
||||
/*SQLHSTMT*/OdbcStatementHandle StatementHandle,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string CatalogName,
|
||||
/*SQLSMALLINT*/Int16 NameLen1,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string SchemaName,
|
||||
/*SQLSMALLINT*/Int16 NameLen2,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string TableName,
|
||||
/*SQLSMALLINT*/Int16 NameLen3,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)]
|
||||
/*SQLCHAR* */string TableType,
|
||||
/*SQLSMALLINT*/Int16 NameLen4);
|
||||
}
|
||||
}
|
||||
16
external/corefx/src/System.Data.Odbc/src/Common/System/Data/DataStorage.cs
vendored
Normal file
16
external/corefx/src/System.Data.Odbc/src/Common/System/Data/DataStorage.cs
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// Remove when fully integrated
|
||||
|
||||
namespace System.Data.Common
|
||||
{
|
||||
internal abstract class DataStorage
|
||||
{
|
||||
internal static bool IsSqlType(object storageType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user