Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Remove remaining FEATURE_CORECLR defines #8555

Merged
merged 1 commit into from
Dec 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 0 additions & 77 deletions src/mscorlib/Common/PinnableBufferCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,6 @@ private void Setup(Func<object, bool> callback, object targetObj)
#endregion
}


#if FEATURE_CORECLR
internal sealed class PinnableBufferCacheEventSource
{
public static readonly PinnableBufferCacheEventSource Log = new PinnableBufferCacheEventSource();
Expand Down Expand Up @@ -568,79 +566,4 @@ static internal unsafe long AddressOfObject(byte[] array)
return 0;
}
}
#else
/// <summary>
/// PinnableBufferCacheEventSource is a private eventSource that we are using to
/// debug and monitor the effectiveness of PinnableBufferCache
/// </summary>
#if PINNABLEBUFFERCACHE_MSCORLIB
[EventSource(Name = "Microsoft-DotNETRuntime-PinnableBufferCache")]
#else
[EventSource(Name = "Microsoft-DotNETRuntime-PinnableBufferCache-System")]
#endif
internal sealed class PinnableBufferCacheEventSource : EventSource
{
public static readonly PinnableBufferCacheEventSource Log = new PinnableBufferCacheEventSource();

[Event(1, Level = EventLevel.Verbose)]
public void DebugMessage(string message) { if (IsEnabled()) WriteEvent(1, message); }
[Event(2, Level = EventLevel.Verbose)]
public void DebugMessage1(string message, long value) { if (IsEnabled()) WriteEvent(2, message, value); }
[Event(3, Level = EventLevel.Verbose)]
public void DebugMessage2(string message, long value1, long value2) { if (IsEnabled()) WriteEvent(3, message, value1, value2); }
[Event(18, Level = EventLevel.Verbose)]
public void DebugMessage3(string message, long value1, long value2, long value3) { if (IsEnabled()) WriteEvent(18, message, value1, value2, value3); }

[Event(4)]
public void Create(string cacheName) { if (IsEnabled()) WriteEvent(4, cacheName); }

[Event(5, Level = EventLevel.Verbose)]
public void AllocateBuffer(string cacheName, ulong objectId, int objectHash, int objectGen, int freeCountAfter) { if (IsEnabled()) WriteEvent(5, cacheName, objectId, objectHash, objectGen, freeCountAfter); }
[Event(6)]
public void AllocateBufferFromNotGen2(string cacheName, int notGen2CountAfter) { if (IsEnabled()) WriteEvent(6, cacheName, notGen2CountAfter); }
[Event(7)]
public void AllocateBufferCreatingNewBuffers(string cacheName, int totalBuffsBefore, int objectCount) { if (IsEnabled()) WriteEvent(7, cacheName, totalBuffsBefore, objectCount); }
[Event(8)]
public void AllocateBufferAged(string cacheName, int agedCount) { if (IsEnabled()) WriteEvent(8, cacheName, agedCount); }
[Event(9)]
public void AllocateBufferFreeListEmpty(string cacheName, int notGen2CountBefore) { if (IsEnabled()) WriteEvent(9, cacheName, notGen2CountBefore); }

[Event(10, Level = EventLevel.Verbose)]
public void FreeBuffer(string cacheName, ulong objectId, int objectHash, int freeCountBefore) { if (IsEnabled()) WriteEvent(10, cacheName, objectId, objectHash, freeCountBefore); }
[Event(11)]
public void FreeBufferStillTooYoung(string cacheName, int notGen2CountBefore) { if (IsEnabled()) WriteEvent(11, cacheName, notGen2CountBefore); }

[Event(13)]
public void TrimCheck(string cacheName, int totalBuffs, bool neededMoreThanFreeList, int deltaMSec) { if (IsEnabled()) WriteEvent(13, cacheName, totalBuffs, neededMoreThanFreeList, deltaMSec); }
[Event(14)]
public void TrimFree(string cacheName, int totalBuffs, int freeListCount, int toBeFreed) { if (IsEnabled()) WriteEvent(14, cacheName, totalBuffs, freeListCount, toBeFreed); }
[Event(15)]
public void TrimExperiment(string cacheName, int totalBuffs, int freeListCount, int numTrimTrial) { if (IsEnabled()) WriteEvent(15, cacheName, totalBuffs, freeListCount, numTrimTrial); }
[Event(16)]
public void TrimFreeSizeOK(string cacheName, int totalBuffs, int freeListCount) { if (IsEnabled()) WriteEvent(16, cacheName, totalBuffs, freeListCount); }
[Event(17)]
public void TrimFlush(string cacheName, int totalBuffs, int freeListCount, int notGen2CountBefore) { if (IsEnabled()) WriteEvent(17, cacheName, totalBuffs, freeListCount, notGen2CountBefore); }
[Event(20)]
public void AgePendingBuffersResults(string cacheName, int promotedToFreeListCount, int heldBackCount) { if (IsEnabled()) WriteEvent(20, cacheName, promotedToFreeListCount, heldBackCount); }
[Event(21)]
public void WalkFreeListResult(string cacheName, int freeListCount, int gen0BuffersInFreeList) { if (IsEnabled()) WriteEvent(21, cacheName, freeListCount, gen0BuffersInFreeList); }


static internal ulong AddressOf(object obj)
{
var asByteArray = obj as byte[];
if (asByteArray != null)
return (ulong)AddressOfByteArray(asByteArray);
return 0;
}

static internal unsafe long AddressOfByteArray(byte[] array)
{
if (array == null)
return 0;
fixed (byte* ptr = array)
return (long)(ptr - 2 * sizeof(void*));
}
}
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ internal FileStreamCompletionSource(FileStream stream, int numBufferedBytes, byt

internal NativeOverlapped* Overlapped
{
[SecurityCritical]get { return _overlapped; }
get { return _overlapped; }
}

public void SetCompletedSynchronously(int numBytes)
Expand Down
1 change: 0 additions & 1 deletion src/mscorlib/mscorlib.shared.sources.props
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
<InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\IRegistrationServices.cs" />
<InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\ITypeLibConverter.cs" />
<InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\RegistrationServices.cs" />
<InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\TypeLibConverter.cs" />
<InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\UCOMIBindCtx.cs" />
<InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\UCOMIConnectionPointContainer.cs" />
<InteropSources Include="$(BclSourcesRoot)\System\Runtime\InteropServices\UCOMIConnectionPoint.cs" />
Expand Down
3 changes: 0 additions & 3 deletions src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ public void DisableComObjectEagerCleanup()
** thread is not currently blocked in that manner, it will be interrupted
** when it next begins to block.
=========================================================================*/
#if FEATURE_CORECLR
#else
#endif
#pragma warning disable 618 // obsolete types: SecurityPermissionAttribute, SecurityAction
#pragma warning restore 618 // obsolete types: SecurityPermissionAttribute, SecurityAction
public void Interrupt() => InterruptInternal();
Expand Down
14 changes: 0 additions & 14 deletions src/mscorlib/src/Microsoft/Win32/RegistryKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,6 @@ private unsafe RegistryKey CreateSubKeyInternal(String subkey, RegistryKeyPermis
*
* @return the Subkey requested, or <b>null</b> if the operation failed.
*/
#if FEATURE_CORECLR
#else
#endif
public RegistryKey OpenSubKey(string name, bool writable ) {
ValidateKeyName(name);
EnsureNotDisposed();
Expand Down Expand Up @@ -684,8 +681,6 @@ private unsafe RegistryKey CreateSubKeyInternal(String subkey, RegistryKeyPermis
*
* @return the Subkey requested, or <b>null</b> if the operation failed.
*/
#if FEATURE_CORECLR
#endif
public RegistryKey OpenSubKey(String name) {
return OpenSubKey(name, false);
}
Expand Down Expand Up @@ -738,9 +733,6 @@ private unsafe RegistryKey CreateSubKeyInternal(String subkey, RegistryKeyPermis
*
* @return all subkey names.
*/
#if FEATURE_CORECLR
#else
#endif
public String[] GetSubKeyNames() {
CheckPermission(RegistryInternalCheck.CheckKeyReadPermission, null, false, RegistryKeyPermissionCheck.Default);
return InternalGetSubKeyNames();
Expand Down Expand Up @@ -886,17 +878,11 @@ private unsafe RegistryKey CreateSubKeyInternal(String subkey, RegistryKeyPermis
*
* @return the data associated with the value.
*/
#if FEATURE_CORECLR
#else
#endif
public Object GetValue(String name, Object defaultValue) {
CheckPermission(RegistryInternalCheck.CheckValueReadPermission, name, false, RegistryKeyPermissionCheck.Default);
return InternalGetValue(name, defaultValue, false, true);
}

#if FEATURE_CORECLR
#else
#endif
[ComVisible(false)]
public Object GetValue(String name, Object defaultValue, RegistryValueOptions options) {
if( options < RegistryValueOptions.None || options > RegistryValueOptions.DoNotExpandEnvironmentNames) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,8 @@
// See the LICENSE file in the project root for more information.

namespace Microsoft.Win32 {
using Microsoft.Win32;
using Microsoft.Win32.SafeHandles;
using System;
using System.Runtime.CompilerServices;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;

[HostProtectionAttribute(MayLeakOnAbort = true)]
sealed internal class SafeLibraryHandle : SafeHandleZeroOrMinusOneIsInvalid {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// 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.Win32.SafeHandles {

namespace Microsoft.Win32.SafeHandles
{
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
Expand Down
13 changes: 1 addition & 12 deletions src/mscorlib/src/Microsoft/Win32/Win32Native.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1737,18 +1737,11 @@ internal static extern
[In] uint dwFlags);
#endif // FEATURE_LEGACYSURFACE

#if FEATURE_CORECLR
[DllImport(NTDLL, CharSet=CharSet.Unicode, SetLastError=true)]
internal static extern
int RtlNtStatusToDosError (
[In] int status);
#else
// identical to RtlNtStatusToDosError, but we are in ask mode for desktop CLR
[DllImport(ADVAPI32, CharSet = CharSet.Unicode, SetLastError = true)]
internal static extern
int LsaNtStatusToWinError (
[In] int status);
#endif

// Get the current FIPS policy setting on Vista and above
[DllImport("bcrypt.dll")]
internal static extern uint BCryptGetFipsAlgorithmMode(
Expand Down Expand Up @@ -2295,7 +2288,6 @@ internal static extern
byte[] dacl,
byte[] sacl );

#if FEATURE_CORECLR
[DllImport(KERNEL32, CharSet=CharSet.Unicode)]
[SuppressUnmanagedCodeSecurityAttribute()]
internal unsafe static extern int WideCharToMultiByte(
Expand All @@ -2317,13 +2309,11 @@ internal static extern
int cchMultiByte,
char* lpWideCharStr,
int cchWideChar);
#endif // FEATURE_CORECLR

[DllImport(KERNEL32, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
internal extern static bool QueryUnbiasedInterruptTime(out ulong UnbiasedTime);

#if FEATURE_CORECLR
#if FEATURE_PAL
[DllImport(KERNEL32, EntryPoint = "PAL_Random")]
internal extern static bool Random(bool bStrong,
Expand All @@ -2349,7 +2339,6 @@ internal static void Random(bool bStrong, byte[] buffer, int length)
}
}
}
#endif
#endif
}
}
Loading