You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
@@ -23,10 +23,10 @@ Global
|
||||
{EC9B0FBC-C3A2-44E6-BFC6-51E565061C28}.Debug|Any CPU.Build.0 = netstandard-Windows_NT-Debug|Any CPU
|
||||
{EC9B0FBC-C3A2-44E6-BFC6-51E565061C28}.Release|Any CPU.ActiveCfg = netstandard-Windows_NT-Release|Any CPU
|
||||
{EC9B0FBC-C3A2-44E6-BFC6-51E565061C28}.Release|Any CPU.Build.0 = netstandard-Windows_NT-Release|Any CPU
|
||||
{CBCDA53B-4C01-4267-B08C-413205FE4D8D}.Debug|Any CPU.ActiveCfg = netstandard-Windows_NT-Debug|Any CPU
|
||||
{CBCDA53B-4C01-4267-B08C-413205FE4D8D}.Debug|Any CPU.Build.0 = netstandard-Windows_NT-Debug|Any CPU
|
||||
{CBCDA53B-4C01-4267-B08C-413205FE4D8D}.Release|Any CPU.ActiveCfg = netstandard-Windows_NT-Release|Any CPU
|
||||
{CBCDA53B-4C01-4267-B08C-413205FE4D8D}.Release|Any CPU.Build.0 = netstandard-Windows_NT-Release|Any CPU
|
||||
{CBCDA53B-4C01-4267-B08C-413205FE4D8D}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{CBCDA53B-4C01-4267-B08C-413205FE4D8D}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{CBCDA53B-4C01-4267-B08C-413205FE4D8D}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{CBCDA53B-4C01-4267-B08C-413205FE4D8D}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-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.0.0</AssemblyVersion>
|
||||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||||
<AssemblyKey>MSFT</AssemblyKey>
|
||||
<!-- disable package until https://github.com/dotnet/corefx/issues/18090 is addressed -->
|
||||
<ShouldCreatePackage>false</ShouldCreatePackage>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
</Project>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<BuildConfigurations>
|
||||
<!-- Empty build configurations as this project is not currently building for any vertical -->
|
||||
;
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -3,15 +3,16 @@
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ref\System.DirectoryServices.csproj">
|
||||
<SupportedFramework>netcoreapp2.0;$(AllXamarinFrameworks)</SupportedFramework>
|
||||
<SupportedFramework>netcoreapp2.0;net45;$(AllXamarinFrameworks)</SupportedFramework>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\src\System.DirectoryServices.csproj" />
|
||||
<InboxOnTargetFramework Include="MonoAndroid10" />
|
||||
<InboxOnTargetFramework Include="MonoTouch10" />
|
||||
<InboxOnTargetFramework Include="xamarinios10" />
|
||||
<InboxOnTargetFramework Include="xamarinmac20" />
|
||||
<InboxOnTargetFramework Include="xamarintvos10" />
|
||||
<InboxOnTargetFramework Include="xamarinwatchos10" />
|
||||
|
||||
<InboxOnTargetFramework Include="net45">
|
||||
<AsFrameworkReference>true</AsFrameworkReference>
|
||||
</InboxOnTargetFramework>
|
||||
<File Include="$(PlaceHolderFile)">
|
||||
<TargetPath>runtimes/win/lib/net45</TargetPath>
|
||||
</File>
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
@@ -2,7 +2,7 @@
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<BuildConfigurations>
|
||||
netstandard-Windows_NT;
|
||||
netstandard;
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -4,19 +4,16 @@
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{CBCDA53B-4C01-4267-B08C-413205FE4D8D}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<Compile Include="System.DirectoryServices.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.IO.FileSystem.AccessControl" />
|
||||
<Reference Include="System.Runtime" />
|
||||
<Reference Include="System.Runtime.Extensions" />
|
||||
<Reference Include="System.Runtime.InteropServices" />
|
||||
<Reference Include="System.Security.AccessControl" />
|
||||
<Reference Include="System.Security.Permissions" />
|
||||
<Reference Include="System.Security.Principal.Windows" />
|
||||
<ProjectReference Include="..\..\System.IO.FileSystem.AccessControl\ref\System.IO.FileSystem.AccessControl.csproj" />
|
||||
<ProjectReference Include="..\..\System.Security.AccessControl\ref\System.Security.AccessControl.csproj" />
|
||||
<ProjectReference Include="..\..\System.Security.Permissions\ref\System.Security.Permissions.csproj" />
|
||||
<ProjectReference Include="..\..\System.Security.Principal.Windows\ref\System.Security.Principal.Windows.csproj" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
@@ -3,6 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<BuildConfigurations>
|
||||
netstandard-Windows_NT;
|
||||
netstandard;
|
||||
</BuildConfigurations>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
1
external/corefx/src/System.DirectoryServices/src/FxCopBaseline.AnyOS.cs
vendored
Normal file
1
external/corefx/src/System.DirectoryServices/src/FxCopBaseline.AnyOS.cs
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA1821", Justification = "Finalizer has implementation in Windows version.")]
|
||||
@@ -8,21 +8,30 @@
|
||||
<NoWarn>$(NoWarn);0649</NoWarn>
|
||||
<!-- Although we have a netstandard configuration, we know we are not currently UAP compatible-->
|
||||
<UWPCompatible>false</UWPCompatible>
|
||||
<GeneratePlatformNotSupportedAssembly Condition="'$(TargetsWindows)' != 'true'">true</GeneratePlatformNotSupportedAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
|
||||
<ItemGroup Condition="'$(TargetsWindows)' != 'true'">
|
||||
<Compile Include="FxCopBaseline.AnyOS.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetsWindows)' == 'true'">
|
||||
<Compile Include="System\DirectoryServices\externdll.cs" />
|
||||
<Compile Include="System\DirectoryServices\PrivilegedConfigurationManager.cs" />
|
||||
<Compile Include="System\DirectoryServices\ActiveDirectorySecurity.cs" />
|
||||
<Compile Include="System\DirectoryServices\AdsVLV.cs" />
|
||||
<Compile Include="System\DirectoryServices\AuthenticationTypes.cs" />
|
||||
<Compile Include="System\DirectoryServices\BinaryCompatibility.cs" />
|
||||
<Compile Include="System\DirectoryServices\DerefAlias.cs" />
|
||||
<Compile Include="System\DirectoryServices\DirectoryEntries.cs" />
|
||||
<Compile Include="System\DirectoryServices\DirectoryEntry.cs" />
|
||||
<Compile Include="System\DirectoryServices\DirectoryEntry.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="System\DirectoryServices\DirectoryEntryConfiguration.cs" />
|
||||
<Compile Include="System\DirectoryServices\DirectorySearcher.cs" />
|
||||
<Compile Include="System\DirectoryServices\DirectorySearcher.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="System\DirectoryServices\DirectorySynchronization.cs" />
|
||||
<Compile Include="System\DirectoryServices\DirectorySynchronizationFlags.cs" />
|
||||
<Compile Include="System\DirectoryServices\DirectoryVirtualListView.cs" />
|
||||
|
||||
@@ -969,10 +969,8 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
{
|
||||
AuthenticationTypes authType = Utils.DefaultAuthType | AuthenticationTypes.FastBind | AuthenticationTypes.Delegation;
|
||||
|
||||
if (DirectoryContext.ServerBindSupported)
|
||||
{
|
||||
authType |= AuthenticationTypes.ServerBind;
|
||||
}
|
||||
|
||||
authType |= AuthenticationTypes.ServerBind;
|
||||
|
||||
tempEntry = new DirectoryEntry("LDAP://" + context.GetServerName() + "/" + distinguishedName, context.UserName, context.Password, authType);
|
||||
parent = tempEntry.Parent;
|
||||
@@ -1020,10 +1018,9 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
{
|
||||
AuthenticationTypes authType = Utils.DefaultAuthType | AuthenticationTypes.FastBind;
|
||||
|
||||
if (DirectoryContext.ServerBindSupported)
|
||||
{
|
||||
authType |= AuthenticationTypes.ServerBind;
|
||||
}
|
||||
|
||||
authType |= AuthenticationTypes.ServerBind;
|
||||
|
||||
tempEntry = new DirectoryEntry("LDAP://" + context.Name + "/" + distinguishedName, context.UserName, context.Password, authType);
|
||||
parent = tempEntry.Parent;
|
||||
_domainDNSEntry = parent.Children.Add(Utils.GetRdnFromDN(distinguishedName), objectClass);
|
||||
|
||||
@@ -396,10 +396,8 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
|
||||
if (isServer)
|
||||
{
|
||||
if (DirectoryContext.ServerBindSupported)
|
||||
{
|
||||
authType |= AuthenticationTypes.ServerBind;
|
||||
}
|
||||
authType |= AuthenticationTypes.ServerBind;
|
||||
|
||||
if (isGC)
|
||||
{
|
||||
rootEntry = new DirectoryEntry("GC://" + forestContext.GetServerName(), forestContext.UserName, forestContext.Password, authType);
|
||||
|
||||
@@ -6,15 +6,13 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
{
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Globalization;
|
||||
using System.Security.Principal;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using System.Security.Permissions;
|
||||
using System.IO;
|
||||
|
||||
|
||||
public enum DirectoryContextType
|
||||
{
|
||||
Domain = 0,
|
||||
@@ -35,11 +33,6 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
private bool _validated = false;
|
||||
private bool _contextIsValid = false;
|
||||
|
||||
private static bool s_platformSupported;
|
||||
private static bool s_serverBindSupported;
|
||||
private static bool s_dnsgetdcSupported;
|
||||
private static bool s_w2k;
|
||||
|
||||
internal static LoadLibrarySafeHandle ADHandle;
|
||||
internal static LoadLibrarySafeHandle ADAMHandle;
|
||||
|
||||
@@ -48,94 +41,13 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
[EnvironmentPermission(SecurityAction.Assert, Unrestricted = true)]
|
||||
static DirectoryContext()
|
||||
{
|
||||
//
|
||||
// Everything supported until proven otherwise
|
||||
//
|
||||
s_platformSupported = true;
|
||||
s_serverBindSupported = true;
|
||||
s_dnsgetdcSupported = true;
|
||||
s_w2k = false;
|
||||
|
||||
//
|
||||
// S.DS.AD only supported on W2K above
|
||||
//
|
||||
OperatingSystem os = Environment.OSVersion;
|
||||
|
||||
if (os.Platform == PlatformID.Win32NT &&
|
||||
os.Version.Major >= 5)
|
||||
{
|
||||
if (os.Version.Major == 5 && os.Version.Minor == 0)
|
||||
{
|
||||
//
|
||||
// This is W2K: DsGetDcOpen/Next/Close not supported
|
||||
//
|
||||
s_w2k = true;
|
||||
s_dnsgetdcSupported = false;
|
||||
|
||||
//
|
||||
// Now get the service pack information as well to check if ADS_SERVER_BIND
|
||||
// is supported (Could not have used OSVersionInfoEx earlier itself as it is not
|
||||
// supported on all platforms)
|
||||
//
|
||||
OSVersionInfoEx osviex = new OSVersionInfoEx();
|
||||
bool result = NativeMethods.GetVersionEx(osviex);
|
||||
if (!result)
|
||||
{
|
||||
int errorCode = NativeMethods.GetLastError();
|
||||
Debug.Fail(string.Format(CultureInfo.InvariantCulture, "NativeMethods.GetVersionEx (with OSVERSIONINFOEX) failed with error code {0}.", errorCode));
|
||||
throw new SystemException(String.Format(CultureInfo.CurrentCulture, SR.VersionFailure , errorCode)); ;
|
||||
}
|
||||
|
||||
if (osviex.servicePackMajor < 3)
|
||||
{
|
||||
//
|
||||
// ADS_SERVER_BIND is not supported on platforms prior to W2K SP3
|
||||
//
|
||||
s_serverBindSupported = false;
|
||||
}
|
||||
}
|
||||
|
||||
// load ntdsapi.dll for AD and ADAM
|
||||
GetLibraryHandle();
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// S.DS.AD does not support this platform (< 5.0)
|
||||
//
|
||||
s_platformSupported = false;
|
||||
s_serverBindSupported = false;
|
||||
s_dnsgetdcSupported = false;
|
||||
}
|
||||
}
|
||||
|
||||
internal static bool ServerBindSupported
|
||||
{
|
||||
get
|
||||
{
|
||||
return s_serverBindSupported;
|
||||
}
|
||||
}
|
||||
|
||||
internal static bool DnsgetdcSupported
|
||||
{
|
||||
get
|
||||
{
|
||||
return s_dnsgetdcSupported;
|
||||
}
|
||||
// load ntdsapi.dll for AD and ADAM
|
||||
GetLibraryHandle();
|
||||
}
|
||||
|
||||
// Internal Constructors
|
||||
internal void InitializeDirectoryContext(DirectoryContextType contextType, string name, string username, string password)
|
||||
{
|
||||
//
|
||||
// Check if the platform is currently supported or not
|
||||
//
|
||||
if (!s_platformSupported)
|
||||
{
|
||||
throw new PlatformNotSupportedException(SR.SupportedPlatforms);
|
||||
}
|
||||
|
||||
_name = name;
|
||||
_contextType = contextType;
|
||||
_credential = new NetworkCredential(username, password);
|
||||
@@ -560,19 +472,7 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
|
||||
if (!_validated)
|
||||
{
|
||||
if (s_w2k)
|
||||
{
|
||||
//
|
||||
// On W2K client we need to validate that it is not a domain or application partition
|
||||
//
|
||||
_contextIsValid = (IsContextValid(this, DirectoryContextType.DirectoryServer) &&
|
||||
(!(IsContextValid(this, DirectoryContextType.Domain))) &&
|
||||
(!(IsContextValid(this, DirectoryContextType.ApplicationPartition))));
|
||||
}
|
||||
else
|
||||
{
|
||||
_contextIsValid = IsContextValid(this, DirectoryContextType.DirectoryServer);
|
||||
}
|
||||
_contextIsValid = IsContextValid(this, DirectoryContextType.DirectoryServer);
|
||||
_validated = true;
|
||||
}
|
||||
return _contextIsValid;
|
||||
|
||||
@@ -281,7 +281,7 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
// use ServerBind flag is the target is a server and the ServerBind option is supported
|
||||
//
|
||||
|
||||
if (DirectoryContext.ServerBindSupported && useServerBind)
|
||||
if (useServerBind)
|
||||
{
|
||||
authType |= AuthenticationTypes.ServerBind;
|
||||
}
|
||||
|
||||
@@ -929,14 +929,7 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
{
|
||||
DirectoryEntry de;
|
||||
|
||||
if (DirectoryContext.ServerBindSupported)
|
||||
{
|
||||
de = new DirectoryEntry("LDAP://" + dc.Name + "/RootDSE", context.UserName, context.Password, Utils.DefaultAuthType | AuthenticationTypes.ServerBind);
|
||||
}
|
||||
else
|
||||
{
|
||||
de = new DirectoryEntry("LDAP://" + dc.Name + "/RootDSE", context.UserName, context.Password, Utils.DefaultAuthType);
|
||||
}
|
||||
de = new DirectoryEntry("LDAP://" + dc.Name + "/RootDSE", context.UserName, context.Password, Utils.DefaultAuthType | AuthenticationTypes.ServerBind);
|
||||
|
||||
de.Bind(true);
|
||||
}
|
||||
@@ -1351,14 +1344,7 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
{
|
||||
DirectoryEntry de = new DirectoryEntry("LDAP://" + Name);
|
||||
|
||||
if (DirectoryContext.ServerBindSupported)
|
||||
{
|
||||
de.AuthenticationType = Utils.DefaultAuthType | AuthenticationTypes.ServerBind;
|
||||
}
|
||||
else
|
||||
{
|
||||
de.AuthenticationType = Utils.DefaultAuthType;
|
||||
}
|
||||
de.AuthenticationType = Utils.DefaultAuthType | AuthenticationTypes.ServerBind;
|
||||
|
||||
de.Username = context.UserName;
|
||||
de.Password = context.Password;
|
||||
|
||||
@@ -93,7 +93,10 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
|
||||
public ActiveDirectoryObjectNotFoundException() : base() { }
|
||||
|
||||
protected ActiveDirectoryObjectNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { }
|
||||
protected ActiveDirectoryObjectNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
|
||||
{
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
public Type Type
|
||||
{
|
||||
@@ -139,7 +142,10 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
|
||||
public ActiveDirectoryOperationException() : base(SR.DSUnknownFailure) { }
|
||||
|
||||
protected ActiveDirectoryOperationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
|
||||
protected ActiveDirectoryOperationException(SerializationInfo info, StreamingContext context) : base(info, context)
|
||||
{
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
public int ErrorCode
|
||||
{
|
||||
@@ -148,8 +154,7 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
return _errorCode;
|
||||
}
|
||||
}
|
||||
|
||||
[SecurityPermissionAttribute(SecurityAction.LinkDemand, SerializationFormatter = true)]
|
||||
|
||||
public override void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
|
||||
{
|
||||
base.GetObjectData(serializationInfo, streamingContext);
|
||||
@@ -180,7 +185,10 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
|
||||
public ActiveDirectoryServerDownException() : base() { }
|
||||
|
||||
protected ActiveDirectoryServerDownException(SerializationInfo info, StreamingContext context) : base(info, context) { }
|
||||
protected ActiveDirectoryServerDownException(SerializationInfo info, StreamingContext context) : base(info, context)
|
||||
{
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
public int ErrorCode
|
||||
{
|
||||
@@ -210,8 +218,7 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
[SecurityPermissionAttribute(SecurityAction.LinkDemand, SerializationFormatter = true)]
|
||||
|
||||
public override void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
|
||||
{
|
||||
base.GetObjectData(serializationInfo, streamingContext);
|
||||
@@ -227,7 +234,10 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
|
||||
public ActiveDirectoryObjectExistsException() : base() { }
|
||||
|
||||
protected ActiveDirectoryObjectExistsException(SerializationInfo info, StreamingContext context) : base(info, context) { }
|
||||
protected ActiveDirectoryObjectExistsException(SerializationInfo info, StreamingContext context) : base(info, context)
|
||||
{
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
@@ -246,7 +256,10 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
|
||||
public SyncFromAllServersOperationException() : base(SR.DSSyncAllFailure) { }
|
||||
|
||||
protected SyncFromAllServersOperationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
|
||||
protected SyncFromAllServersOperationException(SerializationInfo info, StreamingContext context) : base(info, context)
|
||||
{
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
public SyncFromAllServersErrorInformation[] ErrorInformation
|
||||
{
|
||||
@@ -262,8 +275,7 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
return tempError;
|
||||
}
|
||||
}
|
||||
|
||||
[SecurityPermissionAttribute(SecurityAction.LinkDemand, SerializationFormatter = true)]
|
||||
|
||||
public override void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
|
||||
{
|
||||
base.GetObjectData(serializationInfo, streamingContext);
|
||||
@@ -286,7 +298,10 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
|
||||
public ForestTrustCollisionException() : base(SR.ForestTrustCollision) { }
|
||||
|
||||
protected ForestTrustCollisionException(SerializationInfo info, StreamingContext context) : base(info, context) { }
|
||||
protected ForestTrustCollisionException(SerializationInfo info, StreamingContext context) : base(info, context)
|
||||
{
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
public ForestTrustRelationshipCollisionCollection Collisions
|
||||
{
|
||||
@@ -295,8 +310,7 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
return _collisions;
|
||||
}
|
||||
}
|
||||
|
||||
[SecurityPermissionAttribute(SecurityAction.LinkDemand, SerializationFormatter = true)]
|
||||
|
||||
public override void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
|
||||
{
|
||||
base.GetObjectData(serializationInfo, streamingContext);
|
||||
|
||||
@@ -458,14 +458,7 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
{
|
||||
DirectoryEntry de = new DirectoryEntry("GC://" + Name);
|
||||
|
||||
if (DirectoryContext.ServerBindSupported)
|
||||
{
|
||||
de.AuthenticationType = Utils.DefaultAuthType | AuthenticationTypes.ServerBind;
|
||||
}
|
||||
else
|
||||
{
|
||||
de.AuthenticationType = Utils.DefaultAuthType;
|
||||
}
|
||||
de.AuthenticationType = Utils.DefaultAuthType | AuthenticationTypes.ServerBind;
|
||||
|
||||
de.Username = context.UserName;
|
||||
de.Password = context.Password;
|
||||
|
||||
@@ -107,28 +107,9 @@ namespace System.DirectoryServices.ActiveDirectory
|
||||
throw ExceptionHelper.GetExceptionFromErrorCode(errorCode);
|
||||
}
|
||||
}
|
||||
|
||||
if (DirectoryContext.DnsgetdcSupported)
|
||||
{
|
||||
// this will get both the non site specific and the site specific records
|
||||
allDCs = DnsGetDcWrapper(domainName, siteName, dcFlags);
|
||||
}
|
||||
else
|
||||
{
|
||||
// first get all the non site specific
|
||||
allDCs = DnsQueryWrapper(domainName, null, dcFlags);
|
||||
// now get all the site specific records
|
||||
if (siteName != null)
|
||||
{
|
||||
foreach (string dc in DnsQueryWrapper(domainName, siteName, dcFlags).Keys)
|
||||
{
|
||||
if (!allDCs.Contains(dc))
|
||||
{
|
||||
allDCs.Add(dc, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// this will get both the non site specific and the site specific records
|
||||
allDCs = DnsGetDcWrapper(domainName, siteName, dcFlags);
|
||||
|
||||
foreach (string dcName in allDCs.Keys)
|
||||
{
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
// 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.Security;
|
||||
using System.Reflection;
|
||||
using System.Security.Permissions;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
namespace System.DirectoryServices
|
||||
{
|
||||
// This class uses reflection on System.Runtime.Versioning.BinaryCompatibility type.
|
||||
internal static class BinaryCompatibility
|
||||
{
|
||||
internal static bool TargetsAtLeast_Desktop_V4_5_3 { get { return s_targetsAtLeast_Desktop_V4_5_3; } }
|
||||
|
||||
private static bool s_targetsAtLeast_Desktop_V4_5_3 = RunningOnCheck("TargetsAtLeast_Desktop_V4_5_3");
|
||||
|
||||
[SecuritySafeCritical]
|
||||
[ReflectionPermission(SecurityAction.Assert, Unrestricted = true)]
|
||||
private static bool RunningOnCheck(string propertyName)
|
||||
{
|
||||
Type binaryCompatabilityType;
|
||||
|
||||
try
|
||||
{
|
||||
binaryCompatabilityType = typeof(Object).GetTypeInfo().Assembly.GetType("System.Runtime.Versioning.BinaryCompatibility", false);
|
||||
}
|
||||
catch (TypeLoadException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (binaryCompatabilityType == null)
|
||||
return false;
|
||||
|
||||
PropertyInfo runningOnProperty = binaryCompatabilityType.GetProperty(propertyName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
|
||||
if (runningOnProperty == null)
|
||||
return false;
|
||||
|
||||
return (bool)runningOnProperty.GetValue(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,10 @@ namespace System.DirectoryServices
|
||||
public DirectoryServicesCOMException() { }
|
||||
public DirectoryServicesCOMException(string message) : base(message) { }
|
||||
public DirectoryServicesCOMException(string message, Exception inner) : base(message, inner) { }
|
||||
protected DirectoryServicesCOMException(SerializationInfo info, StreamingContext context) : base(info, context) { }
|
||||
protected DirectoryServicesCOMException(SerializationInfo info, StreamingContext context) : base(info, context)
|
||||
{
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
internal DirectoryServicesCOMException(string extendedMessage, int extendedError, COMException e) : base(e.Message, e.ErrorCode)
|
||||
{
|
||||
@@ -44,8 +47,7 @@ namespace System.DirectoryServices
|
||||
return _extendedmessage;
|
||||
}
|
||||
}
|
||||
|
||||
[SecurityPermissionAttribute(SecurityAction.LinkDemand, SerializationFormatter = true)]
|
||||
|
||||
public override void GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext)
|
||||
{
|
||||
base.GetObjectData(serializationInfo, streamingContext);
|
||||
|
||||
@@ -31,14 +31,7 @@ namespace System.DirectoryServices
|
||||
public SortOption(string propertyName, SortDirection direction)
|
||||
{
|
||||
this.PropertyName = propertyName;
|
||||
if (BinaryCompatibility.TargetsAtLeast_Desktop_V4_5_3)
|
||||
{
|
||||
this.Direction = direction;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Direction = _sortDirection;
|
||||
}
|
||||
this.Direction = direction;
|
||||
}
|
||||
|
||||
/// <include file='doc\SortOption.uex' path='docs/doc[@for="SortOption.PropertyName"]/*' />
|
||||
|
||||
Reference in New Issue
Block a user