Skip to content
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
4 changes: 1 addition & 3 deletions src/coreclr/dlls/mscoree/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ set(CLR_SOURCES

if(CLR_CMAKE_TARGET_WIN32)
list(APPEND CLR_SOURCES
${CLR_SRC_NATIVE_DIR}/libs/Common/delayloadhook_windows.cpp
Native.rc
Native.rc
)

set (DEF_SOURCES
mscorwks_ntdef.src
)
Expand Down
7 changes: 0 additions & 7 deletions src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ if (CLR_CMAKE_HOST_WIN32)
# invariants (e.g. size of region between Jit_PatchedCodeLast-Jit_PatchCodeStart needs to fit in a page).
add_linker_flag("/INCREMENTAL:NO")

# Delay load libraries required for WinRT as that is not supported on all platforms
add_linker_flag("/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll")

# Delay load version.dll so that we can specify how to search when loading it as it is not part of Windows' known DLLs
add_linker_flag("/DELAYLOAD:version.dll")

# No library groups for Win32
set(START_LIBRARY_GROUP)
set(END_LIBRARY_GROUP)
Expand Down Expand Up @@ -131,7 +125,6 @@ if(CLR_CMAKE_TARGET_WIN32)
shlwapi.lib
bcrypt.lib
RuntimeObject.lib
delayimp.lib
)
else()
list(APPEND CORECLR_LIBRARIES
Expand Down
43 changes: 0 additions & 43 deletions src/coreclr/inc/ostype.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,6 @@
#define LIMITED_METHOD_CONTRACT
#endif

//*****************************************************************************
// Enum to track which version of the OS we are running
// Note that Win7 is the minimum supported platform. Any code using
// utilcode (which includes the CLR's execution engine) will fail to start
// on a pre-Win7 platform. This is enforced by InitRunningOnVersionStatus.
//*****************************************************************************
typedef enum {
RUNNING_ON_STATUS_UNINITED = 0,
RUNNING_ON_WIN7 = 1,
RUNNING_ON_WIN8 = 2
} RunningOnStatusEnum;

extern RunningOnStatusEnum gRunningOnStatus;

void InitRunningOnVersionStatus();

//*****************************************************************************
// Returns true if you are running on Windows 8 or newer.
//*****************************************************************************
inline BOOL RunningOnWin8()
{
WRAPPER_NO_CONTRACT;
#if (!defined(HOST_X86) && !defined(HOST_AMD64))
return TRUE;
#else
if (gRunningOnStatus == RUNNING_ON_STATUS_UNINITED)
{
InitRunningOnVersionStatus();
}

return (gRunningOnStatus >= RUNNING_ON_WIN8) ? TRUE : FALSE;
#endif
}

#ifdef FEATURE_COMINTEROP

inline BOOL WinRTSupported()
{
return RunningOnWin8();
}

#endif // FEATURE_COMINTEROP

#ifdef HOST_64BIT
inline BOOL RunningInWow64()
{
Expand Down
35 changes: 0 additions & 35 deletions src/coreclr/utilcode/util_nodependencies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,8 @@
#include "utilcode.h"
#include "ex.h"

#ifdef HOST_WINDOWS
#include <versionhelpers.h>
#endif

#if !defined(FEATURE_UTILCODE_NO_DEPENDENCIES) || defined(_DEBUG)

RunningOnStatusEnum gRunningOnStatus = RUNNING_ON_STATUS_UNINITED;

#define NON_SUPPORTED_PLATFORM_TERMINATE_ERROR_CODE 0xBAD1BAD1

//*****************************************************************************
// One time initialization of the OS version
//*****************************************************************************
void InitRunningOnVersionStatus ()
{
#ifdef HOST_WINDOWS
STATIC_CONTRACT_NOTHROW;
STATIC_CONTRACT_GC_NOTRIGGER;
STATIC_CONTRACT_CANNOT_TAKE_LOCK;

if(IsWindows8OrGreater())
{
gRunningOnStatus = RUNNING_ON_WIN8;
}
else if(IsWindows7OrGreater())
{
gRunningOnStatus = RUNNING_ON_WIN7;
}
else
{
// The current platform isn't supported. Display a message to this effect and exit.
minipal_log_print_error("Platform not supported: Windows 7 is the minimum supported version\n");
TerminateProcess(GetCurrentProcess(), NON_SUPPORTED_PLATFORM_TERMINATE_ERROR_CODE);
}
#endif // HOST_WINDOWS
} // InitRunningOnVersionStatus

#ifndef HOST_64BIT
//------------------------------------------------------------------------------
// Returns TRUE if we are running on a 64-bit OS in WoW, FALSE otherwise.
Expand Down
10 changes: 3 additions & 7 deletions src/coreclr/vm/threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2363,7 +2363,6 @@ void Thread::BaseWinRTUninitialize()
STATIC_CONTRACT_GC_TRIGGERS;
STATIC_CONTRACT_MODE_PREEMPTIVE;

_ASSERTE(WinRTSupported());
_ASSERTE(GetThread() == this);
_ASSERTE(IsWinRTInitialized());

Expand Down Expand Up @@ -2401,7 +2400,6 @@ void Thread::CoUninitialize()
#ifdef FEATURE_COMINTEROP
if (IsWinRTInitialized())
{
_ASSERTE(WinRTSupported());
BaseWinRTUninitialize();
ResetWinRTInitialized();
}
Expand Down Expand Up @@ -2612,7 +2610,6 @@ void Thread::CleanupCOMState()
#ifdef FEATURE_COMINTEROP
if (IsWinRTInitialized())
{
_ASSERTE(WinRTSupported());
BaseWinRTUninitialize();
ResetWinRTInitialized();
}
Expand Down Expand Up @@ -3783,7 +3780,6 @@ Thread::ApartmentState Thread::SetApartment(ApartmentState state)
#ifdef FEATURE_COMINTEROP
if (IsWinRTInitialized())
{
_ASSERTE(WinRTSupported());
BaseWinRTUninitialize();
ResetWinRTInitialized();
}
Expand Down Expand Up @@ -3875,10 +3871,10 @@ Thread::ApartmentState Thread::SetApartment(ApartmentState state)
_ASSERTE(!"Unexpected HRESULT returned from CoInitializeEx!");
}

// If WinRT is supported on this OS, also initialize it at the same time. Since WinRT sits on top of COM
// we need to make sure that it is initialized in the same threading mode as we just started COM itself
// Since WinRT sits on top of COM we need to make sure that it is initialized
// in the same threading mode as we just started COM itself
// with (or that we detected COM had already been started with).
if (WinRTSupported() && !IsWinRTInitialized())
if (!IsWinRTInitialized())
{
GCX_PREEMP();

Expand Down
10 changes: 1 addition & 9 deletions src/native/corehost/apphost/static/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ if(CLR_CMAKE_TARGET_WIN32)
add_compile_definitions(UNICODE)
list(APPEND SOURCES
../apphost.windows.cpp
${CLR_SRC_NATIVE_DIR}/libs/Common/delayloadhook_windows.cpp
)

list(APPEND HEADERS
Expand Down Expand Up @@ -119,12 +118,6 @@ if(CLR_CMAKE_TARGET_WIN32)
# Incremental linking results in the linker inserting extra padding and routing function calls via thunks that can break the
# invariants (e.g. size of region between Jit_PatchedCodeLast-Jit_PatchCodeStart needs to fit in a page).
add_linker_flag("/INCREMENTAL:NO")

# Delay load libraries required for WinRT as that is not supported on all platforms
add_linker_flag("/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll")

# Delay load version.dll so that we can specify how to search when loading it as it is not part of Windows' known DLLs
add_linker_flag("/DELAYLOAD:version.dll")
endif()

if(CLR_CMAKE_TARGET_WIN32)
Expand All @@ -145,7 +138,6 @@ if(CLR_CMAKE_TARGET_WIN32)
shell32.lib
bcrypt.lib
RuntimeObject.lib
delayimp.lib
)

# additional requirements for System.IO.Compression.Native
Expand Down Expand Up @@ -309,4 +301,4 @@ add_sanitizer_runtime_support(singlefilehost)

if (CLR_CMAKE_HOST_APPLE)
adhoc_sign_with_entitlements(singlefilehost "${CLR_ENG_NATIVE_DIR}/entitlements.plist")
endif()
endif()
25 changes: 0 additions & 25 deletions src/native/libs/Common/delayloadhook_windows.cpp

This file was deleted.

Loading