From 8bd04e0170040096c201d0013c63833fe4b2e8d5 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Thu, 18 Jun 2020 23:29:56 -0700 Subject: [PATCH] Delete FEATURE_APPX (#38112) --- src/coreclr/clr.featuredefines.props | 2 - src/coreclr/clrdefinitions.cmake | 1 - .../System.Private.CoreLib.csproj | 1 - .../src/System/ApplicationModel.Windows.cs | 20 ---- src/coreclr/src/debug/daccess/enummem.cpp | 10 +- src/coreclr/src/debug/ee/dactable.cpp | 4 - src/coreclr/src/dlls/mscorrc/mscorrc.rc | 7 -- src/coreclr/src/dlls/mscorrc/resource.h | 8 -- src/coreclr/src/inc/appxutil.h | 44 ------- src/coreclr/src/inc/dacvars.h | 4 - src/coreclr/src/inc/holder.h | 6 - src/coreclr/src/inc/mscorsvc.idl | 18 --- src/coreclr/src/inc/utilcode.h | 31 ++--- src/coreclr/src/utilcode/CMakeLists.txt | 1 - src/coreclr/src/utilcode/appxutil.cpp | 50 -------- src/coreclr/src/utilcode/registrywrapper.cpp | 76 ------------ src/coreclr/src/utilcode/regutil.cpp | 12 +- src/coreclr/src/vm/.vscode/c_cpp_properties.json | 1 - src/coreclr/src/vm/appdomain.cpp | 5 - src/coreclr/src/vm/appdomain.hpp | 2 - src/coreclr/src/vm/appdomainnative.cpp | 21 ---- src/coreclr/src/vm/appdomainnative.hpp | 4 - src/coreclr/src/vm/ceemain.cpp | 11 +- src/coreclr/src/vm/comcallablewrapper.cpp | 35 +----- src/coreclr/src/vm/comcallablewrapper.h | 2 +- src/coreclr/src/vm/cominterfacemarshaler.cpp | 3 +- src/coreclr/src/vm/domainfile.cpp | 9 -- src/coreclr/src/vm/dwbucketmanager.hpp | 4 - src/coreclr/src/vm/ecalllist.h | 9 -- src/coreclr/src/vm/eeconfig.cpp | 3 - src/coreclr/src/vm/mlinfo.cpp | 59 ---------- src/coreclr/src/vm/multicorejit.cpp | 2 - src/coreclr/src/vm/olevariant.cpp | 15 --- src/coreclr/src/vm/runtimecallablewrapper.cpp | 128 --------------------- src/coreclr/src/vm/runtimecallablewrapper.h | 29 +---- src/coreclr/src/vm/threads.cpp | 4 +- src/coreclr/src/vm/win32threadpool.cpp | 6 +- src/coreclr/src/vm/win32threadpool.h | 1 - src/coreclr/src/zap/svcworker.cpp | 5 - .../src/System/Environment.Win32.cs | 49 -------- .../src/System/WinRTFolderPaths.cs | 104 ----------------- 41 files changed, 29 insertions(+), 777 deletions(-) delete mode 100644 src/coreclr/src/System.Private.CoreLib/src/System/ApplicationModel.Windows.cs delete mode 100644 src/coreclr/src/inc/appxutil.h delete mode 100644 src/coreclr/src/utilcode/appxutil.cpp delete mode 100644 src/coreclr/src/utilcode/registrywrapper.cpp delete mode 100644 src/libraries/System.Private.CoreLib/src/System/WinRTFolderPaths.cs diff --git a/src/coreclr/clr.featuredefines.props b/src/coreclr/clr.featuredefines.props index db5aa41..b5979c8 100644 --- a/src/coreclr/clr.featuredefines.props +++ b/src/coreclr/clr.featuredefines.props @@ -31,7 +31,6 @@ true true true - true true true true @@ -45,7 +44,6 @@ - $(DefineConstants);FEATURE_APPX $(DefineConstants);FEATURE_ARRAYSTUB_AS_IL $(DefineConstants);FEATURE_MULTICASTSTUB_AS_IL $(DefineConstants);FEATURE_INSTANTIATINGSTUB_AS_IL diff --git a/src/coreclr/clrdefinitions.cmake b/src/coreclr/clrdefinitions.cmake index 3557061..7be0a69 100644 --- a/src/coreclr/clrdefinitions.cmake +++ b/src/coreclr/clrdefinitions.cmake @@ -72,7 +72,6 @@ endif(CLR_CMAKE_TARGET_WIN32) # Features - please keep them alphabetically sorted if(CLR_CMAKE_TARGET_WIN32) - add_definitions(-DFEATURE_APPX) if(NOT CLR_CMAKE_TARGET_ARCH_I386) add_definitions(-DFEATURE_ARRAYSTUB_AS_IL) add_definitions(-DFEATURE_MULTICASTSTUB_AS_IL) diff --git a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj index b6b1a88..305ff70 100644 --- a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -324,7 +324,6 @@ Common\Interop\Windows\OleAut32\Interop.VariantClear.cs - diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/ApplicationModel.Windows.cs b/src/coreclr/src/System.Private.CoreLib/src/System/ApplicationModel.Windows.cs deleted file mode 100644 index bf6c1ed..0000000 --- a/src/coreclr/src/System.Private.CoreLib/src/System/ApplicationModel.Windows.cs +++ /dev/null @@ -1,20 +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.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace System -{ - internal static class ApplicationModel - { -#if FEATURE_APPX - // Cache the value in readonly static that can be optimized out by the JIT - internal static readonly bool IsUap = IsAppXProcess() != Interop.BOOL.FALSE; - - [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] - private static extern Interop.BOOL IsAppXProcess(); -#endif - } -} diff --git a/src/coreclr/src/debug/daccess/enummem.cpp b/src/coreclr/src/debug/daccess/enummem.cpp index 5c5f402..c4ee6c3 100644 --- a/src/coreclr/src/debug/daccess/enummem.cpp +++ b/src/coreclr/src/debug/daccess/enummem.cpp @@ -21,10 +21,6 @@ #include "binder.h" #include "win32threadpool.h" -#ifdef FEATURE_APPX -#include "appxutil.h" -#endif // FEATURE_APPX - extern HRESULT GetDacTableAddress(ICorDebugDataTarget* dataTarget, ULONG64 baseAddress, PULONG64 dacTableAddress); #if defined(DAC_MEASURE_PERF) @@ -487,13 +483,9 @@ HRESULT ClrDataAccess::DumpManagedExcepObject(CLRDataEnumMemoryFlags flags, OBJE // dump the exception's stack trace field DumpManagedStackTraceStringObject(flags, exceptRef->GetStackTraceString()); - // dump the exception's remote stack trace field only if we are not generating a triage dump, or - // if we are generating a triage dump of an AppX process, or the exception type does not override + // dump the exception's remote stack trace field only if we are not generating a triage dump, or the exception type does not override // the StackTrace getter (see Exception.InternalPreserveStackTrace to understand why) if (flags != CLRDATA_ENUM_MEM_TRIAGE || -#ifdef FEATURE_APPX - AppX::DacIsAppXProcess() || -#endif // FEATURE_APPX !ExceptionTypeOverridesStackTraceGetter(exceptRef->GetGCSafeMethodTable())) { DumpManagedStackTraceStringObject(flags, exceptRef->GetRemoteStackTraceString()); diff --git a/src/coreclr/src/debug/ee/dactable.cpp b/src/coreclr/src/debug/ee/dactable.cpp index 5313761..9c1273b 100644 --- a/src/coreclr/src/debug/ee/dactable.cpp +++ b/src/coreclr/src/debug/ee/dactable.cpp @@ -35,10 +35,6 @@ extern PCODE g_FCDynamicallyAssignedImplementations; extern DWORD gThreadTLSIndex; extern DWORD gAppDomainTLSIndex; -#ifdef FEATURE_APPX -extern BOOL g_fAppX; -#endif // FEATURE_APPX - DLLEXPORT DacGlobals g_dacTable; diff --git a/src/coreclr/src/dlls/mscorrc/mscorrc.rc b/src/coreclr/src/dlls/mscorrc/mscorrc.rc index e091734..8214d44 100644 --- a/src/coreclr/src/dlls/mscorrc/mscorrc.rc +++ b/src/coreclr/src/dlls/mscorrc/mscorrc.rc @@ -752,13 +752,6 @@ BEGIN STRINGTABLE DISCARDABLE BEGIN - IDS_EE_BADMARSHAL_TYPE_ANSIBSTR "Marshalling as AnsiBStr is not supported" - IDS_EE_BADMARSHAL_TYPE_VBBYVALSTR "Marshalling as VBByRefString is not supported" - IDS_EE_BADMARSHAL_TYPE_REFERENCECUSTOMMARSHALER "Custom marshalers are not supported" - IDS_EE_BADMARSHAL_TYPE_VARIANTASOBJECT "Marshalling between VARIANT and System.Object is not supported" - IDS_EE_BADMARSHAL_TYPE_ASANYA "Marshalling arbitrary types is not supported" - IDS_EE_BADMARSHAL_TYPE_IDISPATCH "Marshalling as IDispatch is not supported" - IDS_EE_ERROR_IDISPATCH "IDispatch and IDispatchEx are not supported" IDS_EE_ERROR_COM "COM is not supported" END diff --git a/src/coreclr/src/dlls/mscorrc/resource.h b/src/coreclr/src/dlls/mscorrc/resource.h index 573b4ee..06e55a5 100644 --- a/src/coreclr/src/dlls/mscorrc/resource.h +++ b/src/coreclr/src/dlls/mscorrc/resource.h @@ -570,14 +570,6 @@ #define IDS_EE_NATIVE_COM_WEAKREF_BAD_TYPE 0x262e #endif // FEATURE_COMINTEROP -#define IDS_EE_BADMARSHAL_TYPE_ANSIBSTR 0x262f -#define IDS_EE_BADMARSHAL_TYPE_VBBYVALSTR 0x2630 -#define IDS_EE_BADMARSHAL_TYPE_REFERENCECUSTOMMARSHALER 0x2631 -#define IDS_EE_BADMARSHAL_TYPE_VARIANTASOBJECT 0x2632 -#define IDS_EE_BADMARSHAL_TYPE_ASANYA 0x2633 -#define IDS_EE_BADMARSHAL_TYPE_IDISPATCH 0x2634 -#define IDS_EE_ERROR_IDISPATCH 0x2635 - #define IDS_HOST_ASSEMBLY_RESOLVER_ASSEMBLY_ALREADY_LOADED_IN_CONTEXT 0x2636 #define IDS_HOST_ASSEMBLY_RESOLVER_DYNAMICALLY_EMITTED_ASSEMBLIES_UNSUPPORTED 0x2637 #define IDS_HOST_ASSEMBLY_RESOLVER_INCOMPATIBLE_BINDING_CONTEXT 0x2638 diff --git a/src/coreclr/src/inc/appxutil.h b/src/coreclr/src/inc/appxutil.h deleted file mode 100644 index 644d3b9..0000000 --- a/src/coreclr/src/inc/appxutil.h +++ /dev/null @@ -1,44 +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. -// - - -#pragma once - -#ifdef FEATURE_APPX - -#include "clrtypes.h" -#include "appmodel.h" - - -//--------------------------------------------------------------------------------------------- -// Forward declarations -BOOL WinRTSupported(); - - -namespace AppX -{ - // Returns true if process is immersive (or if running in mockup environment). - bool IsAppXProcess(); - - // On CoreCLR, the host is in charge of determining whether the process is AppX or not. - void SetIsAppXProcess(bool); - -#ifdef DACCESS_COMPILE - bool DacIsAppXProcess(); -#endif // DACCESS_COMPILE -}; - - -#else // FEATURE_APPX - -namespace AppX -{ - inline bool IsAppXProcess() - { - return false; - } -} - -#endif // FEATURE_APPX diff --git a/src/coreclr/src/inc/dacvars.h b/src/coreclr/src/inc/dacvars.h index 8eb1e57..fa4f2de 100644 --- a/src/coreclr/src/inc/dacvars.h +++ b/src/coreclr/src/inc/dacvars.h @@ -135,10 +135,6 @@ DEFINE_DACVAR(ULONG, DWORD, dac__g_TlsIndex, g_TlsIndex) DEFINE_DACVAR(ULONG, PTR_SString, SString__s_Empty, SString::s_Empty) -#ifdef FEATURE_APPX -DEFINE_DACVAR(ULONG, BOOL, dac__g_fAppX, ::g_fAppX) -#endif // FEATURE_APPX - DEFINE_DACVAR(ULONG, INT32, ArrayBase__s_arrayBoundsZero, ArrayBase::s_arrayBoundsZero) DEFINE_DACVAR(ULONG, BOOL, StackwalkCache__s_Enabled, StackwalkCache::s_Enabled) diff --git a/src/coreclr/src/inc/holder.h b/src/coreclr/src/inc/holder.h index a5781d5..8e4c749 100644 --- a/src/coreclr/src/inc/holder.h +++ b/src/coreclr/src/inc/holder.h @@ -85,12 +85,6 @@ struct AutoExpVisibleValue private: union { - // Only include a class name here if it is customarily referred to through an abstract interface. - -#if defined(FEATURE_APPX) - const class AppXBindResultImpl *_asAppXBindResultImpl; -#endif - const void *_pPreventEmptyUnion; }; }; diff --git a/src/coreclr/src/inc/mscorsvc.idl b/src/coreclr/src/inc/mscorsvc.idl index 6cfff8f..f538ccd 100644 --- a/src/coreclr/src/inc/mscorsvc.idl +++ b/src/coreclr/src/inc/mscorsvc.idl @@ -220,24 +220,6 @@ library mscorsvc } -#ifdef FEATURE_APPX - //***************************************************************************** - // ICorSvcAppX contains AppX-related method - //*****************************************************************************[ - - [ - object, - uuid(5c814791-559e-4f7f-83ce-184a4ccbae24), - pointer_default(unique), - ] - interface ICorSvcAppX : IUnknown - { - HRESULT SetPackage([in] BSTR pPackageFullName); - - HRESULT SetLocalAppDataDirectory([in] BSTR pLocalAppDataDirectory); - } -#endif - //***************************************************************************** // ICorSvcLogger is used to log various messages to the service process //*****************************************************************************[ diff --git a/src/coreclr/src/inc/utilcode.h b/src/coreclr/src/inc/utilcode.h index 15902ef..2dbac82 100644 --- a/src/coreclr/src/inc/utilcode.h +++ b/src/coreclr/src/inc/utilcode.h @@ -4924,28 +4924,15 @@ namespace Com }} -#if defined(FEATURE_APPX) && !defined(DACCESS_COMPILE) - // Forward declaration of AppX::IsAppXProcess - namespace AppX { bool IsAppXProcess(); } - - // LOAD_WITH_ALTERED_SEARCH_PATH is unsupported in AppX processes. - inline DWORD GetLoadWithAlteredSearchPathFlag() - { - WRAPPER_NO_CONTRACT; - return AppX::IsAppXProcess() ? 0 : LOAD_WITH_ALTERED_SEARCH_PATH; - } -#else // FEATURE_APPX && !DACCESS_COMPILE - // LOAD_WITH_ALTERED_SEARCH_PATH can be used unconditionally. - inline DWORD GetLoadWithAlteredSearchPathFlag() - { - LIMITED_METHOD_CONTRACT; - #ifdef LOAD_WITH_ALTERED_SEARCH_PATH - return LOAD_WITH_ALTERED_SEARCH_PATH; - #else - return 0; - #endif - } -#endif // FEATURE_APPX && !DACCESS_COMPILE +inline DWORD GetLoadWithAlteredSearchPathFlag() +{ + LIMITED_METHOD_CONTRACT; + #ifdef LOAD_WITH_ALTERED_SEARCH_PATH + return LOAD_WITH_ALTERED_SEARCH_PATH; + #else + return 0; + #endif +} // clr::SafeAddRef and clr::SafeRelease helpers. namespace clr diff --git a/src/coreclr/src/utilcode/CMakeLists.txt b/src/coreclr/src/utilcode/CMakeLists.txt index aa28b2d..b573971 100644 --- a/src/coreclr/src/utilcode/CMakeLists.txt +++ b/src/coreclr/src/utilcode/CMakeLists.txt @@ -62,7 +62,6 @@ set(UTILCODE_COMMON_SOURCES # of UTILCODE_SOURCES above after fixing compiler errors. if(CLR_CMAKE_TARGET_WIN32) list(APPEND UTILCODE_COMMON_SOURCES - appxutil.cpp dacutil.cpp dlwrap.cpp securitywrapper.cpp diff --git a/src/coreclr/src/utilcode/appxutil.cpp b/src/coreclr/src/utilcode/appxutil.cpp deleted file mode 100644 index 4bb0fea..0000000 --- a/src/coreclr/src/utilcode/appxutil.cpp +++ /dev/null @@ -1,50 +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. -// - - -#include "stdafx.h" - -#include - -#include "utilcode.h" -#include "holder.h" -#include "volatile.h" -#include "clr/fs.h" -#include "clr/str.h" - -#include "appxutil.h" -#include "ex.h" - -#include "shlwapi.h" // Path manipulation APIs - - -GVAL_IMPL(bool, g_fAppX); -INDEBUG(bool g_fIsAppXAsked;) - -namespace AppX -{ -#ifdef DACCESS_COMPILE - bool DacIsAppXProcess() - { - return g_fAppX; - } -#else - - // Returns true if host has deemed the process to be appx - bool IsAppXProcess() - { - INDEBUG(g_fIsAppXAsked = true;) - return g_fAppX; - } - - - void SetIsAppXProcess(bool value) - { - _ASSERTE(!g_fIsAppXAsked); - g_fAppX = value; - } -#endif -}; - diff --git a/src/coreclr/src/utilcode/registrywrapper.cpp b/src/coreclr/src/utilcode/registrywrapper.cpp deleted file mode 100644 index c6169fb..0000000 --- a/src/coreclr/src/utilcode/registrywrapper.cpp +++ /dev/null @@ -1,76 +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. -//***************************************************************************** -// File: registrywrapper.cpp -// - -// -// Wrapper around Win32 Registry Functions allowing redirection of .NET -// Framework root registry location -// -// Notes on Offline Ngen Implementation: -// -// This implementation redirects file accesses to the GAC, NIC, framework directory -// and registry accesses to root store and fusion. -// Essentially, if we open a file or reg key directly from the CLR, we redirect it -// into the mounted VHD specified in the COMPLUS config values. -// -// Terminology: -// Host Machine - The machine running a copy of windows that mounts a VHD to -// compile the assemblies within. This is the build machine in the build lab. -// -// Target Machine - The VHD that gets mounted inside the host. We compile -// native images storing them inside the target. This is the freshly build -// copy of windows in the build lab. -// -// The OS itself pulls open all manner of registry keys and files as side-effects -// of our API calls. Here is a list of things the redirection implementation does -// not cover: -// -// - COM -// We use COM in Ngen to create and communicate with worker processes. In -// order to marshal arguments between ngen and worker, mscoree.tlb is loaded. -// The COM system from the loaded and running OS is used, which means the host -// machine's mscoree.tlb gets loaded for marshalling arguments for the CLR -// running on the target machine. In the next release (4.5) the ngen interfaces -// don't expect to change for existing ngen operations. If new functionality -// is added, new interfaces would be added, but existing ones will not be -// altered since we have a high compat bar with an inplace release. mscoree.tlb -// also contains interfaces for mscoree shim and gchost which again we expect to -// remain compatible in this next product release. In order to fix this, we will -// need support from Windows for using the COM system on another copy of Windows. -// - Registry Accesses under -// - HKLM\software[\Wow6432Node]\policies\microsoft : SQM, Cryptography, MUI, codeidentifiers, appcompat, RPC -// - HKLM\software[\Wow6432Node]\RPC,OLE,COM and under these keys -// - HKLM\Software\Microsoft\Cryptography and under -// - HKLM\Software\Microsoft\SQMClient -// - HKLM\Software[\Wow6432Node]\Microsoft\Windows\Windows Error Reporting\WMR and under -// -// These locations are not accessed directly by the CLR, but looked up by Windows -// as part of other API calls. It is safer that we are accessing these -// on the host machine since they correspond with the actively running copy of -// Windows. If we could somehow redirect these to the target VM, we would have -// Windows 7/2K8 OS looking up its config keys from a Win8 registry. If Windows -// has made incompatible changes here, such as moving the location or redefining -// values, we would break. -// - Accesses from C:\Windows\System32 and C:\Windows\Syswow64 and HKCU -// HKCU does not contain any .NET Framework settings (Microsoft\.NETFramework -// is empty). -// There are various files accessed from C:\Windows\System32 and these are a -// function of the OS loader. We load an executable and it automatically -// pulls in kernel32.dll, for example. This should not be a problem for running -// the CLR, since v4.5 will run on Win2K8, and for offline ngen compilation, we -// will not be using the new Win8 APIs for AppX. We had considered setting -// the PATH to point into the target machine's System32 directory, but the -// Windows team advised us that would break pretty quickly due to Api-sets -// having their version numbers rev'd and the Win2k8 host machine not having -// the ability to load them. -// -// -//***************************************************************************** -#include "stdafx.h" -#include "registrywrapper.h" -#include "clrconfig.h" -#include "strsafe.h" - diff --git a/src/coreclr/src/utilcode/regutil.cpp b/src/coreclr/src/utilcode/regutil.cpp index 10d40dd..65e1513 100644 --- a/src/coreclr/src/utilcode/regutil.cpp +++ b/src/coreclr/src/utilcode/regutil.cpp @@ -623,9 +623,8 @@ void REGUTIL::InitOptionalConfigCache() // Should be OK to proceed. continue; } -#if defined(FEATURE_APPX) && !defined(DACCESS_COMPILE) - else if (l == ERROR_ACCESS_DENIED && AppX::IsAppXProcess()) { - // If we encounter access denied for the current key in AppX, ignore + else if (l == ERROR_ACCESS_DENIED) { + // If we encounter access denied for the current key, ignore // the failure and continue to cache the rest. Effectively this means // we are caching that key as containing no values, which is correct // because in the unlikely event there are values hiding underneath @@ -633,7 +632,6 @@ void REGUTIL::InitOptionalConfigCache() // denied and continue on probing other locations. continue; } -#endif // FEATURE_APPX && !DACCESS_COMPILE else if (l != ERROR_SUCCESS) { // Something else went wrong. To be safe, don't enable the cache. goto failure; @@ -660,12 +658,10 @@ void REGUTIL::InitOptionalConfigCache() // Name is too long. That's OK, we don't cache such names. continue; } -#if defined(FEATURE_APPX) && !defined DACCESS_COMPILE - else if (l == ERROR_ACCESS_DENIED && AppX::IsAppXProcess()) { - // As above, ignore access denied in AppX and continue on trying to cache + else if (l == ERROR_ACCESS_DENIED) { + // As above, ignore access denied and continue on trying to cache continue; } -#endif // FEATURE_APPX && !DACCESS_COMPILE else { // WszRegEnumValue failed OOM, or something else went wrong. // To be safe, don't enable the cache. diff --git a/src/coreclr/src/vm/.vscode/c_cpp_properties.json b/src/coreclr/src/vm/.vscode/c_cpp_properties.json index bdefe5d..86adb9f 100644 --- a/src/coreclr/src/vm/.vscode/c_cpp_properties.json +++ b/src/coreclr/src/vm/.vscode/c_cpp_properties.json @@ -41,7 +41,6 @@ "TARGET_64BIT=1", "DEBUGGING_SUPPORTED", "EnC_SUPPORTED", - "FEATURE_APPX", "FEATURE_ARRAYSTUB_AS_IL", "FEATURE_BASICFREEZE", "FEATURE_CODE_VERSIONING", diff --git a/src/coreclr/src/vm/appdomain.cpp b/src/coreclr/src/vm/appdomain.cpp index bc9a2c4..d8d9d09 100644 --- a/src/coreclr/src/vm/appdomain.cpp +++ b/src/coreclr/src/vm/appdomain.cpp @@ -5944,11 +5944,6 @@ void AppDomain::UnPublishHostedAssembly( } } } - else - { - // In AppX processes, all PEAssemblies that are reach this stage should have host binders. - _ASSERTE(!AppX::IsAppXProcess()); - } } #endif //!DACCESS_COMPILE diff --git a/src/coreclr/src/vm/appdomain.hpp b/src/coreclr/src/vm/appdomain.hpp index 8f62226..95847b1 100644 --- a/src/coreclr/src/vm/appdomain.hpp +++ b/src/coreclr/src/vm/appdomain.hpp @@ -34,8 +34,6 @@ #include "multicorejit.h" #endif -#include "appxutil.h" - #include "tieredcompilation.h" #include "codeversion.h" diff --git a/src/coreclr/src/vm/appdomainnative.cpp b/src/coreclr/src/vm/appdomainnative.cpp index 25e4e8f..cdcaef0 100644 --- a/src/coreclr/src/vm/appdomainnative.cpp +++ b/src/coreclr/src/vm/appdomainnative.cpp @@ -11,9 +11,6 @@ #include "eeconfig.h" #include "appdomain.inl" #include "eventtrace.h" -#if defined(FEATURE_APPX) -#include "appxutil.h" -#endif // FEATURE_APPX #include "../binder/inc/clrprivbindercoreclr.h" #include "clr/fs/path.h" @@ -51,24 +48,6 @@ void QCALLTYPE AppDomainNative::CreateDynamicAssembly(QCall::ObjectHandleOnStack END_QCALL; } -#ifdef FEATURE_APPX -// static -BOOL QCALLTYPE AppDomainNative::IsAppXProcess() -{ - QCALL_CONTRACT; - - BOOL result; - - BEGIN_QCALL; - - result = AppX::IsAppXProcess(); - - END_QCALL; - - return result; -} -#endif // FEATURE_APPX - FCIMPL0(Object*, AppDomainNative::GetLoadedAssemblies) { FCALL_CONTRACT; diff --git a/src/coreclr/src/vm/appdomainnative.hpp b/src/coreclr/src/vm/appdomainnative.hpp index 7a4d3bb..f3afc48 100644 --- a/src/coreclr/src/vm/appdomainnative.hpp +++ b/src/coreclr/src/vm/appdomainnative.hpp @@ -24,10 +24,6 @@ public: static FCDECL0(Object*, GetLoadedAssemblies); static FCDECL1(Object*, GetOrInternString, StringObject* pStringUNSAFE); static FCDECL1(Object*, IsStringInterned, StringObject* pString); - -#ifdef FEATURE_APPX - static INT32 QCALLTYPE IsAppXProcess(); -#endif }; #endif diff --git a/src/coreclr/src/vm/ceemain.cpp b/src/coreclr/src/vm/ceemain.cpp index f169b6b..8375876 100644 --- a/src/coreclr/src/vm/ceemain.cpp +++ b/src/coreclr/src/vm/ceemain.cpp @@ -292,12 +292,6 @@ HRESULT EnsureEEStarted() { BEGIN_ENTRYPOINT_NOTHROW; -#if defined(FEATURE_APPX) && !defined(CROSSGEN_COMPILE) - STARTUP_FLAGS startupFlags = CorHost2::GetStartupFlags(); - // On CoreCLR, the host is in charge of determining whether the process is AppX or not. - AppX::SetIsAppXProcess(!!(startupFlags & STARTUP_APPX_APP_MODEL)); -#endif - #ifndef TARGET_UNIX // The sooner we do this, the sooner we avoid probing registry entries. // (Perf Optimization for VSWhidbey:113373.) @@ -1675,10 +1669,7 @@ void STDMETHODCALLTYPE EEShutDown(BOOL fIsDllUnloading) } #ifdef FEATURE_MULTICOREJIT - if (!AppX::IsAppXProcess()) // When running as Appx, make the delayed timer driven writing be the only option - { - MulticoreJitManager::StopProfileAll(); - } + MulticoreJitManager::StopProfileAll(); #endif } diff --git a/src/coreclr/src/vm/comcallablewrapper.cpp b/src/coreclr/src/vm/comcallablewrapper.cpp index 1f58e24d..775cdb1 100644 --- a/src/coreclr/src/vm/comcallablewrapper.cpp +++ b/src/coreclr/src/vm/comcallablewrapper.cpp @@ -835,7 +835,7 @@ VOID SimpleComCallWrapper::Cleanup() } -VOID SimpleComCallWrapper::Neuter(bool fSkipHandleCleanup) +VOID SimpleComCallWrapper::Neuter() { CONTRACTL { @@ -844,8 +844,6 @@ VOID SimpleComCallWrapper::Neuter(bool fSkipHandleCleanup) MODE_ANY; PRECONDITION(CheckPointer(m_pSyncBlock)); PRECONDITION(!IsNeutered()); - // fSkipHandleCleanup only safe under AppX process because there are no appDomains - PRECONDITION(!(fSkipHandleCleanup && !AppX::IsAppXProcess())); } CONTRACTL_END; @@ -862,14 +860,11 @@ VOID SimpleComCallWrapper::Neuter(bool fSkipHandleCleanup) // NULL the syncblock entry - we can't hang onto this anymore as the syncblock will be killed asynchronously to us. ResetSyncBlock(); - if (!fSkipHandleCleanup) - { - // Disconnect the CCW from the object - // Calls made on this CCW will no longer succeed. - // The CCW has been neutered. - // do this for each of the CCWs - m_pWrap->Neuter(); - } + // Disconnect the CCW from the object + // Calls made on this CCW will no longer succeed. + // The CCW has been neutered. + // do this for each of the CCWs + m_pWrap->Neuter(); StackSString ssMessage; ComCallWrapper *pWrap = m_pWrap; @@ -1392,11 +1387,6 @@ IUnknown* SimpleComCallWrapper::QIStandardInterface(Enum_StdInterfaces index) } else if (index == enum_IDispatchEx) { - if (AppX::IsAppXProcess()) - { - RETURN NULL; - } - if (SupportsIReflect(m_pMT)) { // Initialize the DispatchExInfo before we return the interface. @@ -2944,14 +2934,6 @@ IUnknown* ComCallWrapper::GetComIPFromCCW(ComCallWrapper *pWrap, REFIID riid, Me RETURN pWrap->GetBasicIP(); } - if (IsIErrorInfo(riid) && AppX::IsAppXProcess()) - { - // Don't let the user override the default IErrorInfo implementation in AppX because - // the AppX app model uses it for WER. See code:GetExceptionDescription for details. - SimpleComCallWrapper* pSimpleWrap = pWrap->GetSimpleWrapper(); - RETURN pSimpleWrap->QIStandardInterface(enum_IErrorInfo); - } - if (!(flags & GetComIPFromCCW::SuppressCustomizedQueryInterface) && pTemplate->SupportsICustomQueryInterface()) { @@ -2964,11 +2946,6 @@ IUnknown* ComCallWrapper::GetComIPFromCCW(ComCallWrapper *pWrap, REFIID riid, Me if (IsIDispatch(riid)) { - if (AppX::IsAppXProcess()) - { - RETURN NULL; - } - // We don't do visibility checks on IUnknown. RETURN pWrap->GetIDispatchIP(); } diff --git a/src/coreclr/src/vm/comcallablewrapper.h b/src/coreclr/src/vm/comcallablewrapper.h index 8c5fd42..e4a8161 100644 --- a/src/coreclr/src/vm/comcallablewrapper.h +++ b/src/coreclr/src/vm/comcallablewrapper.h @@ -1260,7 +1260,7 @@ public: VOID Cleanup(); // Used to neuter a CCW if its AD is being unloaded underneath it. - VOID Neuter(bool fSkipHandleCleanup = false); + VOID Neuter(); ~SimpleComCallWrapper(); diff --git a/src/coreclr/src/vm/cominterfacemarshaler.cpp b/src/coreclr/src/vm/cominterfacemarshaler.cpp index d8d57ab..737fe49 100644 --- a/src/coreclr/src/vm/cominterfacemarshaler.cpp +++ b/src/coreclr/src/vm/cominterfacemarshaler.cpp @@ -104,8 +104,7 @@ VOID COMInterfaceMarshaler::InitializeObjectClass(IUnknown *pIncomingIP) } CONTRACTL_END; - // If we are in an APPX process we do not check for IProvideClassInfo. - if (m_typeHandle.IsNull() && !AppX::IsAppXProcess()) + if (m_typeHandle.IsNull()) { EX_TRY { diff --git a/src/coreclr/src/vm/domainfile.cpp b/src/coreclr/src/vm/domainfile.cpp index 33a1f9d..8a5a87f 100644 --- a/src/coreclr/src/vm/domainfile.cpp +++ b/src/coreclr/src/vm/domainfile.cpp @@ -1446,15 +1446,6 @@ void DomainAssembly::Allocate() assemblyHolder.SuppressRelease(); } -#ifdef FEATURE_COMINTEROP - // If we are in an AppX process we should prevent loading of PIA in the AppDomain. - // This will ensure that we do not run into any compatibility issues in case a type has both a co-Class and a Winrt Class - if (AppX::IsAppXProcess() && pAssembly->IsPIA()) - { - COMPlusThrow(kNotSupportedException, W("NotSupported_PIAInAppxProcess")); - } -#endif - SetAssembly(pAssembly); #ifdef FEATURE_PREJIT diff --git a/src/coreclr/src/vm/dwbucketmanager.hpp b/src/coreclr/src/vm/dwbucketmanager.hpp index eb7beac..11a19b3 100644 --- a/src/coreclr/src/vm/dwbucketmanager.hpp +++ b/src/coreclr/src/vm/dwbucketmanager.hpp @@ -88,10 +88,6 @@ DWORD GetCountBucketParamsForEvent(LPCWSTR wzEventName) #include "dbginterface.h" #include -#ifdef FEATURE_APPX -#include "appxutil.h" -#endif - //------------------------------------------------------------------------------ // Description // Converts an array of bytes to a string of base32 encoded characters. diff --git a/src/coreclr/src/vm/ecalllist.h b/src/coreclr/src/vm/ecalllist.h index 19909f9..3188f12 100644 --- a/src/coreclr/src/vm/ecalllist.h +++ b/src/coreclr/src/vm/ecalllist.h @@ -419,12 +419,6 @@ FCFuncStart(gCompatibilitySwitchFuncs) FCFuncElement("GetValueInternalCall", CompatibilitySwitch::GetValue) FCFuncEnd() -#ifdef FEATURE_APPX -FCFuncStart(gApplicationModelFuncs) - QCFuncElement("IsAppXProcess", AppDomainNative::IsAppXProcess) -FCFuncEnd() -#endif - FCFuncStart(gMdUtf8String) QCFuncElement("EqualsCaseInsensitive", MdUtf8String::EqualsCaseInsensitive) QCFuncElement("HashCaseInsensitive", MdUtf8String::HashCaseInsensitive) @@ -1132,9 +1126,6 @@ FCFuncEnd() // Note these have to remain sorted by name:namespace pair (Assert will wack you if you don't) // The sorting is case-sensitive -#ifdef FEATURE_APPX -FCClassElement("ApplicationModel", "System", gApplicationModelFuncs) -#endif FCClassElement("ArgIterator", "System", gVarArgFuncs) FCClassElement("Array", "System", gArrayFuncs) FCClassElement("Assembly", "System.Reflection", gAssemblyFuncs) diff --git a/src/coreclr/src/vm/eeconfig.cpp b/src/coreclr/src/vm/eeconfig.cpp index bb4266f..16ffee7 100644 --- a/src/coreclr/src/vm/eeconfig.cpp +++ b/src/coreclr/src/vm/eeconfig.cpp @@ -11,9 +11,6 @@ #include "common.h" -#ifdef FEATURE_COMINTEROP -#include -#endif #include "eeconfig.h" #include "method.hpp" #include "eventtrace.h" diff --git a/src/coreclr/src/vm/mlinfo.cpp b/src/coreclr/src/vm/mlinfo.cpp index d6cd2d7..227b719 100644 --- a/src/coreclr/src/vm/mlinfo.cpp +++ b/src/coreclr/src/vm/mlinfo.cpp @@ -2435,48 +2435,6 @@ MarshalInfo::MarshalInfo(Module* pModule, } lExit: -#ifdef FEATURE_COMINTEROP -//Field scenario is not blocked here because we don't want to block loading structs that -//have the types which we are blocking, but never pass it to Interop. - - if (AppX::IsAppXProcess() && ms != MarshalInfo::MARSHAL_SCENARIO_FIELD) - { - bool set_error = false; - switch (m_type) - { - case MARSHAL_TYPE_ANSIBSTR: - m_resID = IDS_EE_BADMARSHAL_TYPE_ANSIBSTR; - set_error = true; - break; - case MARSHAL_TYPE_VBBYVALSTR: - case MARSHAL_TYPE_VBBYVALSTRW: - m_resID = IDS_EE_BADMARSHAL_TYPE_VBBYVALSTR; - set_error = true; - break; - case MARSHAL_TYPE_REFERENCECUSTOMMARSHALER: - m_resID = IDS_EE_BADMARSHAL_TYPE_REFERENCECUSTOMMARSHALER; - set_error = true; - break; - case MARSHAL_TYPE_ASANYA: - case MARSHAL_TYPE_ASANYW: - m_resID = IDS_EE_BADMARSHAL_TYPE_ASANYA; - set_error = true; - break; - case MARSHAL_TYPE_INTERFACE: - if (m_fDispItf) - { - m_resID = IDS_EE_BADMARSHAL_TYPE_IDISPATCH; - set_error = true; - } - break; - } - - if (set_error) - COMPlusThrow(kPlatformNotSupportedException, m_resID); - - } -#endif // FEATURE_COMINTEROP - if (m_byref && !isParam) { // byref returns don't work: the thing pointed to lives on @@ -4467,23 +4425,6 @@ void ArrayMarshalInfo::InitElementInfo(CorNativeType arrayNativeType, MarshalInf } } - // Avoid throwing exceptions for any managed structs that have layouts and have types of fields that gets default to those banned types by default - // We don't know if they will be passed to native code anyway, and the right place to make the check is in the marshallers - if (AppX::IsAppXProcess() && ms != MarshalInfo::MARSHAL_SCENARIO_FIELD) - { - bool set_error = false; - UINT m_resID = 0; - switch (m_vtElement) - { - case VT_DISPATCH: - m_resID = IDS_EE_BADMARSHAL_TYPE_IDISPATCH ; - set_error = true; - break; - } - if (set_error) - COMPlusThrow(kPlatformNotSupportedException, m_resID); - } - LExit:; RETURN; diff --git a/src/coreclr/src/vm/multicorejit.cpp b/src/coreclr/src/vm/multicorejit.cpp index def2969..a0fc674 100644 --- a/src/coreclr/src/vm/multicorejit.cpp +++ b/src/coreclr/src/vm/multicorejit.cpp @@ -1359,8 +1359,6 @@ void MulticoreJitManager::StopProfileAll() } CONTRACTL_END; - _ASSERTE(!AppX::IsAppXProcess()); - AppDomainIterator domain(TRUE); while (domain.Next()) diff --git a/src/coreclr/src/vm/olevariant.cpp b/src/coreclr/src/vm/olevariant.cpp index 549e686..d319170 100644 --- a/src/coreclr/src/vm/olevariant.cpp +++ b/src/coreclr/src/vm/olevariant.cpp @@ -2766,11 +2766,6 @@ void OleVariant::MarshalOleVariantForObject(OBJECTREF * const & pObj, VARIANT *p } CONTRACTL_END; - if (AppX::IsAppXProcess()) - { - COMPlusThrow(kPlatformNotSupportedException, IDS_EE_BADMARSHAL_TYPE_VARIANTASOBJECT); - } - SafeVariantClear(pOle); #ifdef _DEBUG @@ -2894,11 +2889,6 @@ void OleVariant::MarshalOleRefVariantForObject(OBJECTREF *pObj, VARIANT *pOle) } CONTRACTL_END; - if (AppX::IsAppXProcess()) - { - COMPlusThrow(kPlatformNotSupportedException, IDS_EE_BADMARSHAL_TYPE_VARIANTASOBJECT); - } - HRESULT hr = MarshalCommonOleRefVariantForObject(pObj, pOle); if (FAILED(hr)) @@ -3117,11 +3107,6 @@ void OleVariant::MarshalObjectForOleVariant(const VARIANT * pOle, OBJECTREF * co } CONTRACT_END; - if (AppX::IsAppXProcess()) - { - COMPlusThrow(kPlatformNotSupportedException, IDS_EE_BADMARSHAL_TYPE_VARIANTASOBJECT); - } - // if V_ISBYREF(pOle) and V_BYREF(pOle) is null then we have a problem, // unless we're dealing with VT_EMPTY or VT_NULL in which case that is ok?? VARTYPE vt = V_VT(pOle) & ~VT_BYREF; diff --git a/src/coreclr/src/vm/runtimecallablewrapper.cpp b/src/coreclr/src/vm/runtimecallablewrapper.cpp index e93250f..cc02857 100644 --- a/src/coreclr/src/vm/runtimecallablewrapper.cpp +++ b/src/coreclr/src/vm/runtimecallablewrapper.cpp @@ -620,129 +620,6 @@ void ComClassFactory::Cleanup() delete this; } -#if defined(FEATURE_APPX) && !defined(CROSSGEN_COMPILE) -//------------------------------------------------------------- -// Create instance using CoCreateIntanceFromApp -// CoCreateInstanceFromApp is a new Windows 8 API that only -// allow creating COM objects (not WinRT objects) in the allow -// list -// Note: We don't QI for IClassFactory2 in this case as it is not -// supported in ModernSDK -IUnknown *AppXComClassFactory::CreateInstanceInternal(IUnknown *pOuter, BOOL *pfDidContainment) -{ - CONTRACT(IUnknown *) - { - THROWS; - GC_TRIGGERS; - MODE_ANY; - PRECONDITION(CheckPointer(pOuter, NULL_OK)); - PRECONDITION(CheckPointer(pfDidContainment, NULL_OK)); - PRECONDITION(AppX::IsAppXProcess()); - POSTCONDITION(CheckPointer(RETVAL)); - } - CONTRACT_END; - - GCX_PREEMP(); - - MULTI_QI multiQI; - ::ZeroMemory(&multiQI, sizeof(MULTI_QI)); - multiQI.pIID = &IID_IUnknown; - - HRESULT hr; - -#ifdef FEATURE_CORESYSTEM - // This works around a bug in the Windows 7 loader that prevents us from loading the - // forwarder for this function - typedef HRESULT (*CoCreateInstanceFromAppFnPtr) (REFCLSID rclsid, IUnknown *punkOuter, DWORD dwClsCtx, - void *reserved, DWORD dwCount, MULTI_QI *pResults); - - static CoCreateInstanceFromAppFnPtr CoCreateInstanceFromApp = NULL; - if (NULL == CoCreateInstanceFromApp) - { - HMODULE hmod = LoadLibraryExW(W("api-ms-win-core-com-l1-1-1.dll"), NULL, 0); - - if (hmod) - CoCreateInstanceFromApp = (CoCreateInstanceFromAppFnPtr)GetProcAddress(hmod, "CoCreateInstanceFromApp"); - } - - if (NULL == CoCreateInstanceFromApp) - { - // This shouldn't happen - _ASSERTE(false); - IfFailThrow(E_FAIL); - } -#endif - - if (m_pwszServer) - { - // - // Remote server activation - // - COSERVERINFO ServerInfo; - ::ZeroMemory(&ServerInfo, sizeof(COSERVERINFO)); - ServerInfo.pwszName = m_pwszServer; - - hr = CoCreateInstanceFromApp( - m_rclsid, - pOuter, - CLSCTX_REMOTE_SERVER, - &ServerInfo, - 1, - &multiQI); - if (FAILED(hr) && pOuter) - { - // - // Aggregation attempt failed. Retry containment - // - hr = CoCreateInstanceFromApp( - m_rclsid, - NULL, - CLSCTX_REMOTE_SERVER, - &ServerInfo, - 1, - &multiQI); - if (pfDidContainment) - *pfDidContainment = TRUE; - } - } - else - { - // - // Normal activation - // - hr = CoCreateInstanceFromApp( - m_rclsid, - pOuter, - CLSCTX_SERVER, - NULL, - 1, - &multiQI); - if (FAILED(hr) && pOuter) - { - // - // Aggregation attempt failed. Retry containment - // - hr = CoCreateInstanceFromApp( - m_rclsid, - NULL, - CLSCTX_SERVER, - NULL, - 1, - &multiQI); - if (pfDidContainment) - *pfDidContainment = TRUE; - } - } - - if (FAILED(hr)) - ThrowHRMsg(hr, IDS_EE_CREATEINSTANCEFROMAPP_FAILED); - if (FAILED(multiQI.hr)) - ThrowHRMsg(multiQI.hr, IDS_EE_CREATEINSTANCEFROMAPP_FAILED); - - RETURN multiQI.pItf; -} -#endif //FEATURE_APPX - //------------------------------------------------------------- // Returns true if the first parameter of the CA's method ctor is a System.Type static BOOL AttributeFirstParamIsSystemType(mdCustomAttribute tkAttribute, IMDInternalImport *pImport) @@ -2472,11 +2349,6 @@ IUnknown *RCW::GetWellKnownInterface(REFIID riid) // make sure it is on the right thread IDispatch *RCW::GetIDispatch() { - if (AppX::IsAppXProcess()) - { - COMPlusThrow(kPlatformNotSupportedException, IDS_EE_ERROR_IDISPATCH); - } - WRAPPER_NO_CONTRACT; return (IDispatch *)GetWellKnownInterface(IID_IDispatch); } diff --git a/src/coreclr/src/vm/runtimecallablewrapper.h b/src/coreclr/src/vm/runtimecallablewrapper.h index 261c0f1..49868e3 100644 --- a/src/coreclr/src/vm/runtimecallablewrapper.h +++ b/src/coreclr/src/vm/runtimecallablewrapper.h @@ -993,28 +993,6 @@ private: }; //-------------------------------------------------------------- -// Special ComClassFactory for AppX scenarios only -// Call CoCreateInstanceFromApp to ensure compatibility -class AppXComClassFactory : public ComClassFactory -{ -protected : - friend ComClassFactoryCreator; - - AppXComClassFactory(REFCLSID rclsid) - :ComClassFactory(rclsid) - { - LIMITED_METHOD_CONTRACT; - } - -protected : -#ifndef CROSSGEN_COMPILE - //------------------------------------------------------------- - // Create instance using CoCreateInstanceFromApp - virtual IUnknown *CreateInstanceInternal(IUnknown *pOuter, BOOL *pfDidContainment); -#endif -}; - -//-------------------------------------------------------------- // Creates the right ComClassFactory for you class ComClassFactoryCreator { @@ -1029,12 +1007,7 @@ public : } CONTRACT_END; -#ifdef FEATURE_APPX - if (AppX::IsAppXProcess()) - RETURN new AppXComClassFactory(rclsid); - else -#endif - RETURN new ComClassFactory(rclsid); + RETURN new ComClassFactory(rclsid); } }; #endif // FEATURE_COMINTEROP_UNMANAGED_ACTIVATION diff --git a/src/coreclr/src/vm/threads.cpp b/src/coreclr/src/vm/threads.cpp index b3103e6..bdc1734 100644 --- a/src/coreclr/src/vm/threads.cpp +++ b/src/coreclr/src/vm/threads.cpp @@ -4732,9 +4732,9 @@ BOOL Thread::PrepareApartmentAndContext() #endif //FEATURE_COMINTEROP_APARTMENT_SUPPORT #ifdef FEATURE_COMINTEROP - // Our IInitializeSpy will be registered in AppX always, in classic processes + // Our IInitializeSpy will be registered in classic processes // only if the internal config switch is on. - if (AppX::IsAppXProcess() || g_pConfig->EnableRCWCleanupOnSTAShutdown()) + if (g_pConfig->EnableRCWCleanupOnSTAShutdown()) { NewHolder pSpyImpl = new ApartmentSpyImpl(); diff --git a/src/coreclr/src/vm/win32threadpool.cpp b/src/coreclr/src/vm/win32threadpool.cpp index 6afe8ba..bd9f7e0 100644 --- a/src/coreclr/src/vm/win32threadpool.cpp +++ b/src/coreclr/src/vm/win32threadpool.cpp @@ -2008,7 +2008,7 @@ Retire: while (true) { RetryRetire: - if (RetiredWorkerSemaphore->Wait(AppX::IsAppXProcess() ? WorkerTimeoutAppX : WorkerTimeout)) + if (RetiredWorkerSemaphore->Wait(WorkerTimeout)) { foundWork = true; @@ -2085,7 +2085,7 @@ WaitForWork: FireEtwThreadPoolWorkerThreadWait(counts.NumActive, counts.NumRetired, GetClrInstanceId()); RetryWaitForWork: - if (WorkerSemaphore->Wait(AppX::IsAppXProcess() ? WorkerTimeoutAppX : WorkerTimeout, WorkerThreadSpinLimit, NumberOfProcessors)) + if (WorkerSemaphore->Wait(WorkerTimeout, WorkerThreadSpinLimit, NumberOfProcessors)) { foundWork = true; goto Work; @@ -3221,7 +3221,7 @@ DWORD WINAPI ThreadpoolMgr::CompletionPortThreadStart(LPVOID lpArgs) PIOCompletionContext context; BOOL fIsCompletionContext; - const DWORD CP_THREAD_WAIT = AppX::IsAppXProcess() ? 5000 : 15000; /* milliseconds */ + const DWORD CP_THREAD_WAIT = 15000; /* milliseconds */ _ASSERTE(GlobalCompletionPort != NULL); diff --git a/src/coreclr/src/vm/win32threadpool.h b/src/coreclr/src/vm/win32threadpool.h index 36ae2d3..a2a930f 100644 --- a/src/coreclr/src/vm/win32threadpool.h +++ b/src/coreclr/src/vm/win32threadpool.h @@ -1042,7 +1042,6 @@ public: private: static const DWORD WorkerTimeout = 20 * 1000; - static const DWORD WorkerTimeoutAppX = 5 * 1000; // shorter timeout to allow threads to exit prior to app suspension DECLSPEC_ALIGN(MAX_CACHE_LINE_SIZE) SVAL_DECL(ThreadCounter,WorkerCounter); diff --git a/src/coreclr/src/zap/svcworker.cpp b/src/coreclr/src/zap/svcworker.cpp index 079fa3f..baf0410 100644 --- a/src/coreclr/src/zap/svcworker.cpp +++ b/src/coreclr/src/zap/svcworker.cpp @@ -25,11 +25,6 @@ NGenWorkerEmbedding() -- called when COM invoked the COM server with #include "common.h" - -#ifdef FEATURE_APPX -#include "AppXUtil.h" -#endif - ILocalServerLifetime *g_pLocalServerLifetime = NULL; SvcLogger::SvcLogger() diff --git a/src/libraries/System.Private.CoreLib/src/System/Environment.Win32.cs b/src/libraries/System.Private.CoreLib/src/System/Environment.Win32.cs index 6859255..4edb647 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Environment.Win32.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Environment.Win32.cs @@ -20,11 +20,6 @@ namespace System { Debug.Assert(variable != null); -#if FEATURE_APPX - if (ApplicationModel.IsUap) - return null; // Systems without the Windows registry pretend that it's always empty. -#endif - using (RegistryKey? environmentKey = OpenEnvironmentKeyIfExists(fromMachine, writable: false)) { return environmentKey?.GetValue(variable) as string; @@ -35,11 +30,6 @@ namespace System { Debug.Assert(variable != null); -#if FEATURE_APPX - if (ApplicationModel.IsUap) - return; // Systems without the Windows registry pretend that it's always empty. -#endif - const int MaxUserEnvVariableLength = 255; // User-wide env vars stored in the registry have names limited to 255 chars if (!fromMachine && variable.Length >= MaxUserEnvVariableLength) { @@ -75,10 +65,6 @@ namespace System private static IDictionary GetEnvironmentVariablesFromRegistry(bool fromMachine) { var results = new Hashtable(); -#if FEATURE_APPX - if (ApplicationModel.IsUap) // Systems without the Windows registry pretend that it's always empty. - return results; -#endif using (RegistryKey? environmentKey = OpenEnvironmentKeyIfExists(fromMachine, writable: false)) { @@ -125,11 +111,6 @@ namespace System { get { -#if FEATURE_APPX - if (ApplicationModel.IsUap) - return "Windows User"; -#endif - // 40 should be enough as we're asking for the SAM compatible name (DOMAIN\User). // The max length should be 15 (domain) + 1 (separator) + 20 (name) + null. If for // some reason it isn't, we'll grow the buffer. @@ -177,11 +158,6 @@ namespace System { get { -#if FEATURE_APPX - if (ApplicationModel.IsUap) - return "Windows Domain"; -#endif - // See the comment in UserName var builder = new ValueStringBuilder(stackalloc char[40]); GetUserName(ref builder); @@ -230,11 +206,6 @@ namespace System private static string GetFolderPathCore(SpecialFolder folder, SpecialFolderOption option) { -#if FEATURE_APPX - if (ApplicationModel.IsUap) - return WinRTFolderPaths.GetFolderPath(folder, option); -#endif - // We're using SHGetKnownFolderPath instead of SHGetFolderPath as SHGetFolderPath is // capped at MAX_PATH. // @@ -408,26 +379,6 @@ namespace System return path; } -#if FEATURE_APPX - private static class WinRTFolderPaths - { - private static Func? s_winRTFolderPathsGetFolderPath; - - public static string GetFolderPath(SpecialFolder folder, SpecialFolderOption option) - { - if (s_winRTFolderPathsGetFolderPath == null) - { - Type? winRtFolderPathsType = Type.GetType("System.WinRTFolderPaths, System.Runtime.WindowsRuntime, Version=4.0.14.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", throwOnError: false); - MethodInfo? getFolderPathsMethod = winRtFolderPathsType?.GetMethod("GetFolderPath", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static, null, new Type[] { typeof(SpecialFolder), typeof(SpecialFolderOption) }, null); - var d = (Func?)getFolderPathsMethod?.CreateDelegate(typeof(Func)); - s_winRTFolderPathsGetFolderPath = d ?? delegate { return string.Empty; }; - } - - return s_winRTFolderPathsGetFolderPath(folder, option); - } - } -#endif - // Seperate type so a .cctor is not created for Enviroment which then would be triggered during startup private static class WindowsVersion { diff --git a/src/libraries/System.Private.CoreLib/src/System/WinRTFolderPaths.cs b/src/libraries/System.Private.CoreLib/src/System/WinRTFolderPaths.cs deleted file mode 100644 index f773ebd..0000000 --- a/src/libraries/System.Private.CoreLib/src/System/WinRTFolderPaths.cs +++ /dev/null @@ -1,104 +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 Windows.Foundation.Metadata; -using Windows.Storage; -using System.IO; -using static System.Environment; - -namespace System -{ - internal static class WinRTFolderPaths - { - public static string GetFolderPath(SpecialFolder folder, SpecialFolderOption option) - { - // For testing we'll fall back if the needed APIs aren't present. - // - // We're not honoring the special folder options (noverify/create) for a few reasons. One, most of the - // folders always exist (e.g. it is moot). Two, most locations are inaccessible from an appcontainer - // currently - making it impossible to answer the question of existence or create if necessary. Thirdly, - // the Win32 API would create these folders with very specific ACLs, which even in the cases we can create - // are a significant compat risk (trying to replicate internal Windows behavior- it is documented that they - // set specific ACLs, but not which ones). - if (ApiInformation.IsTypePresent("Windows.Storage.UserDataPaths")) - { - return GetFolderPathCoreCurrent(folder); - } - else - { - return GetFolderPathCoreFallBack(folder); - } - } - - private static string GetFolderPathCoreCurrent(SpecialFolder folder) => - // While all of these give back real paths, most of them are not accessible - // from an appcontainer currently (they will give access denied) - folder switch - { - SpecialFolder.ApplicationData => UserDataPaths.GetDefault().RoamingAppData, - SpecialFolder.CommonApplicationData => AppDataPaths.GetDefault().ProgramData, - SpecialFolder.LocalApplicationData => AppDataPaths.GetDefault().LocalAppData, - SpecialFolder.Cookies => AppDataPaths.GetDefault().Cookies, - SpecialFolder.Desktop => AppDataPaths.GetDefault().Desktop, - SpecialFolder.Favorites => AppDataPaths.GetDefault().Favorites, - SpecialFolder.History => AppDataPaths.GetDefault().History, - SpecialFolder.InternetCache => AppDataPaths.GetDefault().InternetCache, - SpecialFolder.MyMusic => UserDataPaths.GetDefault().Music, - SpecialFolder.MyPictures => UserDataPaths.GetDefault().Pictures, - SpecialFolder.MyVideos => UserDataPaths.GetDefault().Videos, - SpecialFolder.Recent => UserDataPaths.GetDefault().Recent, - SpecialFolder.System => SystemDataPaths.GetDefault().System, - SpecialFolder.Templates => UserDataPaths.GetDefault().Templates, - SpecialFolder.DesktopDirectory => UserDataPaths.GetDefault().Desktop, - SpecialFolder.Personal => UserDataPaths.GetDefault().Documents, - SpecialFolder.CommonDocuments => SystemDataPaths.GetDefault().PublicDocuments, - SpecialFolder.CommonMusic => SystemDataPaths.GetDefault().PublicMusic, - SpecialFolder.CommonPictures => SystemDataPaths.GetDefault().PublicPictures, - SpecialFolder.CommonDesktopDirectory => SystemDataPaths.GetDefault().PublicDesktop, - SpecialFolder.CommonVideos => SystemDataPaths.GetDefault().PublicVideos, - SpecialFolder.UserProfile => UserDataPaths.GetDefault().Profile, - SpecialFolder.SystemX86 => SystemDataPaths.GetDefault().SystemX86, - SpecialFolder.Windows => SystemDataPaths.GetDefault().Windows, - - // The following aren't available on WinRT. Our default behavior - // is string.Empty for paths that aren't available: - // SpecialFolder.Programs - // SpecialFolder.MyComputer - // SpecialFolder.SendTo - // SpecialFolder.StartMenu - // SpecialFolder.Startup - // SpecialFolder.ProgramFiles - // SpecialFolder.CommonProgramFiles - // SpecialFolder.AdminTools - // SpecialFolder.CDBurning - // SpecialFolder.CommonAdminTools - // SpecialFolder.CommonOemLinks - // SpecialFolder.CommonStartMenu - // SpecialFolder.CommonPrograms - // SpecialFolder.CommonStartup - // SpecialFolder.CommonTemplates - // SpecialFolder.Fonts - // SpecialFolder.NetworkShortcuts - // SpecialFolder.PrinterShortcuts - // SpecialFolder.CommonProgramFilesX86 - // SpecialFolder.ProgramFilesX86 - // SpecialFolder.Resources - // SpecialFolder.LocalizedResources - - _ => string.Empty, - }; - - private static string GetFolderPathCoreFallBack(SpecialFolder folder) => - // For testing without the new WinRT APIs. We cannot use Win32 APIs for - // special folders as they are not in the WACK. - folder switch - { - SpecialFolder.ApplicationData => ApplicationData.Current.RoamingFolder?.Path ?? string.Empty, - SpecialFolder.LocalApplicationData => ApplicationData.Current.LocalFolder?.Path ?? string.Empty, - SpecialFolder.System => SystemDirectory, - SpecialFolder.Windows => Path.GetDirectoryName(SystemDirectory)!, - _ => string.Empty, - }; - } -} -- 2.7.4