You've already forked linux-packaging-mono
Imported Upstream version 5.0.0.42
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
parent
1190d13a04
commit
6bdd276d05
122
external/corefx/src/System.Data.SqlClient/System.Data.SqlClient.sln
vendored
Normal file
122
external/corefx/src/System.Data.SqlClient/System.Data.SqlClient.sln
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
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.SqlClient", "src\System.Data.SqlClient.csproj", "{D4550556-4745-457F-BA8F-3EBF3836D6B4}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{ECE6CCAC-682B-4054-B737-E6DB4A4FA79A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.SqlClient.Tests", "tests\FunctionalTests\System.Data.SqlClient.Tests.csproj", "{F3E72F35-0351-4D67-9388-725BCAD807BA}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.SqlClient.ManualTesting.Tests", "tests\ManualTests\System.Data.SqlClient.ManualTesting.Tests.csproj", "{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.SqlClient.Stress.Tests", "tests\StressTests\System.Data.SqlClient.Stress.Tests\System.Data.SqlClient.Stress.Tests.csproj", "{B94B8E6D-3E41-4046-B758-4A2E281F74EE}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TDS.EndPoint", "tests\Tools\TDS\TDS.EndPoint\TDS.EndPoint.csproj", "{1FF891B4-D3DE-4CCE-887C-CB48F5351A45}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TDS.Servers", "tests\Tools\TDS\TDS.Servers\TDS.Servers.csproj", "{978063D3-FBB5-4E10-8C45-67C90BE1B931}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TDS", "tests\Tools\TDS\TDS\TDS.csproj", "{8DC9D1A0-351B-47BC-A90F-B9DA542550E9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Unix_Debug|Any CPU = Unix_Debug|Any CPU
|
||||
Unix_Release|Any CPU = Unix_Release|Any CPU
|
||||
Windows_Debug|Any CPU = Windows_Debug|Any CPU
|
||||
Windows_Release|Any CPU = Windows_Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D4550556-4745-457F-BA8F-3EBF3836D6B4}.Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
|
||||
{D4550556-4745-457F-BA8F-3EBF3836D6B4}.Debug|Any CPU.Build.0 = Windows_Debug|Any CPU
|
||||
{D4550556-4745-457F-BA8F-3EBF3836D6B4}.Release|Any CPU.ActiveCfg = Unix_Release|Any CPU
|
||||
{D4550556-4745-457F-BA8F-3EBF3836D6B4}.Release|Any CPU.Build.0 = Unix_Release|Any CPU
|
||||
{D4550556-4745-457F-BA8F-3EBF3836D6B4}.Unix_Debug|Any CPU.ActiveCfg = Unix_Debug|Any CPU
|
||||
{D4550556-4745-457F-BA8F-3EBF3836D6B4}.Unix_Release|Any CPU.ActiveCfg = Unix_Release|Any CPU
|
||||
{D4550556-4745-457F-BA8F-3EBF3836D6B4}.Windows_Debug|Any CPU.ActiveCfg = Unix_Release|Any CPU
|
||||
{D4550556-4745-457F-BA8F-3EBF3836D6B4}.Windows_Release|Any CPU.ActiveCfg = Unix_Release|Any CPU
|
||||
{F3E72F35-0351-4D67-9388-725BCAD807BA}.Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
|
||||
{F3E72F35-0351-4D67-9388-725BCAD807BA}.Debug|Any CPU.Build.0 = Windows_Debug|Any CPU
|
||||
{F3E72F35-0351-4D67-9388-725BCAD807BA}.Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{F3E72F35-0351-4D67-9388-725BCAD807BA}.Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{F3E72F35-0351-4D67-9388-725BCAD807BA}.Unix_Debug|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{F3E72F35-0351-4D67-9388-725BCAD807BA}.Unix_Debug|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{F3E72F35-0351-4D67-9388-725BCAD807BA}.Unix_Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{F3E72F35-0351-4D67-9388-725BCAD807BA}.Unix_Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{F3E72F35-0351-4D67-9388-725BCAD807BA}.Windows_Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
|
||||
{F3E72F35-0351-4D67-9388-725BCAD807BA}.Windows_Debug|Any CPU.Build.0 = Windows_Debug|Any CPU
|
||||
{F3E72F35-0351-4D67-9388-725BCAD807BA}.Windows_Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{F3E72F35-0351-4D67-9388-725BCAD807BA}.Windows_Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}.Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
|
||||
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}.Debug|Any CPU.Build.0 = Windows_Debug|Any CPU
|
||||
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}.Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}.Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}.Unix_Debug|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}.Unix_Debug|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}.Unix_Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}.Unix_Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}.Windows_Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
|
||||
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}.Windows_Debug|Any CPU.Build.0 = Windows_Debug|Any CPU
|
||||
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}.Windows_Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5}.Windows_Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{B94B8E6D-3E41-4046-B758-4A2E281F74EE}.Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
|
||||
{B94B8E6D-3E41-4046-B758-4A2E281F74EE}.Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{B94B8E6D-3E41-4046-B758-4A2E281F74EE}.Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{B94B8E6D-3E41-4046-B758-4A2E281F74EE}.Unix_Debug|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{B94B8E6D-3E41-4046-B758-4A2E281F74EE}.Unix_Debug|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{B94B8E6D-3E41-4046-B758-4A2E281F74EE}.Unix_Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{B94B8E6D-3E41-4046-B758-4A2E281F74EE}.Unix_Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{B94B8E6D-3E41-4046-B758-4A2E281F74EE}.Windows_Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
|
||||
{B94B8E6D-3E41-4046-B758-4A2E281F74EE}.Windows_Debug|Any CPU.Build.0 = Windows_Debug|Any CPU
|
||||
{B94B8E6D-3E41-4046-B758-4A2E281F74EE}.Windows_Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{B94B8E6D-3E41-4046-B758-4A2E281F74EE}.Windows_Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{1FF891B4-D3DE-4CCE-887C-CB48F5351A45}.Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
|
||||
{1FF891B4-D3DE-4CCE-887C-CB48F5351A45}.Debug|Any CPU.Build.0 = Windows_Debug|Any CPU
|
||||
{1FF891B4-D3DE-4CCE-887C-CB48F5351A45}.Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{1FF891B4-D3DE-4CCE-887C-CB48F5351A45}.Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{1FF891B4-D3DE-4CCE-887C-CB48F5351A45}.Unix_Debug|Any CPU.ActiveCfg = Unix_Debug|Any CPU
|
||||
{1FF891B4-D3DE-4CCE-887C-CB48F5351A45}.Unix_Debug|Any CPU.Build.0 = Unix_Debug|Any CPU
|
||||
{1FF891B4-D3DE-4CCE-887C-CB48F5351A45}.Unix_Release|Any CPU.ActiveCfg = Unix_Release|Any CPU
|
||||
{1FF891B4-D3DE-4CCE-887C-CB48F5351A45}.Unix_Release|Any CPU.Build.0 = Unix_Release|Any CPU
|
||||
{1FF891B4-D3DE-4CCE-887C-CB48F5351A45}.Windows_Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
|
||||
{1FF891B4-D3DE-4CCE-887C-CB48F5351A45}.Windows_Debug|Any CPU.Build.0 = Windows_Debug|Any CPU
|
||||
{1FF891B4-D3DE-4CCE-887C-CB48F5351A45}.Windows_Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{1FF891B4-D3DE-4CCE-887C-CB48F5351A45}.Windows_Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{978063D3-FBB5-4E10-8C45-67C90BE1B931}.Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
|
||||
{978063D3-FBB5-4E10-8C45-67C90BE1B931}.Debug|Any CPU.Build.0 = Windows_Debug|Any CPU
|
||||
{978063D3-FBB5-4E10-8C45-67C90BE1B931}.Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{978063D3-FBB5-4E10-8C45-67C90BE1B931}.Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{978063D3-FBB5-4E10-8C45-67C90BE1B931}.Unix_Debug|Any CPU.ActiveCfg = Unix_Debug|Any CPU
|
||||
{978063D3-FBB5-4E10-8C45-67C90BE1B931}.Unix_Debug|Any CPU.Build.0 = Unix_Debug|Any CPU
|
||||
{978063D3-FBB5-4E10-8C45-67C90BE1B931}.Unix_Release|Any CPU.ActiveCfg = Unix_Release|Any CPU
|
||||
{978063D3-FBB5-4E10-8C45-67C90BE1B931}.Unix_Release|Any CPU.Build.0 = Unix_Release|Any CPU
|
||||
{978063D3-FBB5-4E10-8C45-67C90BE1B931}.Windows_Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
|
||||
{978063D3-FBB5-4E10-8C45-67C90BE1B931}.Windows_Debug|Any CPU.Build.0 = Windows_Debug|Any CPU
|
||||
{978063D3-FBB5-4E10-8C45-67C90BE1B931}.Windows_Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{978063D3-FBB5-4E10-8C45-67C90BE1B931}.Windows_Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{8DC9D1A0-351B-47BC-A90F-B9DA542550E9}.Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
|
||||
{8DC9D1A0-351B-47BC-A90F-B9DA542550E9}.Debug|Any CPU.Build.0 = Windows_Debug|Any CPU
|
||||
{8DC9D1A0-351B-47BC-A90F-B9DA542550E9}.Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{8DC9D1A0-351B-47BC-A90F-B9DA542550E9}.Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
{8DC9D1A0-351B-47BC-A90F-B9DA542550E9}.Unix_Debug|Any CPU.ActiveCfg = Unix_Debug|Any CPU
|
||||
{8DC9D1A0-351B-47BC-A90F-B9DA542550E9}.Unix_Debug|Any CPU.Build.0 = Unix_Debug|Any CPU
|
||||
{8DC9D1A0-351B-47BC-A90F-B9DA542550E9}.Unix_Release|Any CPU.ActiveCfg = Unix_Release|Any CPU
|
||||
{8DC9D1A0-351B-47BC-A90F-B9DA542550E9}.Unix_Release|Any CPU.Build.0 = Unix_Release|Any CPU
|
||||
{8DC9D1A0-351B-47BC-A90F-B9DA542550E9}.Windows_Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
|
||||
{8DC9D1A0-351B-47BC-A90F-B9DA542550E9}.Windows_Debug|Any CPU.Build.0 = Windows_Debug|Any CPU
|
||||
{8DC9D1A0-351B-47BC-A90F-B9DA542550E9}.Windows_Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
|
||||
{8DC9D1A0-351B-47BC-A90F-B9DA542550E9}.Windows_Release|Any CPU.Build.0 = Windows_Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{F3E72F35-0351-4D67-9388-725BCAD807BA} = {ECE6CCAC-682B-4054-B737-E6DB4A4FA79A}
|
||||
{45DB5F86-7AE3-45C6-870D-F9357B66BDB5} = {ECE6CCAC-682B-4054-B737-E6DB4A4FA79A}
|
||||
{B94B8E6D-3E41-4046-B758-4A2E281F74EE} = {ECE6CCAC-682B-4054-B737-E6DB4A4FA79A}
|
||||
{1FF891B4-D3DE-4CCE-887C-CB48F5351A45} = {ECE6CCAC-682B-4054-B737-E6DB4A4FA79A}
|
||||
{978063D3-FBB5-4E10-8C45-67C90BE1B931} = {ECE6CCAC-682B-4054-B737-E6DB4A4FA79A}
|
||||
{8DC9D1A0-351B-47BC-A90F-B9DA542550E9} = {ECE6CCAC-682B-4054-B737-E6DB4A4FA79A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
8
external/corefx/src/System.Data.SqlClient/dir.props
vendored
Normal file
8
external/corefx/src/System.Data.SqlClient/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.1.2.0</AssemblyVersion>
|
||||
<IsNETCoreApp>true</IsNETCoreApp>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
8
external/corefx/src/System.Data.SqlClient/pkg/System.Data.SqlClient.builds
vendored
Normal file
8
external/corefx/src/System.Data.SqlClient/pkg/System.Data.SqlClient.builds
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="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<ItemGroup>
|
||||
<Project Include="System.Data.SqlClient.pkgproj" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
|
||||
</Project>
|
||||
19
external/corefx/src/System.Data.SqlClient/pkg/System.Data.SqlClient.pkgproj
vendored
Normal file
19
external/corefx/src/System.Data.SqlClient/pkg/System.Data.SqlClient.pkgproj
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ref\System.Data.SqlClient.csproj">
|
||||
<SupportedFramework>net463;netcoreapp2.0;$(AllXamarinFrameworks)</SupportedFramework>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\src\System.Data.SqlClient.builds" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InboxOnTargetFramework Include="MonoAndroid10" />
|
||||
<InboxOnTargetFramework Include="MonoTouch10" />
|
||||
<InboxOnTargetFramework Include="xamarinios10" />
|
||||
<InboxOnTargetFramework Include="xamarinmac20" />
|
||||
<InboxOnTargetFramework Include="xamarintvos10" />
|
||||
<InboxOnTargetFramework Include="xamarinwatchos10" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
13
external/corefx/src/System.Data.SqlClient/ref/4.0/System.Data.SqlClient.depproj
vendored
Normal file
13
external/corefx/src/System.Data.SqlClient/ref/4.0/System.Data.SqlClient.depproj
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||||
<OutputType>Library</OutputType>
|
||||
<NuGetTargetMoniker>.NETStandard,Version=v1.2</NuGetTargetMoniker>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="project.json" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
9
external/corefx/src/System.Data.SqlClient/ref/Configurations.props
vendored
Normal file
9
external/corefx/src/System.Data.SqlClient/ref/Configurations.props
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<BuildConfigurations>
|
||||
netcoreapp;
|
||||
uap;
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
39
external/corefx/src/System.Data.SqlClient/ref/System.Data.SqlClient.Manual.cs
vendored
Normal file
39
external/corefx/src/System.Data.SqlClient/ref/System.Data.SqlClient.Manual.cs
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
// 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.
|
||||
// ------------------------------------------------------------------------------
|
||||
// Changes to this file must follow the http://aka.ms/api-review process.
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
namespace System.Data.SqlClient
|
||||
{
|
||||
// Declaring members from stripped base class CollectionBase
|
||||
public sealed partial class SqlBulkCopyColumnMappingCollection : System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList
|
||||
{
|
||||
public int Count { get { throw null; } }
|
||||
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
|
||||
object System.Collections.ICollection.SyncRoot { get { throw null; } }
|
||||
bool System.Collections.IList.IsFixedSize { get { throw null; } }
|
||||
bool System.Collections.IList.IsReadOnly { get { throw null; } }
|
||||
object System.Collections.IList.this[int index] { get { throw null; } set { } }
|
||||
public void Clear() { }
|
||||
public System.Collections.IEnumerator GetEnumerator() { throw null; }
|
||||
public void RemoveAt(int index) { }
|
||||
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
|
||||
int System.Collections.IList.Add(object value) { throw null; }
|
||||
bool System.Collections.IList.Contains(object value) { throw null; }
|
||||
int System.Collections.IList.IndexOf(object value) { throw null; }
|
||||
void System.Collections.IList.Insert(int index, object value) { }
|
||||
void System.Collections.IList.Remove(object value) { }
|
||||
}
|
||||
public sealed partial class SqlCommand : System.Data.Common.DbCommand
|
||||
{
|
||||
// SqlCommand expects IDisposable methods to be implemented via System.ComponentModel.Component, which it no longer inherits from
|
||||
override protected void Dispose(bool disposing) { }
|
||||
}
|
||||
public sealed partial class SqlConnection : System.Data.Common.DbConnection
|
||||
{
|
||||
// SqlConection expects IDisposable methods to be implemented via System.ComponentModel.Component, which it no longer inherits from
|
||||
override protected void Dispose(bool disposing) { }
|
||||
}
|
||||
}
|
||||
575
external/corefx/src/System.Data.SqlClient/ref/System.Data.SqlClient.cs
vendored
Normal file
575
external/corefx/src/System.Data.SqlClient/ref/System.Data.SqlClient.cs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
24
external/corefx/src/System.Data.SqlClient/ref/System.Data.SqlClient.csproj
vendored
Normal file
24
external/corefx/src/System.Data.SqlClient/ref/System.Data.SqlClient.csproj
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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 Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<Compile Include="System.Data.SqlClient.cs" />
|
||||
<Compile Include="System.Data.SqlClient.Manual.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\System.ComponentModel.Primitives\ref\System.ComponentModel.Primitives.csproj" />
|
||||
<ProjectReference Include="..\..\System.ComponentModel.TypeConverter\ref\System.ComponentModel.TypeConverter.csproj" />
|
||||
<ProjectReference Include="..\..\System.Data.Common\ref\System.Data.Common.csproj" />
|
||||
<ProjectReference Include="..\..\System.Globalization\ref\System.Globalization.csproj" />
|
||||
<ProjectReference Include="..\..\System.IO\ref\System.IO.csproj" />
|
||||
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
|
||||
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
|
||||
<ProjectReference Include="..\..\System.Threading.Tasks\ref\System.Threading.Tasks.csproj" />
|
||||
<ProjectReference Include="..\..\System.Xml.ReaderWriter\ref\System.Xml.ReaderWriter.csproj" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
10
external/corefx/src/System.Data.SqlClient/src/Configurations.props
vendored
Normal file
10
external/corefx/src/System.Data.SqlClient/src/Configurations.props
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<BuildConfigurations>
|
||||
netcoreapp-Unix;
|
||||
netcoreapp-Windows_NT;
|
||||
net463-Windows_NT;
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
49
external/corefx/src/System.Data.SqlClient/src/GenerateThisAssemblyCs.targets
vendored
Normal file
49
external/corefx/src/System.Data.SqlClient/src/GenerateThisAssemblyCs.targets
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<CompileDependsOn>
|
||||
GenerateThisAssemblyCs;
|
||||
$(CompileDependsOn)
|
||||
</CompileDependsOn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(IntermediateOutputPath)\ThisAssembly.cs"/>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="GenerateThisAssemblyCs">
|
||||
<PropertyGroup>
|
||||
<ThisAssemblyCsContents>
|
||||
namespace System
|
||||
{
|
||||
internal static class ThisAssembly
|
||||
{
|
||||
internal const string InformationalVersion = "$(AssemblyFileVersion)"%3B
|
||||
}
|
||||
}
|
||||
</ThisAssemblyCsContents>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Get the last version number we built with (if any) -->
|
||||
<ReadLinesFromFile
|
||||
Condition="Exists('$(IntermediateOutputPath)\LastVersionNumber')"
|
||||
File="$(IntermediateOutputPath)\LastVersionNumber">
|
||||
<Output TaskParameter="Lines" PropertyName="LastVersionNumber"/>
|
||||
</ReadLinesFromFile>
|
||||
|
||||
<!-- Write ThisAssembly.cs if this is a new version number, or it is missing -->
|
||||
<WriteLinesToFile
|
||||
Condition="('$(LastVersionNumber)'!='$(AssemblyFileVersion)') or !Exists('$(IntermediateOutputPath)\ThisAssembly.cs')"
|
||||
File="$(IntermediateOutputPath)\ThisAssembly.cs"
|
||||
Lines="$(ThisAssemblyCsContents)"
|
||||
Overwrite="true"
|
||||
Encoding="Unicode"/>
|
||||
|
||||
<!-- Write the new version number (if it has changed) -->
|
||||
<WriteLinesToFile
|
||||
Condition="'$(LastVersionNumber)'!='$(AssemblyFileVersion)'"
|
||||
File="$(IntermediateOutputPath)\LastVersionNumber"
|
||||
Lines="$(AssemblyFileVersion)"
|
||||
Overwrite="true"
|
||||
Encoding="Unicode"/>
|
||||
</Target>
|
||||
</Project>
|
||||
46
external/corefx/src/System.Data.SqlClient/src/Interop/SNINativeMethodWrapper.Unix.cs
vendored
Normal file
46
external/corefx/src/System.Data.SqlClient/src/Interop/SNINativeMethodWrapper.Unix.cs
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
// 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.SqlClient.SNI;
|
||||
|
||||
namespace System.Data.SqlClient
|
||||
{
|
||||
internal static class SNINativeMethodWrapper
|
||||
{
|
||||
internal enum SniSpecialErrors : uint
|
||||
{
|
||||
LocalDBErrorCode = SNICommon.LocalDBErrorCode,
|
||||
|
||||
// multi-subnet-failover specific error codes
|
||||
MultiSubnetFailoverWithMoreThan64IPs = SNICommon.MultiSubnetFailoverWithMoreThan64IPs,
|
||||
MultiSubnetFailoverWithInstanceSpecified = SNICommon.MultiSubnetFailoverWithInstanceSpecified,
|
||||
MultiSubnetFailoverWithNonTcpProtocol = SNICommon.MultiSubnetFailoverWithNonTcpProtocol,
|
||||
|
||||
// max error code value
|
||||
MaxErrorValue = SNICommon.MaxErrorValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace System.Data
|
||||
{
|
||||
internal static class SafeNativeMethods
|
||||
{
|
||||
internal static IntPtr GetProcAddress(IntPtr HModule, string funcName)
|
||||
{
|
||||
throw new PlatformNotSupportedException("SafeNativeMethods.GetProcAddress is not supported on non-Windows platforms");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace System.Data
|
||||
{
|
||||
internal static class Win32NativeMethods
|
||||
{
|
||||
internal static bool IsTokenRestrictedWrapper(IntPtr token)
|
||||
{
|
||||
throw new PlatformNotSupportedException("Win32NativeMethods.IsTokenRestrictedWrapper is not supported on non-Windows platforms");
|
||||
}
|
||||
}
|
||||
}
|
||||
441
external/corefx/src/System.Data.SqlClient/src/Interop/SNINativeMethodWrapper.Windows.cs
vendored
Normal file
441
external/corefx/src/System.Data.SqlClient/src/Interop/SNINativeMethodWrapper.Windows.cs
vendored
Normal file
@@ -0,0 +1,441 @@
|
||||
// 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.Common;
|
||||
using System.Data.SqlClient;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Data.SqlClient
|
||||
{
|
||||
internal static class SNINativeMethodWrapper
|
||||
{
|
||||
private const string SNI = "sni.dll";
|
||||
|
||||
private static int s_sniMaxComposedSpnLength = -1;
|
||||
|
||||
private const int SniOpenTimeOut = -1; // infinite
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
|
||||
internal delegate void SqlAsyncCallbackDelegate(IntPtr m_ConsKey, IntPtr pPacket, uint dwError);
|
||||
|
||||
internal static int SniMaxComposedSpnLength
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_sniMaxComposedSpnLength == -1)
|
||||
{
|
||||
s_sniMaxComposedSpnLength = checked((int)GetSniMaxComposedSpnLength());
|
||||
}
|
||||
return s_sniMaxComposedSpnLength;
|
||||
}
|
||||
}
|
||||
|
||||
#region Structs\Enums
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct ConsumerInfo
|
||||
{
|
||||
internal int defaultBufferSize;
|
||||
internal SqlAsyncCallbackDelegate readDelegate;
|
||||
internal SqlAsyncCallbackDelegate writeDelegate;
|
||||
internal IntPtr key;
|
||||
}
|
||||
|
||||
internal enum ConsumerNumber
|
||||
{
|
||||
SNI_Consumer_SNI,
|
||||
SNI_Consumer_SSB,
|
||||
SNI_Consumer_PacketIsReleased,
|
||||
SNI_Consumer_Invalid,
|
||||
}
|
||||
|
||||
internal enum IOType
|
||||
{
|
||||
READ,
|
||||
WRITE,
|
||||
}
|
||||
|
||||
internal enum PrefixEnum
|
||||
{
|
||||
UNKNOWN_PREFIX,
|
||||
SM_PREFIX,
|
||||
TCP_PREFIX,
|
||||
NP_PREFIX,
|
||||
VIA_PREFIX,
|
||||
INVALID_PREFIX,
|
||||
}
|
||||
|
||||
internal enum ProviderEnum
|
||||
{
|
||||
HTTP_PROV,
|
||||
NP_PROV,
|
||||
SESSION_PROV,
|
||||
SIGN_PROV,
|
||||
SM_PROV,
|
||||
SMUX_PROV,
|
||||
SSL_PROV,
|
||||
TCP_PROV,
|
||||
VIA_PROV,
|
||||
MAX_PROVS,
|
||||
INVALID_PROV,
|
||||
}
|
||||
|
||||
internal enum QTypes
|
||||
{
|
||||
SNI_QUERY_CONN_INFO,
|
||||
SNI_QUERY_CONN_BUFSIZE,
|
||||
SNI_QUERY_CONN_KEY,
|
||||
SNI_QUERY_CLIENT_ENCRYPT_POSSIBLE,
|
||||
SNI_QUERY_SERVER_ENCRYPT_POSSIBLE,
|
||||
SNI_QUERY_CERTIFICATE,
|
||||
SNI_QUERY_LOCALDB_HMODULE,
|
||||
SNI_QUERY_CONN_ENCRYPT,
|
||||
SNI_QUERY_CONN_PROVIDERNUM,
|
||||
SNI_QUERY_CONN_CONNID,
|
||||
SNI_QUERY_CONN_PARENTCONNID,
|
||||
SNI_QUERY_CONN_SECPKG,
|
||||
SNI_QUERY_CONN_NETPACKETSIZE,
|
||||
SNI_QUERY_CONN_NODENUM,
|
||||
SNI_QUERY_CONN_PACKETSRECD,
|
||||
SNI_QUERY_CONN_PACKETSSENT,
|
||||
SNI_QUERY_CONN_PEERADDR,
|
||||
SNI_QUERY_CONN_PEERPORT,
|
||||
SNI_QUERY_CONN_LASTREADTIME,
|
||||
SNI_QUERY_CONN_LASTWRITETIME,
|
||||
SNI_QUERY_CONN_CONSUMER_ID,
|
||||
SNI_QUERY_CONN_CONNECTTIME,
|
||||
SNI_QUERY_CONN_HTTPENDPOINT,
|
||||
SNI_QUERY_CONN_LOCALADDR,
|
||||
SNI_QUERY_CONN_LOCALPORT,
|
||||
SNI_QUERY_CONN_SSLHANDSHAKESTATE,
|
||||
SNI_QUERY_CONN_SOBUFAUTOTUNING,
|
||||
SNI_QUERY_CONN_SECPKGNAME,
|
||||
SNI_QUERY_CONN_SECPKGMUTUALAUTH,
|
||||
SNI_QUERY_CONN_CONSUMERCONNID,
|
||||
SNI_QUERY_CONN_SNIUCI,
|
||||
SNI_QUERY_CONN_SUPPORTS_EXTENDED_PROTECTION,
|
||||
SNI_QUERY_CONN_CHANNEL_PROVIDES_AUTHENTICATION_CONTEXT,
|
||||
SNI_QUERY_CONN_PEERID,
|
||||
SNI_QUERY_CONN_SUPPORTS_SYNC_OVER_ASYNC,
|
||||
}
|
||||
|
||||
internal enum TransparentNetworkResolutionMode : byte
|
||||
{
|
||||
DisabledMode = 0,
|
||||
SequentialMode,
|
||||
ParallelMode
|
||||
};
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct Sni_Consumer_Info
|
||||
{
|
||||
public int DefaultUserDataLength;
|
||||
public IntPtr ConsumerKey;
|
||||
public IntPtr fnReadComp;
|
||||
public IntPtr fnWriteComp;
|
||||
public IntPtr fnTrace;
|
||||
public IntPtr fnAcceptComp;
|
||||
public uint dwNumProts;
|
||||
public IntPtr rgListenInfo;
|
||||
public IntPtr NodeAffinity;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private unsafe struct SNI_CLIENT_CONSUMER_INFO
|
||||
{
|
||||
public Sni_Consumer_Info ConsumerInfo;
|
||||
[MarshalAs(UnmanagedType.LPWStr)]
|
||||
public string wszConnectionString;
|
||||
public PrefixEnum networkLibrary;
|
||||
public byte* szSPN;
|
||||
public uint cchSPN;
|
||||
public byte* szInstanceName;
|
||||
public uint cchInstanceName;
|
||||
[MarshalAs(UnmanagedType.Bool)]
|
||||
public bool fOverrideLastConnectCache;
|
||||
[MarshalAs(UnmanagedType.Bool)]
|
||||
public bool fSynchronousConnection;
|
||||
public int timeout;
|
||||
[MarshalAs(UnmanagedType.Bool)]
|
||||
public bool fParallel;
|
||||
public TransparentNetworkResolutionMode transparentNetworkResolution;
|
||||
public int totalTimeout;
|
||||
public bool isAzureSqlServerEndpoint;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
internal struct SNI_Error
|
||||
{
|
||||
internal ProviderEnum provider;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 261)]
|
||||
internal string errorMessage;
|
||||
internal uint nativeError;
|
||||
internal uint sniError;
|
||||
[MarshalAs(UnmanagedType.LPWStr)]
|
||||
internal string fileName;
|
||||
[MarshalAs(UnmanagedType.LPWStr)]
|
||||
internal string function;
|
||||
internal uint lineNumber;
|
||||
}
|
||||
|
||||
internal enum SniSpecialErrors : uint
|
||||
{
|
||||
LocalDBErrorCode = 50,
|
||||
|
||||
// multi-subnet-failover specific error codes
|
||||
MultiSubnetFailoverWithMoreThan64IPs = 47,
|
||||
MultiSubnetFailoverWithInstanceSpecified = 48,
|
||||
MultiSubnetFailoverWithNonTcpProtocol = 49,
|
||||
|
||||
// max error code value
|
||||
MaxErrorValue = 50157
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region DLL Imports
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIAddProviderWrapper")]
|
||||
internal static extern uint SNIAddProvider(SNIHandle pConn, ProviderEnum ProvNum, [In] ref uint pInfo);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNICheckConnectionWrapper")]
|
||||
internal static extern uint SNICheckConnection([In] SNIHandle pConn);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNICloseWrapper")]
|
||||
internal static extern uint SNIClose(IntPtr pConn);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern void SNIGetLastError(out SNI_Error pErrorStruct);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern void SNIPacketRelease(IntPtr pPacket);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIPacketResetWrapper")]
|
||||
internal static extern void SNIPacketReset([In] SNIHandle pConn, IOType IOType, SNIPacket pPacket, ConsumerNumber ConsNum);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern uint SNIQueryInfo(QTypes QType, ref uint pbQInfo);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern uint SNIQueryInfo(QTypes QType, ref IntPtr pbQInfo);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIReadAsyncWrapper")]
|
||||
internal static extern uint SNIReadAsync(SNIHandle pConn, ref IntPtr ppNewPacket);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern uint SNIReadSyncOverAsync(SNIHandle pConn, ref IntPtr ppNewPacket, int timeout);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIRemoveProviderWrapper")]
|
||||
internal static extern uint SNIRemoveProvider(SNIHandle pConn, ProviderEnum ProvNum);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern uint SNISecInitPackage(ref uint pcbMaxToken);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNISetInfoWrapper")]
|
||||
internal static extern uint SNISetInfo(SNIHandle pConn, QTypes QType, [In] ref uint pbQInfo);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern uint SNITerminate();
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SNIWaitForSSLHandshakeToCompleteWrapper")]
|
||||
internal static extern uint SNIWaitForSSLHandshakeToComplete([In] SNIHandle pConn, int dwMilliseconds);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern uint UnmanagedIsTokenRestricted([In] IntPtr token, [MarshalAs(UnmanagedType.Bool)] out bool isRestricted);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern uint GetSniMaxComposedSpnLength();
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern uint SNIGetInfoWrapper([In] SNIHandle pConn, SNINativeMethodWrapper.QTypes QType, out Guid pbQInfo);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern uint SNIInitialize([In] IntPtr pmo);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern uint SNIOpenSyncExWrapper(ref SNI_CLIENT_CONSUMER_INFO pClientConsumerInfo, out IntPtr ppConn);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern uint SNIOpenWrapper(
|
||||
[In] ref Sni_Consumer_Info pConsumerInfo,
|
||||
[MarshalAs(UnmanagedType.LPStr)] string szConnect,
|
||||
[In] SNIHandle pConn,
|
||||
out IntPtr ppConn,
|
||||
[MarshalAs(UnmanagedType.Bool)] bool fSync);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern IntPtr SNIPacketAllocateWrapper([In] SafeHandle pConn, IOType IOType);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern uint SNIPacketGetDataWrapper([In] IntPtr packet, [In, Out] byte[] readBuffer, uint readBufferLength, out uint dataSize);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern unsafe void SNIPacketSetData(SNIPacket pPacket, [In] byte* pbBuf, uint cbBuf);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern unsafe uint SNISecGenClientContextWrapper(
|
||||
[In] SNIHandle pConn,
|
||||
[In, Out] byte[] pIn,
|
||||
uint cbIn,
|
||||
[In, Out] byte[] pOut,
|
||||
[In] ref uint pcbOut,
|
||||
[MarshalAsAttribute(UnmanagedType.Bool)] out bool pfDone,
|
||||
byte* szServerInfo,
|
||||
uint cbServerInfo,
|
||||
[MarshalAsAttribute(UnmanagedType.LPWStr)] string pwszUserName,
|
||||
[MarshalAsAttribute(UnmanagedType.LPWStr)] string pwszPassword);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern uint SNIWriteAsyncWrapper(SNIHandle pConn, [In] SNIPacket pPacket);
|
||||
|
||||
[DllImport(SNI, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern uint SNIWriteSyncOverAsync(SNIHandle pConn, [In] SNIPacket pPacket);
|
||||
#endregion
|
||||
|
||||
internal static uint SniGetConnectionId(SNIHandle pConn, ref Guid connId)
|
||||
{
|
||||
return SNIGetInfoWrapper(pConn, QTypes.SNI_QUERY_CONN_CONNID, out connId);
|
||||
}
|
||||
|
||||
internal static uint SNIInitialize()
|
||||
{
|
||||
return SNIInitialize(IntPtr.Zero);
|
||||
}
|
||||
|
||||
internal static unsafe uint SNIOpenMarsSession(ConsumerInfo consumerInfo, SNIHandle parent, ref IntPtr pConn, bool fSync)
|
||||
{
|
||||
// initialize consumer info for MARS
|
||||
Sni_Consumer_Info native_consumerInfo = new Sni_Consumer_Info();
|
||||
MarshalConsumerInfo(consumerInfo, ref native_consumerInfo);
|
||||
|
||||
return SNIOpenWrapper(ref native_consumerInfo, "session:", parent, out pConn, fSync);
|
||||
}
|
||||
|
||||
internal static unsafe uint SNIOpenSyncEx(ConsumerInfo consumerInfo, string constring, ref IntPtr pConn, byte[] spnBuffer, byte[] instanceName, bool fOverrideCache, bool fSync, int timeout, bool fParallel)
|
||||
{
|
||||
fixed (byte* pin_instanceName = &instanceName[0])
|
||||
{
|
||||
SNI_CLIENT_CONSUMER_INFO clientConsumerInfo = new SNI_CLIENT_CONSUMER_INFO();
|
||||
|
||||
// initialize client ConsumerInfo part first
|
||||
MarshalConsumerInfo(consumerInfo, ref clientConsumerInfo.ConsumerInfo);
|
||||
|
||||
clientConsumerInfo.wszConnectionString = constring;
|
||||
clientConsumerInfo.networkLibrary = PrefixEnum.UNKNOWN_PREFIX;
|
||||
|
||||
clientConsumerInfo.szInstanceName = pin_instanceName;
|
||||
clientConsumerInfo.cchInstanceName = (uint)instanceName.Length;
|
||||
clientConsumerInfo.fOverrideLastConnectCache = fOverrideCache;
|
||||
clientConsumerInfo.fSynchronousConnection = fSync;
|
||||
clientConsumerInfo.timeout = timeout;
|
||||
clientConsumerInfo.fParallel = fParallel;
|
||||
|
||||
clientConsumerInfo.transparentNetworkResolution = TransparentNetworkResolutionMode.DisabledMode;
|
||||
clientConsumerInfo.totalTimeout = SniOpenTimeOut;
|
||||
clientConsumerInfo.isAzureSqlServerEndpoint = ADP.IsAzureSqlServerEndpoint(constring);
|
||||
|
||||
if (spnBuffer != null)
|
||||
{
|
||||
fixed (byte* pin_spnBuffer = &spnBuffer[0])
|
||||
{
|
||||
clientConsumerInfo.szSPN = pin_spnBuffer;
|
||||
clientConsumerInfo.cchSPN = (uint)spnBuffer.Length;
|
||||
return SNIOpenSyncExWrapper(ref clientConsumerInfo, out pConn);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// else leave szSPN null (SQL Auth)
|
||||
return SNIOpenSyncExWrapper(ref clientConsumerInfo, out pConn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static void SNIPacketAllocate(SafeHandle pConn, IOType IOType, ref IntPtr pPacket)
|
||||
{
|
||||
pPacket = SNIPacketAllocateWrapper(pConn, IOType);
|
||||
}
|
||||
|
||||
internal static unsafe uint SNIPacketGetData(IntPtr packet, byte[] readBuffer, ref uint dataSize)
|
||||
{
|
||||
return SNIPacketGetDataWrapper(packet, readBuffer, (uint)readBuffer.Length, out dataSize);
|
||||
}
|
||||
|
||||
internal static unsafe void SNIPacketSetData(SNIPacket packet, byte[] data, int length)
|
||||
{
|
||||
fixed (byte* pin_data = &data[0])
|
||||
{
|
||||
SNIPacketSetData(packet, pin_data, (uint)length);
|
||||
}
|
||||
}
|
||||
|
||||
internal static unsafe uint SNISecGenClientContext(SNIHandle pConnectionObject, byte[] inBuff, uint receivedLength, byte[] OutBuff, ref uint sendLength, byte[] serverUserName)
|
||||
{
|
||||
fixed (byte* pin_serverUserName = &serverUserName[0])
|
||||
{
|
||||
bool local_fDone;
|
||||
return SNISecGenClientContextWrapper(
|
||||
pConnectionObject,
|
||||
inBuff,
|
||||
receivedLength,
|
||||
OutBuff,
|
||||
ref sendLength,
|
||||
out local_fDone,
|
||||
pin_serverUserName,
|
||||
(uint)serverUserName.Length,
|
||||
null,
|
||||
null);
|
||||
}
|
||||
}
|
||||
|
||||
internal static uint SNIWritePacket(SNIHandle pConn, SNIPacket packet, bool sync)
|
||||
{
|
||||
if (sync)
|
||||
{
|
||||
return SNIWriteSyncOverAsync(pConn, packet);
|
||||
}
|
||||
else
|
||||
{
|
||||
return SNIWriteAsyncWrapper(pConn, packet);
|
||||
}
|
||||
}
|
||||
|
||||
private static void MarshalConsumerInfo(ConsumerInfo consumerInfo, ref Sni_Consumer_Info native_consumerInfo)
|
||||
{
|
||||
native_consumerInfo.DefaultUserDataLength = consumerInfo.defaultBufferSize;
|
||||
native_consumerInfo.fnReadComp = null != consumerInfo.readDelegate
|
||||
? Marshal.GetFunctionPointerForDelegate(consumerInfo.readDelegate)
|
||||
: IntPtr.Zero;
|
||||
native_consumerInfo.fnWriteComp = null != consumerInfo.writeDelegate
|
||||
? Marshal.GetFunctionPointerForDelegate(consumerInfo.writeDelegate)
|
||||
: IntPtr.Zero;
|
||||
native_consumerInfo.ConsumerKey = consumerInfo.key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace System.Data
|
||||
{
|
||||
internal static class SafeNativeMethods
|
||||
{
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true, SetLastError = true)]
|
||||
internal static extern IntPtr GetProcAddress(IntPtr HModule, [MarshalAs(UnmanagedType.LPStr), In] string funcName);
|
||||
}
|
||||
}
|
||||
|
||||
namespace System.Data
|
||||
{
|
||||
internal static class Win32NativeMethods
|
||||
{
|
||||
internal static bool IsTokenRestrictedWrapper(IntPtr token)
|
||||
{
|
||||
bool isRestricted;
|
||||
uint result = SNINativeMethodWrapper.UnmanagedIsTokenRestricted(token, out isRestricted);
|
||||
|
||||
if (result != 0)
|
||||
{
|
||||
Marshal.ThrowExceptionForHR(unchecked((int)result));
|
||||
}
|
||||
|
||||
return isRestricted;
|
||||
}
|
||||
}
|
||||
}
|
||||
63
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/ExtendedClrTypeCode.cs
vendored
Normal file
63
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/ExtendedClrTypeCode.cs
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
// 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 Microsoft.SqlServer.Server
|
||||
{
|
||||
internal enum ExtendedClrTypeCode
|
||||
{
|
||||
Invalid = -1,
|
||||
Boolean, // System.Boolean
|
||||
Byte, // System.Byte
|
||||
Char, // System.Char
|
||||
DateTime, // System.DateTime
|
||||
DBNull, // System.DBNull
|
||||
Decimal, // System.Decimal
|
||||
Double, // System.Double
|
||||
Empty, // null reference
|
||||
Int16, // System.Int16
|
||||
Int32, // System.Int32
|
||||
Int64, // System.Int64
|
||||
SByte, // System.SByte
|
||||
Single, // System.Single
|
||||
String, // System.String
|
||||
UInt16, // System.UInt16
|
||||
UInt32, // System.UInt32
|
||||
UInt64, // System.UInt64
|
||||
Object, // System.Object
|
||||
ByteArray, // System.ByteArray
|
||||
CharArray, // System.CharArray
|
||||
Guid, // System.Guid
|
||||
SqlBinary, // System.Data.SqlTypes.SqlBinary
|
||||
SqlBoolean, // System.Data.SqlTypes.SqlBoolean
|
||||
SqlByte, // System.Data.SqlTypes.SqlByte
|
||||
SqlDateTime, // System.Data.SqlTypes.SqlDateTime
|
||||
SqlDouble, // System.Data.SqlTypes.SqlDouble
|
||||
SqlGuid, // System.Data.SqlTypes.SqlGuid
|
||||
SqlInt16, // System.Data.SqlTypes.SqlInt16
|
||||
SqlInt32, // System.Data.SqlTypes.SqlInt32
|
||||
SqlInt64, // System.Data.SqlTypes.SqlInt64
|
||||
SqlMoney, // System.Data.SqlTypes.SqlMoney
|
||||
SqlDecimal, // System.Data.SqlTypes.SqlDecimal
|
||||
SqlSingle, // System.Data.SqlTypes.SqlSingle
|
||||
SqlString, // System.Data.SqlTypes.SqlString
|
||||
SqlChars, // System.Data.SqlTypes.SqlChars
|
||||
SqlBytes, // System.Data.SqlTypes.SqlBytes
|
||||
SqlXml, // System.Data.SqlTypes.SqlXml
|
||||
DataTable, // System.Data.DataTable
|
||||
DbDataReader, // System.Data.DbDataReader (SqlDataReader falls under this category)
|
||||
IEnumerableOfSqlDataRecord, // System.Collections.Generic.IEnumerable<Microsoft.SqlServer.Server.SqlDataRecord>
|
||||
TimeSpan, // System.TimeSpan
|
||||
DateTimeOffset, // System.DateTimeOffset
|
||||
Stream, // System.IO.Stream
|
||||
TextReader, // System.IO.TextReader
|
||||
XmlReader, // System.Xml.XmlReader
|
||||
Last = XmlReader, // end-of-enum marker
|
||||
First = Boolean, // beginning-of-enum marker
|
||||
};
|
||||
}
|
||||
|
||||
103
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/ITypedGetters.cs
vendored
Normal file
103
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/ITypedGetters.cs
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
// 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;
|
||||
using System.Data;
|
||||
using System.Data.SqlTypes;
|
||||
|
||||
namespace Microsoft.SqlServer.Server
|
||||
{
|
||||
// Interface for strongly-typed value getters
|
||||
internal interface ITypedGetters
|
||||
{
|
||||
// Null test
|
||||
bool IsDBNull(int ordinal);
|
||||
|
||||
// Check what type current sql_variant value is
|
||||
SqlDbType GetVariantType(int ordinal);
|
||||
|
||||
// By value accessors (data copy across the interface boundary implied)
|
||||
Boolean GetBoolean(int ordinal);
|
||||
|
||||
Byte GetByte(int ordinal);
|
||||
|
||||
Int64 GetBytes(int ordinal, long fieldOffset, byte[] buffer, int bufferOffset, int length);
|
||||
|
||||
Char GetChar(int ordinal);
|
||||
|
||||
Int64 GetChars(int ordinal, long fieldOffset, char[] buffer, int bufferOffset, int length);
|
||||
|
||||
Int16 GetInt16(int ordinal);
|
||||
|
||||
Int32 GetInt32(int ordinal);
|
||||
|
||||
Int64 GetInt64(int ordinal);
|
||||
|
||||
Single GetFloat(int ordinal);
|
||||
|
||||
Double GetDouble(int ordinal);
|
||||
|
||||
String GetString(int ordinal);
|
||||
|
||||
Decimal GetDecimal(int ordinal);
|
||||
|
||||
DateTime GetDateTime(int ordinal);
|
||||
|
||||
Guid GetGuid(int ordinal);
|
||||
|
||||
SqlBoolean GetSqlBoolean(int ordinal);
|
||||
|
||||
SqlByte GetSqlByte(int ordinal);
|
||||
|
||||
SqlInt16 GetSqlInt16(int ordinal);
|
||||
|
||||
SqlInt32 GetSqlInt32(int ordinal);
|
||||
|
||||
SqlInt64 GetSqlInt64(int ordinal);
|
||||
|
||||
SqlSingle GetSqlSingle(int ordinal);
|
||||
|
||||
SqlDouble GetSqlDouble(int ordinal);
|
||||
|
||||
SqlMoney GetSqlMoney(int ordinal);
|
||||
|
||||
SqlDateTime GetSqlDateTime(int ordinal);
|
||||
|
||||
SqlDecimal GetSqlDecimal(int ordinal);
|
||||
|
||||
SqlString GetSqlString(int ordinal);
|
||||
|
||||
SqlBinary GetSqlBinary(int ordinal);
|
||||
|
||||
SqlGuid GetSqlGuid(int ordinal);
|
||||
|
||||
SqlChars GetSqlChars(int ordinal);
|
||||
|
||||
SqlBytes GetSqlBytes(int ordinal);
|
||||
|
||||
SqlXml GetSqlXml(int ordinal);
|
||||
|
||||
|
||||
// "By reference" accessors
|
||||
// May hook to buffer.
|
||||
// Semantics guarantee is that as long as the object exposing the accessor is not logically
|
||||
// moved to a new set of values and the overall state (open/closed) isn't changed, it will not
|
||||
// change the underlying value returned and continue to allow access to it.
|
||||
//
|
||||
// Example: GetSqlCharsRef called on an event stream value. The back-end optimizes by re-using
|
||||
// the buffer wrapped by the returned SqlChars on the next row event, but guarantees that it
|
||||
// won't change the value until the next event is consumed.
|
||||
//
|
||||
// Simplest way to guarantee this behavior is to simply call the corresponding by-value accessor.
|
||||
SqlBytes GetSqlBytesRef(int ordinal);
|
||||
|
||||
SqlChars GetSqlCharsRef(int ordinal);
|
||||
|
||||
SqlXml GetSqlXmlRef(int ordinal);
|
||||
}
|
||||
}
|
||||
72
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/ITypedGettersV3.cs
vendored
Normal file
72
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/ITypedGettersV3.cs
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
// 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;
|
||||
using System.Data.SqlTypes;
|
||||
|
||||
namespace Microsoft.SqlServer.Server
|
||||
{
|
||||
// Interface for strongly-typed value getters
|
||||
internal interface ITypedGettersV3
|
||||
{
|
||||
// Null test
|
||||
// valid for all types
|
||||
bool IsDBNull(SmiEventSink sink, int ordinal);
|
||||
|
||||
// Check what type current sql_variant value is
|
||||
// valid for SqlDbType.Variant
|
||||
SmiMetaData GetVariantType(SmiEventSink sink, int ordinal);
|
||||
|
||||
//
|
||||
// Actual value accessors
|
||||
// valid type indicates column must be of the type or column must be variant
|
||||
// and GetVariantType returned the type
|
||||
//
|
||||
|
||||
// valid for SqlDbType.Bit
|
||||
Boolean GetBoolean(SmiEventSink sink, int ordinal);
|
||||
|
||||
// valid for SqlDbType.TinyInt
|
||||
Byte GetByte(SmiEventSink sink, int ordinal);
|
||||
|
||||
// valid for SqlDbTypes: Binary, VarBinary, Image, Udt, Xml, Char, VarChar, Text, NChar, NVarChar, NText
|
||||
// (Character type support needed for ExecuteXmlReader handling)
|
||||
Int64 GetBytesLength(SmiEventSink sink, int ordinal);
|
||||
int GetBytes(SmiEventSink sink, int ordinal, long fieldOffset, byte[] buffer, int bufferOffset, int length);
|
||||
|
||||
// valid for character types: Char, VarChar, Text, NChar, NVarChar, NText
|
||||
Int64 GetCharsLength(SmiEventSink sink, int ordinal);
|
||||
int GetChars(SmiEventSink sink, int ordinal, long fieldOffset, char[] buffer, int bufferOffset, int length);
|
||||
String GetString(SmiEventSink sink, int ordinal);
|
||||
|
||||
// valid for SqlDbType.SmallInt
|
||||
Int16 GetInt16(SmiEventSink sink, int ordinal);
|
||||
|
||||
// valid for SqlDbType.Int
|
||||
Int32 GetInt32(SmiEventSink sink, int ordinal);
|
||||
|
||||
// valid for SqlDbType.BigInt, SqlDbType.Money, SqlDbType.SmallMoney
|
||||
Int64 GetInt64(SmiEventSink sink, int ordinal);
|
||||
|
||||
// valid for SqlDbType.Real
|
||||
Single GetSingle(SmiEventSink sink, int ordinal);
|
||||
|
||||
// valid for SqlDbType.Float
|
||||
Double GetDouble(SmiEventSink sink, int ordinal);
|
||||
|
||||
// valid for SqlDbType.Numeric (uses SqlDecimal since Decimal cannot hold full range)
|
||||
SqlDecimal GetSqlDecimal(SmiEventSink sink, int ordinal);
|
||||
|
||||
// valid for DateTime & SmallDateTime
|
||||
DateTime GetDateTime(SmiEventSink sink, int ordinal);
|
||||
|
||||
// valid for UniqueIdentifier
|
||||
Guid GetGuid(SmiEventSink sink, int ordinal);
|
||||
}
|
||||
}
|
||||
|
||||
100
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/ITypedSetters.cs
vendored
Normal file
100
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/ITypedSetters.cs
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
// 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;
|
||||
using System.Data.SqlTypes;
|
||||
|
||||
namespace Microsoft.SqlServer.Server
|
||||
{
|
||||
// interface for strongly-typed value setters
|
||||
internal interface ITypedSetters
|
||||
{
|
||||
// By value setters (data copy across the interface boundary implied)
|
||||
void SetDBNull(int ordinal);
|
||||
|
||||
void SetBoolean(int ordinal, Boolean value);
|
||||
|
||||
void SetByte(int ordinal, Byte value);
|
||||
|
||||
void SetBytes(int ordinal, long fieldOffset, byte[] buffer, int bufferOffset, int length);
|
||||
|
||||
void SetChar(int ordinal, char value);
|
||||
|
||||
void SetChars(int ordinal, long fieldOffset, char[] buffer, int bufferOffset, int length);
|
||||
|
||||
void SetInt16(int ordinal, Int16 value);
|
||||
|
||||
void SetInt32(int ordinal, Int32 value);
|
||||
|
||||
void SetInt64(int ordinal, Int64 value);
|
||||
|
||||
void SetFloat(int ordinal, Single value);
|
||||
|
||||
void SetDouble(int ordinal, Double value);
|
||||
|
||||
[ObsoleteAttribute("Not supported as of SMI v2. Will be removed when v1 support dropped. Use setter with offset.")]
|
||||
void SetString(int ordinal, string value);
|
||||
|
||||
// Method introduced as of SMI V2
|
||||
void SetString(int ordinal, string value, int offset);
|
||||
|
||||
void SetDecimal(int ordinal, Decimal value);
|
||||
|
||||
void SetDateTime(int ordinal, DateTime value);
|
||||
|
||||
void SetGuid(int ordinal, Guid value);
|
||||
|
||||
void SetSqlBoolean(int ordinal, SqlBoolean value);
|
||||
|
||||
void SetSqlByte(int ordinal, SqlByte value);
|
||||
|
||||
void SetSqlInt16(int ordinal, SqlInt16 value);
|
||||
|
||||
void SetSqlInt32(int ordinal, SqlInt32 value);
|
||||
|
||||
void SetSqlInt64(int ordinal, SqlInt64 value);
|
||||
|
||||
void SetSqlSingle(int ordinal, SqlSingle value);
|
||||
|
||||
void SetSqlDouble(int ordinal, SqlDouble value);
|
||||
|
||||
void SetSqlMoney(int ordinal, SqlMoney value);
|
||||
|
||||
void SetSqlDateTime(int ordinal, SqlDateTime value);
|
||||
|
||||
void SetSqlDecimal(int ordinal, SqlDecimal value);
|
||||
|
||||
[ObsoleteAttribute("Not supported as of SMI v2. Will be removed when v1 support dropped. Use setter with offset.")]
|
||||
void SetSqlString(int ordinal, SqlString value);
|
||||
|
||||
// Method introduced as of SMI V2
|
||||
void SetSqlString(int ordinal, SqlString value, int offset);
|
||||
|
||||
[ObsoleteAttribute("Not supported as of SMI v2. Will be removed when v1 support dropped. Use setter with offset.")]
|
||||
void SetSqlBinary(int ordinal, SqlBinary value);
|
||||
|
||||
// Method introduced as of SMI V2
|
||||
void SetSqlBinary(int ordinal, SqlBinary value, int offset);
|
||||
|
||||
void SetSqlGuid(int ordinal, SqlGuid value);
|
||||
|
||||
[ObsoleteAttribute("Not supported as of SMI v2. Will be removed when v1 support dropped. Use setter with offset.")]
|
||||
void SetSqlChars(int ordinal, SqlChars value);
|
||||
|
||||
// Method introduced as of SMI V2
|
||||
void SetSqlChars(int ordinal, SqlChars value, int offset);
|
||||
|
||||
[ObsoleteAttribute("Not supported as of SMI v2. Will be removed when v1 support dropped. Use setter with offset.")]
|
||||
void SetSqlBytes(int ordinal, SqlBytes value);
|
||||
|
||||
// Method introduced as of SMI V2
|
||||
void SetSqlBytes(int ordinal, SqlBytes value, int offset);
|
||||
|
||||
void SetSqlXml(int ordinal, SqlXml value);
|
||||
}
|
||||
}
|
||||
82
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/ITypedSettersV3.cs
vendored
Normal file
82
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/ITypedSettersV3.cs
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
// 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;
|
||||
using System.Data.SqlTypes;
|
||||
|
||||
namespace Microsoft.SqlServer.Server
|
||||
{
|
||||
// interface for strongly-typed value setters
|
||||
internal interface ITypedSettersV3
|
||||
{
|
||||
// By value setters (data copy across the interface boundary implied)
|
||||
// All setters are valid for SqlDbType.Variant
|
||||
|
||||
// SetVariantMetaData is used to set the precise type of data just before pushing
|
||||
// data into a variant type via one of the other setters. It
|
||||
// is only valid to set metadata with a SqlDbType that associated with the
|
||||
// data setter that will be called.
|
||||
// Since LOBs, Udt's and fixed-length types are not currently stored in a variant,
|
||||
// the following pairs are the only setters/sqldbtypes that need this call:
|
||||
// NVarChar/VarChar + SetString (needed only for non-global collation, i.e. SqlString)
|
||||
// Money/SmallMoney + SetInt64
|
||||
void SetVariantMetaData(SmiEventSink sink, int ordinal, SmiMetaData metaData);
|
||||
|
||||
// Set value to null
|
||||
// valid for all types
|
||||
void SetDBNull(SmiEventSink sink, int ordinal);
|
||||
|
||||
// valid for SqlDbType.Bit
|
||||
void SetBoolean(SmiEventSink sink, int ordinal, Boolean value);
|
||||
|
||||
// valid for SqlDbType.TinyInt
|
||||
void SetByte(SmiEventSink sink, int ordinal, Byte value);
|
||||
|
||||
// Semantics for SetBytes are to modify existing value, not overwrite
|
||||
// Use in combination with SetLength to ensure overwriting when necessary
|
||||
// valid for SqlDbTypes: Binary, VarBinary, Image, Udt, Xml
|
||||
// (VarBinary assumed for variants)
|
||||
int SetBytes(SmiEventSink sink, int ordinal, long fieldOffset, byte[] buffer, int bufferOffset, int length);
|
||||
void SetBytesLength(SmiEventSink sink, int ordinal, long length);
|
||||
|
||||
// Semantics for SetChars are to modify existing value, not overwrite
|
||||
// Use in combination with SetLength to ensure overwriting when necessary
|
||||
// valid for character types: Char, VarChar, Text, NChar, NVarChar, NText
|
||||
// (NVarChar and global clr collation assumed for variants)
|
||||
int SetChars(SmiEventSink sink, int ordinal, long fieldOffset, char[] buffer, int bufferOffset, int length);
|
||||
void SetCharsLength(SmiEventSink sink, int ordinal, long length);
|
||||
|
||||
// valid for character types: Char, VarChar, Text, NChar, NVarChar, NText
|
||||
void SetString(SmiEventSink sink, int ordinal, string value, int offset, int length);
|
||||
|
||||
// valid for SqlDbType.SmallInt
|
||||
void SetInt16(SmiEventSink sink, int ordinal, Int16 value);
|
||||
|
||||
// valid for SqlDbType.Int
|
||||
void SetInt32(SmiEventSink sink, int ordinal, Int32 value);
|
||||
|
||||
// valid for SqlDbType.BigInt, SqlDbType.Money, SqlDbType.SmallMoney
|
||||
void SetInt64(SmiEventSink sink, int ordinal, Int64 value);
|
||||
|
||||
// valid for SqlDbType.Real
|
||||
void SetSingle(SmiEventSink sink, int ordinal, Single value);
|
||||
|
||||
// valid for SqlDbType.Float
|
||||
void SetDouble(SmiEventSink sink, int ordinal, Double value);
|
||||
|
||||
// valid for SqlDbType.Numeric (uses SqlDecimal since Decimal cannot hold full range)
|
||||
void SetSqlDecimal(SmiEventSink sink, int ordinal, SqlDecimal value);
|
||||
|
||||
// valid for DateTime & SmallDateTime
|
||||
void SetDateTime(SmiEventSink sink, int ordinal, DateTime value);
|
||||
|
||||
// valid for UniqueIdentifier
|
||||
void SetGuid(SmiEventSink sink, int ordinal, Guid value);
|
||||
}
|
||||
}
|
||||
|
||||
267
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/MemoryRecordBuffer.cs
vendored
Normal file
267
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/MemoryRecordBuffer.cs
vendored
Normal file
@@ -0,0 +1,267 @@
|
||||
// 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;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Microsoft.SqlServer.Server
|
||||
{
|
||||
// Class for implementing a record object used in out-of-proc scenarios.
|
||||
internal sealed class MemoryRecordBuffer : SmiRecordBuffer
|
||||
{
|
||||
private SqlRecordBuffer[] _buffer;
|
||||
|
||||
internal MemoryRecordBuffer(SmiMetaData[] metaData)
|
||||
{
|
||||
Debug.Assert(null != metaData, "invalid attempt to instantiate MemoryRecordBuffer with null SmiMetaData[]");
|
||||
|
||||
_buffer = new SqlRecordBuffer[metaData.Length];
|
||||
|
||||
for (int i = 0; i < _buffer.Length; ++i)
|
||||
{
|
||||
_buffer[i] = new SqlRecordBuffer(metaData[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#region Getters
|
||||
// Null test
|
||||
// valid for all types
|
||||
public override bool IsDBNull(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].IsNull;
|
||||
}
|
||||
|
||||
// Check what type current sql_variant value is
|
||||
// valid for SqlDbType.Variant
|
||||
public override SmiMetaData GetVariantType(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].VariantType;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.Bit
|
||||
public override Boolean GetBoolean(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].Boolean;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.TinyInt
|
||||
public override Byte GetByte(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].Byte;
|
||||
}
|
||||
|
||||
// valid for SqlDbTypes: Binary, VarBinary, Image, Udt, Xml, Char, VarChar, Text, NChar, NVarChar, NText
|
||||
// (Character type support needed for ExecuteXmlReader handling)
|
||||
public override Int64 GetBytesLength(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].BytesLength;
|
||||
}
|
||||
public override int GetBytes(SmiEventSink sink, int ordinal, long fieldOffset, byte[] buffer, int bufferOffset, int length)
|
||||
{
|
||||
return _buffer[ordinal].GetBytes(fieldOffset, buffer, bufferOffset, length);
|
||||
}
|
||||
|
||||
// valid for character types: Char, VarChar, Text, NChar, NVarChar, NText
|
||||
public override Int64 GetCharsLength(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].CharsLength;
|
||||
}
|
||||
public override int GetChars(SmiEventSink sink, int ordinal, long fieldOffset, char[] buffer, int bufferOffset, int length)
|
||||
{
|
||||
return _buffer[ordinal].GetChars(fieldOffset, buffer, bufferOffset, length);
|
||||
}
|
||||
public override String GetString(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].String;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.SmallInt
|
||||
public override Int16 GetInt16(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].Int16;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.Int
|
||||
public override Int32 GetInt32(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].Int32;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.BigInt, SqlDbType.Money, SqlDbType.SmallMoney
|
||||
public override Int64 GetInt64(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].Int64;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.Real
|
||||
public override Single GetSingle(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].Single;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.Float
|
||||
public override Double GetDouble(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].Double;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.Numeric (uses SqlDecimal since Decimal cannot hold full range)
|
||||
public override SqlDecimal GetSqlDecimal(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].SqlDecimal;
|
||||
}
|
||||
|
||||
// valid for DateTime, SmallDateTime, Date, and DateTime2
|
||||
public override DateTime GetDateTime(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].DateTime;
|
||||
}
|
||||
|
||||
// valid for UniqueIdentifier
|
||||
public override Guid GetGuid(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].Guid;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.Time
|
||||
public override TimeSpan GetTimeSpan(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].TimeSpan;
|
||||
}
|
||||
|
||||
// valid for DateTimeOffset
|
||||
public override DateTimeOffset GetDateTimeOffset(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
return _buffer[ordinal].DateTimeOffset;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Setters
|
||||
// Set value to null
|
||||
// valid for all types
|
||||
public override void SetDBNull(SmiEventSink sink, int ordinal)
|
||||
{
|
||||
_buffer[ordinal].SetNull();
|
||||
}
|
||||
|
||||
// valid for SqlDbType.Bit
|
||||
public override void SetBoolean(SmiEventSink sink, int ordinal, Boolean value)
|
||||
{
|
||||
_buffer[ordinal].Boolean = value;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.TinyInt
|
||||
public override void SetByte(SmiEventSink sink, int ordinal, Byte value)
|
||||
{
|
||||
_buffer[ordinal].Byte = value;
|
||||
}
|
||||
|
||||
// Semantics for SetBytes are to modify existing value, not overwrite
|
||||
// Use in combination with SetLength to ensure overwriting when necessary
|
||||
// valid for SqlDbTypes: Binary, VarBinary, Image, Udt, Xml
|
||||
// (VarBinary assumed for variants)
|
||||
public override int SetBytes(SmiEventSink sink, int ordinal, long fieldOffset, byte[] buffer, int bufferOffset, int length)
|
||||
{
|
||||
return _buffer[ordinal].SetBytes(fieldOffset, buffer, bufferOffset, length);
|
||||
}
|
||||
public override void SetBytesLength(SmiEventSink sink, int ordinal, long length)
|
||||
{
|
||||
_buffer[ordinal].BytesLength = length;
|
||||
}
|
||||
|
||||
// Semantics for SetChars are to modify existing value, not overwrite
|
||||
// Use in combination with SetLength to ensure overwriting when necessary
|
||||
// valid for character types: Char, VarChar, Text, NChar, NVarChar, NText
|
||||
// (NVarChar and global clr collation assumed for variants)
|
||||
public override int SetChars(SmiEventSink sink, int ordinal, long fieldOffset, char[] buffer, int bufferOffset, int length)
|
||||
{
|
||||
return _buffer[ordinal].SetChars(fieldOffset, buffer, bufferOffset, length);
|
||||
}
|
||||
public override void SetCharsLength(SmiEventSink sink, int ordinal, long length)
|
||||
{
|
||||
_buffer[ordinal].CharsLength = length;
|
||||
}
|
||||
|
||||
// valid for character types: Char, VarChar, Text, NChar, NVarChar, NText
|
||||
public override void SetString(SmiEventSink sink, int ordinal, string value, int offset, int length)
|
||||
{
|
||||
Debug.Assert(offset == 0 && length <= value.Length, "Invalid string length or offset"); // for sqlvariant, length could be less than value.Length
|
||||
|
||||
_buffer[ordinal].String = value.Substring(offset, length); // Perf test shows that Substring method has already optimized the case where length = value.Length
|
||||
}
|
||||
|
||||
// valid for SqlDbType.SmallInt
|
||||
public override void SetInt16(SmiEventSink sink, int ordinal, Int16 value)
|
||||
{
|
||||
_buffer[ordinal].Int16 = value;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.Int
|
||||
public override void SetInt32(SmiEventSink sink, int ordinal, Int32 value)
|
||||
{
|
||||
_buffer[ordinal].Int32 = value;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.BigInt, SqlDbType.Money, SqlDbType.SmallMoney
|
||||
public override void SetInt64(SmiEventSink sink, int ordinal, Int64 value)
|
||||
{
|
||||
_buffer[ordinal].Int64 = value;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.Real
|
||||
public override void SetSingle(SmiEventSink sink, int ordinal, Single value)
|
||||
{
|
||||
_buffer[ordinal].Single = value;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.Float
|
||||
public override void SetDouble(SmiEventSink sink, int ordinal, Double value)
|
||||
{
|
||||
_buffer[ordinal].Double = value;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.Numeric (uses SqlDecimal since Decimal cannot hold full range)
|
||||
public override void SetSqlDecimal(SmiEventSink sink, int ordinal, SqlDecimal value)
|
||||
{
|
||||
_buffer[ordinal].SqlDecimal = value;
|
||||
}
|
||||
|
||||
// valid for DateTime, SmallDateTime, Date, and DateTime2
|
||||
public override void SetDateTime(SmiEventSink sink, int ordinal, DateTime value)
|
||||
{
|
||||
_buffer[ordinal].DateTime = value;
|
||||
}
|
||||
|
||||
// valid for UniqueIdentifier
|
||||
public override void SetGuid(SmiEventSink sink, int ordinal, Guid value)
|
||||
{
|
||||
_buffer[ordinal].Guid = value;
|
||||
}
|
||||
|
||||
// SqlDbType.Time
|
||||
public override void SetTimeSpan(SmiEventSink sink, int ordinal, TimeSpan value)
|
||||
{
|
||||
_buffer[ordinal].TimeSpan = value;
|
||||
}
|
||||
|
||||
// DateTimeOffset
|
||||
public override void SetDateTimeOffset(SmiEventSink sink, int ordinal, DateTimeOffset value)
|
||||
{
|
||||
_buffer[ordinal].DateTimeOffset = value;
|
||||
}
|
||||
|
||||
// valid for SqlDbType.Variant
|
||||
public override void SetVariantMetaData(SmiEventSink sink, int ordinal, SmiMetaData metaData)
|
||||
{
|
||||
_buffer[ordinal].VariantType = metaData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
606
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/MetadataUtilsSmi.cs
vendored
Normal file
606
external/corefx/src/System.Data.SqlClient/src/Microsoft/SqlServer/Server/MetadataUtilsSmi.cs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user