From 9838730d77e8491d837beb0d441fe9b079c02e82 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Mon, 29 Mar 2021 15:42:40 -0700 Subject: [PATCH 1/4] Merge REGUTIL logic for environment variables into CLRConfig Remove REGUTIL Remove unused CLR configuration options --- src/coreclr/inc/clrconfig.h | 76 +-- src/coreclr/inc/clrconfigvalues.h | 367 ++++++------ src/coreclr/inc/utilcode.h | 132 +---- src/coreclr/md/debug_metadata.h | 2 +- src/coreclr/utilcode/CMakeLists.txt | 1 - src/coreclr/utilcode/clrconfig.cpp | 503 ++++++++++++---- src/coreclr/utilcode/regutil.cpp | 759 ------------------------- src/coreclr/vm/ceemain.cpp | 6 +- src/coreclr/vm/comcallablewrapper.cpp | 5 - src/coreclr/vm/compatibilityswitch.cpp | 2 +- src/coreclr/vm/gcenv.ee.cpp | 6 +- src/coreclr/vm/jithost.cpp | 4 +- 12 files changed, 596 insertions(+), 1267 deletions(-) delete mode 100644 src/coreclr/utilcode/regutil.cpp diff --git a/src/coreclr/inc/clrconfig.h b/src/coreclr/inc/clrconfig.h index 715a5ada9f243..842313df2408e 100644 --- a/src/coreclr/inc/clrconfig.h +++ b/src/coreclr/inc/clrconfig.h @@ -6,13 +6,8 @@ // // -// Unified method of accessing configuration values from environment variables, registry and config file(s). -// This class replaces all GetConfigDWORD and GetConfigString methods in EEConfig and REGUTIL. To define a -// flag, add an entry in the table in file:CLRConfigValues.h. -// -// -// -// +// Unified method of accessing configuration values. +// To define a flag, add an entry in the table in file:CLRConfigValues.h. // -------------------------------------------------------------------------------------------------- @@ -25,28 +20,18 @@ class CLRConfig { public: - // - // Types - // + // Setting each option results in some change to the config value. + enum class LookupOptions + { + // Default options. + Default = 0, - // Setting each option results in some change to the config value lookup method. Default behavior is (in - // the following order): - // * Look at environment variables (prepending COMPlus to the name) - // * Look at the framework registry keys (HKCU\Software\Microsoft\.NETFramework then - // HKLM\Software\Microsoft\.NETFramework) - // * Look at the available config files (system, application, host and user). For details see TODO: - // Link to BOTR documentation - enum LookupOptions { - // If set, don't look in environment variables. - IgnoreEnv = 0x1, // If set, do not prepend "COMPlus_" when doing environment variable lookup. - DontPrependCOMPlus_ = 0x2, + DontPrependCOMPlus_ = 0x1, + // Remove any whitespace at beginning and end of value. (Only applicable for // *string* configuration values.) - TrimWhiteSpaceFromStringValue = 0x100, - - // Legacy EEConfig-style lookup. - EEConfig_default = 0, + TrimWhiteSpaceFromStringValue = 0x2, }; // Struct used to store information about where/how to find a Config DWORD. @@ -100,6 +85,7 @@ class CLRConfig #define CONFIG_STRING_INFO(symbol, name, description) #define CONFIG_STRING_INFO_EX(symbol, name, description, lookupOptions) #endif // _DEBUG + // Now that we have defined what what the macros in file:CLRConfigValues.h mean, include it to generate the code. #include "clrconfigvalues.h" @@ -144,39 +130,10 @@ class CLRConfig static BOOL IsConfigOptionSpecified(LPCWSTR name); // Free a string returned by GetConfigValue - static void FreeConfigString(__in __in_z LPWSTR name); - -private: - - // Helper method to translate LookupOptions to REGUTIL::CORConfigLevel - static REGUTIL::CORConfigLevel GetConfigLevel(LookupOptions options); + static void FreeConfigString(__in __in_z LPWSTR name); - // - // Helper methods. - // - - // Helper method to check if a certain option is set in a ConfigDWORDInfo struct. - static inline BOOL CheckLookupOption(const ConfigDWORDInfo & info, LookupOptions option) - { - LIMITED_METHOD_CONTRACT; - return ((info.options & option) == option) ? TRUE : FALSE; - } - - // Helper method to check if a certain option is set in a ConfigStringInfo struct. - static inline BOOL CheckLookupOption(const ConfigStringInfo & info, LookupOptions option) - { - LIMITED_METHOD_CONTRACT; - return ((info.options & option) == option) ? TRUE : FALSE; - } - - // Helper method to check if a certain option is set in an options enum. - static inline BOOL CheckLookupOption(LookupOptions infoOptions, LookupOptions optionToCheck) - { - LIMITED_METHOD_CONTRACT; - return ((infoOptions & optionToCheck) == optionToCheck) ? TRUE : FALSE; - } - - static HRESULT TrimWhiteSpace(LPCWSTR wszOrig, __deref_out_z LPWSTR * pwszTrimmed); + // Populate the caches with current state to improve lookup times. + static void InitCache(); }; inline CLRConfig::LookupOptions operator|(CLRConfig::LookupOptions lhs, CLRConfig::LookupOptions rhs) @@ -184,6 +141,11 @@ inline CLRConfig::LookupOptions operator|(CLRConfig::LookupOptions lhs, CLRConfi return static_cast(static_cast(lhs) | static_cast(rhs)); } +inline CLRConfig::LookupOptions operator&(CLRConfig::LookupOptions lhs, CLRConfig::LookupOptions rhs) +{ + return static_cast(static_cast(lhs) & static_cast(rhs)); +} + typedef Wrapper CLRConfigStringHolder; #endif //__CLRConfig_h__ diff --git a/src/coreclr/inc/clrconfigvalues.h b/src/coreclr/inc/clrconfigvalues.h index a3acc7ed03a12..46db05a29358b 100644 --- a/src/coreclr/inc/clrconfigvalues.h +++ b/src/coreclr/inc/clrconfigvalues.h @@ -43,7 +43,7 @@ // CONFIG_DWORD_INFO(symbol, name, defaultValue, description) // -------------------------------------------------------------------------- // Use this macro to define a basic DWORD value. CLRConfig will look in environment variables (adding -// COMPlus_ to the name), the registry (HKLM and HKCU), and all the config files for this value. To customize +// COMPlus_ to the name) for this value. To customize // where CLRConfig looks, use the extended version of the macro below. IMPORTANT: please follow the // code:#NamingConventions for the symbol and the name! // @@ -56,7 +56,7 @@ // of options and their descriptions, see code:CLRConfig.LookupOptions // // Example: CONFIG_DWORD_INFO_EX(INTERNAL_EnableInternetHREFexes, W("EnableInternetHREFexes"), 0, "", -// (CLRConfig::LookupOptions) (CLRConfig::IgnoreEnv | CLRConfig::IgnoreHKCU)) +// (CLRConfig::LookupOptions) (CLRConfig::LookupOptions::DontPrependCOMPlus_)) // // #Strings: // -------------------------------------------------------------------------- @@ -112,11 +112,6 @@ /// /// AppDomain /// -CONFIG_DWORD_INFO(INTERNAL_ADDumpSB, W("ADDumpSB"), 0, "Not used") -CONFIG_DWORD_INFO(INTERNAL_ADForceSB, W("ADForceSB"), 0, "Forces sync block creation for all objects") -CONFIG_DWORD_INFO(INTERNAL_ADLogMemory, W("ADLogMemory"), 0, "Superseded by test hooks") -CONFIG_DWORD_INFO(INTERNAL_ADTakeDHSnapShot, W("ADTakeDHSnapShot"), 0, "Superseded by test hooks") -CONFIG_DWORD_INFO(INTERNAL_ADTakeSnapShot, W("ADTakeSnapShot"), 0, "Superseded by test hooks") CONFIG_DWORD_INFO(INTERNAL_EnableFullDebug, W("EnableFullDebug"), 0, "Heavy-weight checking for AD boundary violations (AD leaks)") /// @@ -133,103 +128,102 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_JitPitchMaxVal, W("JitPitchMaxVal"), (DWORD)0x /// /// Assembly Loader /// -CONFIG_DWORD_INFO_EX(INTERNAL_GetAssemblyIfLoadedIgnoreRidMap, W("GetAssemblyIfLoadedIgnoreRidMap"), 0, "Used to force loader to ignore assemblies cached in the rid-map", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_GetAssemblyIfLoadedIgnoreRidMap, W("GetAssemblyIfLoadedIgnoreRidMap"), 0, "Used to force loader to ignore assemblies cached in the rid-map") /// /// Conditional breakpoints /// -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_BreakOnBadExit, W("BreakOnBadExit"), 0, "", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_BreakOnBadExit, W("BreakOnBadExit"), 0, "") CONFIG_STRING_INFO(INTERNAL_BreakOnClassBuild, W("BreakOnClassBuild"), "Very useful for debugging class layout code.") CONFIG_STRING_INFO(INTERNAL_BreakOnClassLoad, W("BreakOnClassLoad"), "Very useful for debugging class loading code.") CONFIG_STRING_INFO(INTERNAL_BreakOnComToClrNativeInfoInit, W("BreakOnComToClrNativeInfoInit"), "Throws an assert when native information about a COM -> CLR call are about to be gathered.") -CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnDebugBreak, W("BreakOnDebugBreak"), 0, "Allows an assert in debug builds when a user break is hit", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnDILoad, W("BreakOnDILoad"), 0, "Allows an assert when the DI is loaded", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnDumpToken, W("BreakOnDumpToken"), 0xffffffff, "Breaks when using internal logging on a particular token value.", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_BreakOnEELoad, W("BreakOnEELoad"), 0, "", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_BreakOnDebugBreak, W("BreakOnDebugBreak"), 0, "Allows an assert in debug builds when a user break is hit") +CONFIG_DWORD_INFO(INTERNAL_BreakOnDILoad, W("BreakOnDILoad"), 0, "Allows an assert when the DI is loaded") +CONFIG_DWORD_INFO(INTERNAL_BreakOnDumpToken, W("BreakOnDumpToken"), 0xffffffff, "Breaks when using internal logging on a particular token value.") +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_BreakOnEELoad, W("BreakOnEELoad"), 0, "") CONFIG_DWORD_INFO(INTERNAL_BreakOnEEShutdown, W("BreakOnEEShutdown"), 0, "") -CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnExceptionInGetThrowable, W("BreakOnExceptionInGetThrowable"), 0, "", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_BreakOnExceptionInGetThrowable, W("BreakOnExceptionInGetThrowable"), 0, "") CONFIG_DWORD_INFO(INTERNAL_BreakOnFindMethod, W("BreakOnFindMethod"), 0, "Breaks in findMethodInternal when it searches for the specified token.") -CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnFirstPass, W("BreakOnFirstPass"), 0, "", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnHR, W("BreakOnHR"), 0, "Debug.cpp, IfFailxxx use this macro to stop if hr matches ", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_BreakOnFirstPass, W("BreakOnFirstPass"), 0, "") +CONFIG_DWORD_INFO(INTERNAL_BreakOnHR, W("BreakOnHR"), 0, "Debug.cpp, IfFailxxx use this macro to stop if hr matches ") CONFIG_STRING_INFO(INTERNAL_BreakOnInstantiation, W("BreakOnInstantiation"), "Very useful for debugging generic class instantiation.") CONFIG_STRING_INFO(INTERNAL_BreakOnInteropStubSetup, W("BreakOnInteropStubSetup"), "Throws an assert when marshaling stub for the given method is about to be built.") -CONFIG_STRING_INFO_EX(INTERNAL_BreakOnInteropVTableBuild, W("BreakOnInteropVTableBuild"), "Specifies a type name for which an assert should be thrown when building interop v-table.", CLRConfig::EEConfig_default) +CONFIG_STRING_INFO(INTERNAL_BreakOnInteropVTableBuild, W("BreakOnInteropVTableBuild"), "Specifies a type name for which an assert should be thrown when building interop v-table.") CONFIG_STRING_INFO(INTERNAL_BreakOnMethodName, W("BreakOnMethodName"), "Very useful for debugging method override placement code.") -CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnNotify, W("BreakOnNotify"), 0, "", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnRetailAssert, W("BreakOnRetailAssert"), 0, "Used for debugging \"retail\" asserts (fatal errors)", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnSecondPass, W("BreakOnSecondPass"), 0, "", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_BreakOnSO, W("BreakOnSO"), 0, "", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_BreakOnNotify, W("BreakOnNotify"), 0, "") +RETAIL_CONFIG_DWORD_INFO(INTERNAL_BreakOnRetailAssert, W("BreakOnRetailAssert"), 0, "Used for debugging \"retail\" asserts (fatal errors)") +CONFIG_DWORD_INFO(INTERNAL_BreakOnSecondPass, W("BreakOnSecondPass"), 0, "") +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_BreakOnSO, W("BreakOnSO"), 0, "") CONFIG_STRING_INFO(INTERNAL_BreakOnStructMarshalSetup, W("BreakOnStructMarshalSetup"), "Throws an assert when field marshalers for the given type with layout are about to be created.") -CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnUEF, W("BreakOnUEF"), 0, "", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_BreakOnUncaughtException, W("BreakOnUncaughtException"), 0, "", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_BreakOnUEF, W("BreakOnUEF"), 0, "") +CONFIG_DWORD_INFO(INTERNAL_BreakOnUncaughtException, W("BreakOnUncaughtException"), 0, "") /// - /// Debugger /// -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_EnableDiagnostics, W("EnableDiagnostics"), 1, "Allows the debugger, profiler, and EventPipe diagnostics to be disabled", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_D__FCE, W("D::FCE"), 0, "Allows an assert when crawling the managed stack for an exception handler", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakIfLocksUnavailable, W("DbgBreakIfLocksUnavailable"), 0, "Allows an assert when the debugger can't take a lock ", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnErr, W("DbgBreakOnErr"), 0, "Allows an assert when we get a failing hresult", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnMapPatchToDJI, W("DbgBreakOnMapPatchToDJI"), 0, "Allows an assert when mapping a patch to an address", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnRawInt3, W("DbgBreakOnRawInt3"), 0, "Allows an assert for test coverage for debug break or other int3 breaks", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnSendBreakpoint, W("DbgBreakOnSendBreakpoint"), 0, "Allows an assert when sending a breakpoint to the right side", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgBreakOnSetIP, W("DbgBreakOnSetIP"), 0, "Allows an assert when setting the IP", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgCheckInt3, W("DbgCheckInt3"), 0, "Asserts if the debugger explicitly writes int3 instead of calling SetUnmanagedBreakpoint", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableDiagnostics, W("EnableDiagnostics"), 1, "Allows the debugger, profiler, and EventPipe diagnostics to be disabled") +CONFIG_DWORD_INFO(INTERNAL_D__FCE, W("D::FCE"), 0, "Allows an assert when crawling the managed stack for an exception handler") +CONFIG_DWORD_INFO(INTERNAL_DbgBreakIfLocksUnavailable, W("DbgBreakIfLocksUnavailable"), 0, "Allows an assert when the debugger can't take a lock ") +CONFIG_DWORD_INFO(INTERNAL_DbgBreakOnErr, W("DbgBreakOnErr"), 0, "Allows an assert when we get a failing hresult") +CONFIG_DWORD_INFO(INTERNAL_DbgBreakOnMapPatchToDJI, W("DbgBreakOnMapPatchToDJI"), 0, "Allows an assert when mapping a patch to an address") +CONFIG_DWORD_INFO(INTERNAL_DbgBreakOnRawInt3, W("DbgBreakOnRawInt3"), 0, "Allows an assert for test coverage for debug break or other int3 breaks") +CONFIG_DWORD_INFO(INTERNAL_DbgBreakOnSendBreakpoint, W("DbgBreakOnSendBreakpoint"), 0, "Allows an assert when sending a breakpoint to the right side") +CONFIG_DWORD_INFO(INTERNAL_DbgBreakOnSetIP, W("DbgBreakOnSetIP"), 0, "Allows an assert when setting the IP") +CONFIG_DWORD_INFO(INTERNAL_DbgCheckInt3, W("DbgCheckInt3"), 0, "Asserts if the debugger explicitly writes int3 instead of calling SetUnmanagedBreakpoint") RETAIL_CONFIG_DWORD_INFO(INTERNAL_DbgForcePDBSymbols, W("DbgForcePDBSymbols"), 0, "") CONFIG_DWORD_INFO(INTERNAL_DbgDACAssertOnMismatch, W("DbgDACAssertOnMismatch"), 0, "Allows an assert when the mscordacwks and mscorwks dll versions don't match") -CONFIG_DWORD_INFO_EX(INTERNAL_DbgDACEnableAssert, W("DbgDACEnableAssert"), 0, "Enables extra validity checking in DAC - assumes target isn't corrupt", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_DbgDACSkipVerifyDlls, W("DbgDACSkipVerifyDlls"), 0, "Allows disabling the check to ensure mscordacwks and mscorwks dll versions match", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgDelayHelper, W("DbgDelayHelper"), 0, "Varies the wait in the helper thread startup for testing race between threads", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_DbgDisableDynamicSymsCompat, W("DbgDisableDynamicSymsCompat"), 0, "", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgDisableTargetConsistencyAsserts, W("DbgDisableTargetConsistencyAsserts"), 0, "Allows explicitly testing with corrupt targets", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_DbgEnableMixedModeDebugging, W("DbgEnableMixedModeDebuggingInternalOnly"), 0, "", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgExtraThreads, W("DbgExtraThreads"), 0, "Allows extra unmanaged threads to run and throw debug events for stress testing", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgExtraThreadsCantStop, W("DbgExtraThreadsCantStop"), 0, "Allows extra unmanaged threads in can't stop region to run and throw debug events for stress testing", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgExtraThreadsIB, W("DbgExtraThreadsIB"), 0, "Allows extra in-band unmanaged threads to run and throw debug events for stress testing", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgExtraThreadsOOB, W("DbgExtraThreadsOOB"), 0, "Allows extra out of band unmanaged threads to run and throw debug events for stress testing", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgFaultInHandleIPCEvent, W("DbgFaultInHandleIPCEvent"), 0, "Allows testing the unhandled event filter", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgInjectFEE, W("DbgInjectFEE"), 0, "Allows injecting a fatal execution error for testing Watson", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgLeakCheck, W("DbgLeakCheck"), 0, "Allows checking for leaked Cordb objects", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgNo2ndChance, W("DbgNo2ndChance"), 0, "Allows breaking on (and catching bogus) 2nd chance exceptions", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgNoDebugger, W("DbgNoDebugger"), 0, "Allows breaking if we don't want to lazily initialize the debugger", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DbgNoForceContinue, W("DbgNoForceContinue"), 1, "Used to force a continue on longhorn", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgNoOpenMDByFile, W("DbgNoOpenMDByFile"), 0, "Allows opening MD by memory for perf testing", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_DbgDACEnableAssert, W("DbgDACEnableAssert"), 0, "Enables extra validity checking in DAC - assumes target isn't corrupt") +RETAIL_CONFIG_DWORD_INFO(INTERNAL_DbgDACSkipVerifyDlls, W("DbgDACSkipVerifyDlls"), 0, "Allows disabling the check to ensure mscordacwks and mscorwks dll versions match") +CONFIG_DWORD_INFO(INTERNAL_DbgDelayHelper, W("DbgDelayHelper"), 0, "Varies the wait in the helper thread startup for testing race between threads") +RETAIL_CONFIG_DWORD_INFO(INTERNAL_DbgDisableDynamicSymsCompat, W("DbgDisableDynamicSymsCompat"), 0, "") +CONFIG_DWORD_INFO(INTERNAL_DbgDisableTargetConsistencyAsserts, W("DbgDisableTargetConsistencyAsserts"), 0, "Allows explicitly testing with corrupt targets") +RETAIL_CONFIG_DWORD_INFO(INTERNAL_DbgEnableMixedModeDebugging, W("DbgEnableMixedModeDebuggingInternalOnly"), 0, "") +CONFIG_DWORD_INFO(INTERNAL_DbgExtraThreads, W("DbgExtraThreads"), 0, "Allows extra unmanaged threads to run and throw debug events for stress testing") +CONFIG_DWORD_INFO(INTERNAL_DbgExtraThreadsCantStop, W("DbgExtraThreadsCantStop"), 0, "Allows extra unmanaged threads in can't stop region to run and throw debug events for stress testing") +CONFIG_DWORD_INFO(INTERNAL_DbgExtraThreadsIB, W("DbgExtraThreadsIB"), 0, "Allows extra in-band unmanaged threads to run and throw debug events for stress testing") +CONFIG_DWORD_INFO(INTERNAL_DbgExtraThreadsOOB, W("DbgExtraThreadsOOB"), 0, "Allows extra out of band unmanaged threads to run and throw debug events for stress testing") +CONFIG_DWORD_INFO(INTERNAL_DbgFaultInHandleIPCEvent, W("DbgFaultInHandleIPCEvent"), 0, "Allows testing the unhandled event filter") +CONFIG_DWORD_INFO(INTERNAL_DbgInjectFEE, W("DbgInjectFEE"), 0, "Allows injecting a fatal execution error for testing Watson") +CONFIG_DWORD_INFO(INTERNAL_DbgLeakCheck, W("DbgLeakCheck"), 0, "Allows checking for leaked Cordb objects") +CONFIG_DWORD_INFO(INTERNAL_DbgNo2ndChance, W("DbgNo2ndChance"), 0, "Allows breaking on (and catching bogus) 2nd chance exceptions") +CONFIG_DWORD_INFO(INTERNAL_DbgNoDebugger, W("DbgNoDebugger"), 0, "Allows breaking if we don't want to lazily initialize the debugger") +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DbgNoForceContinue, W("DbgNoForceContinue"), 1, "Used to force a continue on longhorn") +CONFIG_DWORD_INFO(INTERNAL_DbgNoOpenMDByFile, W("DbgNoOpenMDByFile"), 0, "Allows opening MD by memory for perf testing") CONFIG_DWORD_INFO(INTERNAL_DbgOOBinFEEE, W("DbgOOBinFEEE"), 0, "Allows forcing oob breakpoints when a fatal error occurs") -CONFIG_DWORD_INFO_EX(INTERNAL_DbgPingInterop, W("DbgPingInterop"), 0, "Allows checking for deadlocks in interop debugging", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgRace, W("DbgRace"), 0, "Allows pausing for native debug events to get hijicked", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DbgRedirect, W("DbgRedirect"), 0, "Allows for redirecting the event pipeline", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_DbgPingInterop, W("DbgPingInterop"), 0, "Allows checking for deadlocks in interop debugging") +CONFIG_DWORD_INFO(INTERNAL_DbgRace, W("DbgRace"), 0, "Allows pausing for native debug events to get hijicked") +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DbgRedirect, W("DbgRedirect"), 0, "Allows for redirecting the event pipeline") RETAIL_CONFIG_STRING_INFO(EXTERNAL_DbgRedirectApplication, W("DbgRedirectApplication"), "Specifies the auxiliary debugger application to launch.") RETAIL_CONFIG_STRING_INFO(EXTERNAL_DbgRedirectAttachCmd, W("DbgRedirectAttachCmd"), "Specifies command parameters for attaching the auxiliary debugger.") RETAIL_CONFIG_STRING_INFO(EXTERNAL_DbgRedirectCommonCmd, W("DbgRedirectCommonCmd"), "Specifies a command line format string for the auxiliary debugger.") RETAIL_CONFIG_STRING_INFO(EXTERNAL_DbgRedirectCreateCmd, W("DbgRedirectCreateCmd"), "Specifies command parameters when creating the auxiliary debugger.") -CONFIG_DWORD_INFO_EX(INTERNAL_DbgShortcutCanary, W("DbgShortcutCanary"), 0, "Allows a way to force canary to fail to be able to test failure paths", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgSkipMEOnStep, W("DbgSkipMEOnStep"), 0, "Turns off MethodEnter checks", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgSkipVerCheck, W("DbgSkipVerCheck"), 0, "Allows different RS and LS versions (for servicing work)", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgTC, W("DbgTC"), 0, "Allows checking boundary compression for offset mappings", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgTransportFaultInject, W("DbgTransportFaultInject"), 0, "Allows injecting a fault for testing the debug transport", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_DbgShortcutCanary, W("DbgShortcutCanary"), 0, "Allows a way to force canary to fail to be able to test failure paths") +CONFIG_DWORD_INFO(INTERNAL_DbgSkipMEOnStep, W("DbgSkipMEOnStep"), 0, "Turns off MethodEnter checks") +CONFIG_DWORD_INFO(INTERNAL_DbgSkipVerCheck, W("DbgSkipVerCheck"), 0, "Allows different RS and LS versions (for servicing work)") +CONFIG_DWORD_INFO(INTERNAL_DbgTC, W("DbgTC"), 0, "Allows checking boundary compression for offset mappings") +CONFIG_DWORD_INFO(INTERNAL_DbgTransportFaultInject, W("DbgTransportFaultInject"), 0, "Allows injecting a fault for testing the debug transport") CONFIG_DWORD_INFO(INTERNAL_DbgTransportLog, W("DbgTransportLog"), 0 /* LE_None */, "Turns on logging for the debug transport") CONFIG_DWORD_INFO(INTERNAL_DbgTransportLogClass, W("DbgTransportLogClass"), (DWORD)-1 /* LC_All */, "Mask to control what is logged in DbgTransportLog") -RETAIL_CONFIG_STRING_INFO_EX(UNSUPPORTED_DbgTransportProxyAddress, W("DbgTransportProxyAddress"), "Allows specifying the transport proxy address", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgTrapOnSkip, W("DbgTrapOnSkip"), 0, "Allows breaking when we skip a breakpoint", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DbgWaitTimeout, W("DbgWaitTimeout"), 1, "Specifies the timeout value for waits", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DbgWFDETimeout, W("DbgWFDETimeout"), 25, "Specifies the timeout value for wait when waiting for a debug event", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_RaiseExceptionOnAssert, W("RaiseExceptionOnAssert"), 0, "Raise a first chance (if set to 1) or second chance (if set to 2) exception on asserts.", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DebugBreakOnAssert, W("DebugBreakOnAssert"), 0, "If DACCESS_COMPILE is defined, break on asserts.", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_DebugBreakOnVerificationFailure, W("DebugBreakOnVerificationFailure"), 0, "Halts the jit on verification failure", CLRConfig::EEConfig_default) -CONFIG_STRING_INFO_EX(INTERNAL_DebuggerBreakPoint, W("DebuggerBreakPoint"), "Allows counting various debug events", CLRConfig::EEConfig_default) -CONFIG_STRING_INFO_EX(INTERNAL_DebugVerify, W("DebugVerify"), "Control for tracing in peverify", CLRConfig::EEConfig_default) +RETAIL_CONFIG_STRING_INFO(UNSUPPORTED_DbgTransportProxyAddress, W("DbgTransportProxyAddress"), "Allows specifying the transport proxy address") +CONFIG_DWORD_INFO(INTERNAL_DbgTrapOnSkip, W("DbgTrapOnSkip"), 0, "Allows breaking when we skip a breakpoint") +CONFIG_DWORD_INFO(INTERNAL_DbgWaitTimeout, W("DbgWaitTimeout"), 1, "Specifies the timeout value for waits") +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DbgWFDETimeout, W("DbgWFDETimeout"), 25, "Specifies the timeout value for wait when waiting for a debug event") +CONFIG_DWORD_INFO(INTERNAL_RaiseExceptionOnAssert, W("RaiseExceptionOnAssert"), 0, "Raise a first chance (if set to 1) or second chance (if set to 2) exception on asserts.") +CONFIG_DWORD_INFO(INTERNAL_DebugBreakOnAssert, W("DebugBreakOnAssert"), 0, "If DACCESS_COMPILE is defined, break on asserts.") +CONFIG_DWORD_INFO(INTERNAL_DebugBreakOnVerificationFailure, W("DebugBreakOnVerificationFailure"), 0, "Halts the jit on verification failure") +CONFIG_STRING_INFO(INTERNAL_DebuggerBreakPoint, W("DebuggerBreakPoint"), "Allows counting various debug events") +CONFIG_STRING_INFO(INTERNAL_DebugVerify, W("DebugVerify"), "Control for tracing in peverify") CONFIG_DWORD_INFO(INTERNAL_EncApplyChanges, W("EncApplyChanges"), 0, "Allows breaking when ApplyEditAndContinue is called") -CONFIG_DWORD_INFO_EX(INTERNAL_EnCBreakOnRemapComplete, W("EnCBreakOnRemapComplete"), 0, "Allows breaking after N RemapCompletes", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_EnCBreakOnRemapOpportunity, W("EnCBreakOnRemapOpportunity"), 0, "Allows breaking after N RemapOpportunities", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_EnCBreakOnRemapComplete, W("EnCBreakOnRemapComplete"), 0, "Allows breaking after N RemapCompletes") +CONFIG_DWORD_INFO(INTERNAL_EnCBreakOnRemapOpportunity, W("EnCBreakOnRemapOpportunity"), 0, "Allows breaking after N RemapOpportunities") CONFIG_DWORD_INFO(INTERNAL_EncDumpApplyChanges, W("EncDumpApplyChanges"), 0, "Allows dumping edits in delta metadata and il files") CONFIG_DWORD_INFO(INTERNAL_EncFixupFieldBreak, W("EncFixupFieldBreak"), 0, "Unlikely that this is used anymore.") CONFIG_DWORD_INFO(INTERNAL_EncJitUpdatedFunction, W("EncJitUpdatedFunction"), 0, "Allows breaking when an updated function is jitted") CONFIG_DWORD_INFO(INTERNAL_EnCResolveField, W("EnCResolveField"), 0, "Allows breaking when computing the address of an EnC-added field") CONFIG_DWORD_INFO(INTERNAL_EncResumeInUpdatedFunction, W("EncResumeInUpdatedFunction"), 0, "Allows breaking when execution resumes in a new EnC version of a function") -CONFIG_DWORD_INFO_EX(INTERNAL_DbgAssertOnDebuggeeDebugBreak, W("DbgAssertOnDebuggeeDebugBreak"), 0, "If non-zero causes the managed-only debugger to assert on unhandled breakpoints in the debuggee", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_DbgAssertOnDebuggeeDebugBreak, W("DbgAssertOnDebuggeeDebugBreak"), 0, "If non-zero causes the managed-only debugger to assert on unhandled breakpoints in the debuggee") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DbgDontResumeThreadsOnUnhandledException, W("UNSUPPORTED_DbgDontResumeThreadsOnUnhandledException"), 0, "If non-zero, then don't try to unsuspend threads after continuing a 2nd-chance native exception") -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DbgSkipStackCheck, W("DbgSkipStackCheck"), 0, "Skip the stack pointer check during stackwalking", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DbgSkipStackCheck, W("DbgSkipStackCheck"), 0, "Skip the stack pointer check during stackwalking") #ifdef DACCESS_COMPILE CONFIG_DWORD_INFO(INTERNAL_DumpGeneration_IntentionallyCorruptDataFromTarget, W("IntentionallyCorruptDataFromTarget"), 0, "Intentionally fakes bad data retrieved from target to try and break dump generation.") #endif @@ -240,17 +234,16 @@ CONFIG_DWORD_INFO(UNSUPPORTED_Debugging_RequiredVersion, W("UNSUPPORTED_Debuggin RETAIL_CONFIG_DWORD_INFO(INTERNAL_MiniMdBufferCapacity, W("MiniMdBufferCapacity"), 64 * 1024, "The max size of the buffer to store mini metadata information for triage- and mini-dumps.") #endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS -CONFIG_DWORD_INFO_EX(INTERNAL_DbgNativeCodeBpBindsAcrossVersions, W("DbgNativeCodeBpBindsAcrossVersions"), 0, "If non-zero causes native breakpoints at offset 0 to bind in all tiered compilation versions of the given method", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_DbgNativeCodeBpBindsAcrossVersions, W("DbgNativeCodeBpBindsAcrossVersions"), 0, "If non-zero causes native breakpoints at offset 0 to bind in all tiered compilation versions of the given method") /// /// Diagnostics (internal general-purpose) /// CONFIG_DWORD_INFO(INTERNAL_ConditionalContracts, W("ConditionalContracts"), 0, "If ENABLE_CONTRACTS_IMPL is defined, sets whether contracts are conditional. (?)") CONFIG_DWORD_INFO(INTERNAL_ConsistencyCheck, W("ConsistencyCheck"), 0, "") -CONFIG_DWORD_INFO_EX(INTERNAL_ContinueOnAssert, W("ContinueOnAssert"), 0, "If set, doesn't break on asserts.", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_disableStackOverflowProbing, W("disableStackOverflowProbing"), 0, "", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_ContinueOnAssert, W("ContinueOnAssert"), 0, "If set, doesn't break on asserts.") CONFIG_DWORD_INFO(INTERNAL_InjectFatalError, W("InjectFatalError"), 0, "") -CONFIG_DWORD_INFO_EX(INTERNAL_InjectFault, W("InjectFault"), 0, "", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_InjectFault, W("InjectFault"), 0, "") CONFIG_DWORD_INFO(INTERNAL_SuppressChecks, W("SuppressChecks"),0, "") #ifdef FEATURE_EH_FUNCLETS CONFIG_DWORD_INFO(INTERNAL_SuppressLockViolationsOnReentryFromOS, W("SuppressLockViolationsOnReentryFromOS"), 0, "64 bit OOM tests re-enter the CLR via RtlVirtualUnwind. This indicates whether to suppress resulting locking violations.") @@ -260,10 +253,10 @@ CONFIG_DWORD_INFO(INTERNAL_SuppressLockViolationsOnReentryFromOS, W("SuppressLoc /// Exception Handling /// CONFIG_DWORD_INFO(INTERNAL_AssertOnFailFast, W("AssertOnFailFast"), 1, "") -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_legacyCorruptedStateExceptionsPolicy, W("legacyCorruptedStateExceptionsPolicy"), 0, "Enabled Pre-V4 CSE behavior", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_SuppressLostExceptionTypeAssert, W("SuppressLostExceptionTypeAssert"), 0, "", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_UseEntryPointFilter, W("UseEntryPointFilter"), 0, "", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_Corhost_Swallow_Uncaught_Exceptions, W("Corhost_Swallow_Uncaught_Exceptions"), 0, "", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_legacyCorruptedStateExceptionsPolicy, W("legacyCorruptedStateExceptionsPolicy"), 0, "Enabled Pre-V4 CSE behavior") +CONFIG_DWORD_INFO(INTERNAL_SuppressLostExceptionTypeAssert, W("SuppressLostExceptionTypeAssert"), 0, "") +RETAIL_CONFIG_DWORD_INFO(INTERNAL_UseEntryPointFilter, W("UseEntryPointFilter"), 0, "") +RETAIL_CONFIG_DWORD_INFO(INTERNAL_Corhost_Swallow_Uncaught_Exceptions, W("Corhost_Swallow_Uncaught_Exceptions"), 0, "") /// /// Garbage collector @@ -283,8 +276,8 @@ RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StatsUpdatePeriod, W("StatsUpdatePeriod"), RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCRetainVM, W("GCRetainVM"), 0, "When set we put the segments that should be deleted on a standby list (instead of releasing them back to the OS) which will be considered to satisfy new segment requests (note that the same thing can be specified via API which is the supported way)") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCLOHThreshold, W("GCLOHThreshold"), 0, "Specifies the size that will make objects go on LOH") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_gcAllowVeryLargeObjects, W("gcAllowVeryLargeObjects"), 1, "Allow allocation of 2GB+ objects on GC heap") -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_GCStress, W("GCStress"), 0, "Trigger GCs at regular intervals", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_GcStressOnDirectCalls, W("GcStressOnDirectCalls"), 0, "Whether to trigger a GC on direct calls", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCStress, W("GCStress"), 0, "Trigger GCs at regular intervals") +CONFIG_DWORD_INFO(INTERNAL_GcStressOnDirectCalls, W("GcStressOnDirectCalls"), 0, "Whether to trigger a GC on direct calls") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_HeapVerify, W("HeapVerify"), 0, "When set verifies the integrity of the managed heap on entry and exit of each GC") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCNumaAware, W("GCNumaAware"), 1, "Specifies if to enable GC NUMA aware") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCCpuGroup, W("GCCpuGroup"), 0, "Specifies if to enable GC to support CPU groups") @@ -293,32 +286,32 @@ RETAIL_CONFIG_STRING_INFO(EXTERNAL_GCName, W("GCName"), "") /// /// IBC /// -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_ConvertIbcData, W("ConvertIbcData"), 1, "Converts between v1 and v2 IBC data", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_DisableIBC, W("DisableIBC"), 0, "Disables the use of IBC data", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_UseIBCFile, W("UseIBCFile"), 0, "", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_ConvertIbcData, W("ConvertIbcData"), 1, "Converts between v1 and v2 IBC data") +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DisableIBC, W("DisableIBC"), 0, "Disables the use of IBC data") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_UseIBCFile, W("UseIBCFile"), 0, "") /// /// JIT /// -CONFIG_DWORD_INFO_EX(INTERNAL_JitBreakEmit, W("JitBreakEmit"), (DWORD)-1, "", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_JitBreakEmit, W("JitBreakEmit"), (DWORD)-1, "") CONFIG_DWORD_INFO(INTERNAL_JitDebuggable, W("JitDebuggable"), 0, "") #if !defined(DEBUG) && !defined(_DEBUG) #define INTERNAL_JitEnableNoWayAssert_Default 0 #else #define INTERNAL_JitEnableNoWayAssert_Default 1 #endif -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_JitEnableNoWayAssert, W("JitEnableNoWayAssert"), INTERNAL_JitEnableNoWayAssert_Default, "", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(INTERNAL_JitEnableNoWayAssert, W("JitEnableNoWayAssert"), INTERNAL_JitEnableNoWayAssert_Default, "") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_JitFramed, W("JitFramed"), 0, "Forces EBP frames") -CONFIG_DWORD_INFO_EX(INTERNAL_JitGCStress, W("JitGCStress"), 0, "GC stress mode for jit", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_JitGCStress, W("JitGCStress"), 0, "GC stress mode for jit") CONFIG_DWORD_INFO(INTERNAL_JitHeartbeat, W("JitHeartbeat"), 0, "") CONFIG_DWORD_INFO(INTERNAL_JitHelperLogging, W("JitHelperLogging"), 0, "") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_JITMinOpts, W("JITMinOpts"), 0, "Forces MinOpts") RETAIL_CONFIG_STRING_INFO(EXTERNAL_JitName, W("JitName"), "Primary Jit to use") #if defined(ALLOW_SXS_JIT) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_AltJitName, W("AltJitName"), "Alternative Jit to use, will fall back to primary jit.", CLRConfig::EEConfig_default) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_AltJit, W("AltJit"), "Enables AltJit and selectively limits it to the specified methods.", CLRConfig::EEConfig_default) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_AltJitExcludeAssemblies, W("AltJitExcludeAssemblies"), "Do not use AltJit on this semicolon-delimited list of assemblies.", CLRConfig::EEConfig_default) +RETAIL_CONFIG_STRING_INFO(EXTERNAL_AltJitName, W("AltJitName"), "Alternative Jit to use, will fall back to primary jit.") +RETAIL_CONFIG_STRING_INFO(EXTERNAL_AltJit, W("AltJit"), "Enables AltJit and selectively limits it to the specified methods.") +RETAIL_CONFIG_STRING_INFO(EXTERNAL_AltJitExcludeAssemblies, W("AltJitExcludeAssemblies"), "Do not use AltJit on this semicolon-delimited list of assemblies.") #endif // defined(ALLOW_SXS_JIT) #if defined(FEATURE_STACK_SAMPLING) @@ -329,21 +322,21 @@ RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StackSamplingNumMethods, W("StackSamplingNu #endif // defined(FEATURE_JIT_SAMPLING) #if defined(ALLOW_SXS_JIT_NGEN) -RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_AltJitNgen, W("AltJitNgen"), "Enables AltJit for NGEN and selectively limits it to the specified methods.", CLRConfig::EEConfig_default) +RETAIL_CONFIG_STRING_INFO(INTERNAL_AltJitNgen, W("AltJitNgen"), "Enables AltJit for NGEN and selectively limits it to the specified methods.") #endif // defined(ALLOW_SXS_JIT_NGEN) RETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitHostMaxSlabCache, W("JitHostMaxSlabCache"), 0x1000000, "Sets jit host max slab cache size, 16MB default") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitOptimizeType, W("JitOptimizeType"), 0 /* OPT_DEFAULT */, "") -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_JitPrintInlinedMethods, W("JitPrintInlinedMethods"), 0, "", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitPrintInlinedMethods, W("JitPrintInlinedMethods"), 0, "") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitTelemetry, W("JitTelemetry"), 1, "If non-zero, gather JIT telemetry data") RETAIL_CONFIG_STRING_INFO(INTERNAL_JitTimeLogFile, W("JitTimeLogFile"), "If set, gather JIT throughput data and write to this file.") RETAIL_CONFIG_STRING_INFO(INTERNAL_JitTimeLogCsv, W("JitTimeLogCsv"), "If set, gather JIT throughput data and write to a CSV file. This mode must be used in internal retail builds.") RETAIL_CONFIG_STRING_INFO(INTERNAL_JitFuncInfoLogFile, W("JitFuncInfoLogFile"), "If set, gather JIT function info and write to this file.") CONFIG_DWORD_INFO(INTERNAL_JitVerificationDisable, W("JitVerificationDisable"), 0, "") RETAIL_CONFIG_DWORD_INFO(INTERNAL_JitLockWrite, W("JitLockWrite"), 0, "Force all volatile writes to be 'locked'") -CONFIG_STRING_INFO_EX(INTERNAL_TailCallMax, W("TailCallMax"), "", CLRConfig::EEConfig_default) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_TailCallOpt, W("TailCallOpt"), "", CLRConfig::EEConfig_default) +CONFIG_STRING_INFO(INTERNAL_TailCallMax, W("TailCallMax"), "") +RETAIL_CONFIG_STRING_INFO(EXTERNAL_TailCallOpt, W("TailCallOpt"), "") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_TailCallLoopOpt, W("TailCallLoopOpt"), 1, "Convert recursive tail calls to loops") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_Jit_NetFx40PInvokeStackResilience, W("NetFx40_PInvokeStackResilience"), (DWORD)-1, "Makes P/Invoke resilient against mismatched signature and calling convention (significant perf penalty).") @@ -353,10 +346,10 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_AltJitAssertOnNYI, W("AltJitAssertOnNYI"), 0, #else RETAIL_CONFIG_DWORD_INFO(INTERNAL_AltJitAssertOnNYI, W("AltJitAssertOnNYI"), 1, "Controls the AltJit behavior of NYI stuff") #endif -CONFIG_DWORD_INFO_EX(INTERNAL_JitLargeBranches, W("JitLargeBranches"), 0, "Force using the largest conditional branch format", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_JitRegisterFP, W("JitRegisterFP"), 3, "Control FP enregistration", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_JitLargeBranches, W("JitLargeBranches"), 0, "Force using the largest conditional branch format") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitRegisterFP, W("JitRegisterFP"), 3, "Control FP enregistration") RETAIL_CONFIG_DWORD_INFO(INTERNAL_JitELTHookEnabled, W("JitELTHookEnabled"), 0, "On ARM, setting this will emit Enter/Leave/TailCall callbacks") -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_JitMemStats, W("JitMemStats"), 0, "Display JIT memory usage statistics", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(INTERNAL_JitMemStats, W("JitMemStats"), 0, "Display JIT memory usage statistics") RETAIL_CONFIG_DWORD_INFO(INTERNAL_JitVNMapSelBudget, W("JitVNMapSelBudget"), 100, "Max # of MapSelect's considered for a particular top-level invocation.") #if defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_ARM64) #define EXTERNAL_FeatureSIMD_Default 1 @@ -368,10 +361,10 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_JitVNMapSelBudget, W("JitVNMapSelBudget"), 100 #else // !(defined(TARGET_AMD64) || defined(TARGET_X86) #define EXTERNAL_JitEnableAVX_Default 0 #endif // !(defined(TARGET_AMD64) || defined(TARGET_X86) -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_FeatureSIMD, W("FeatureSIMD"), EXTERNAL_FeatureSIMD_Default, "Enable SIMD intrinsics recognition in System.Numerics.dll and/or System.Numerics.Vectors.dll", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_FeatureSIMD, W("FeatureSIMD"), EXTERNAL_FeatureSIMD_Default, "Enable SIMD intrinsics recognition in System.Numerics.dll and/or System.Numerics.Vectors.dll") RETAIL_CONFIG_DWORD_INFO(INTERNAL_SIMD16ByteOnly, W("SIMD16ByteOnly"), 0, "Limit maximum SIMD vector length to 16 bytes (used by x64_arm64_altjit)") -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_EnableAVX, W("EnableAVX"), EXTERNAL_JitEnableAVX_Default, "Enable AVX instruction set for wide operations as default", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_TrackDynamicMethodDebugInfo, W("TrackDynamicMethodDebugInfo"), 0, "Specifies whether debug info should be generated and tracked for dynamic methods", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX, W("EnableAVX"), EXTERNAL_JitEnableAVX_Default, "Enable AVX instruction set for wide operations as default") +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TrackDynamicMethodDebugInfo, W("TrackDynamicMethodDebugInfo"), 0, "Specifies whether debug info should be generated and tracked for dynamic methods") #ifdef FEATURE_MULTICOREJIT @@ -384,18 +377,18 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_MultiCoreJitProfileWriteDelay, W("MultiCoreJit /// /// Interpreter /// -RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_Interpret, W("Interpret"), "Selectively uses the interpreter to execute the specified methods", CLRConfig::EEConfig_default) -RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_InterpretExclude, W("InterpretExclude"), "Excludes the specified methods from the set selected by 'Interpret'", CLRConfig::EEConfig_default) +RETAIL_CONFIG_STRING_INFO(INTERNAL_Interpret, W("Interpret"), "Selectively uses the interpreter to execute the specified methods") +RETAIL_CONFIG_STRING_INFO(INTERNAL_InterpretExclude, W("InterpretExclude"), "Excludes the specified methods from the set selected by 'Interpret'") RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterMethHashMin, W("InterpreterMethHashMin"), 0, "Only interpret methods selected by 'Interpret' whose hash is at least this value. or after nth") RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterMethHashMax, W("InterpreterMethHashMax"), UINT32_MAX, "If non-zero, only interpret methods selected by 'Interpret' whose hash is at most this value") RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterStubMin, W("InterpreterStubMin"), 0, "Only interpret methods selected by 'Interpret' whose stub num is at least this value.") RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterStubMax, W("InterpreterStubMax"), UINT32_MAX, "If non-zero, only interpret methods selected by 'Interpret' whose stub number is at most this value.") RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterJITThreshold, W("InterpreterJITThreshold"), 10, "The number of times a method should be interpreted before being JITted") RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterDoLoopMethods, W("InterpreterDoLoopMethods"), 0, "If set, don't check for loops, start by interpreting *all* methods") -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_InterpreterUseCaching, W("InterpreterUseCaching"), 1, "If non-zero, use the caching mechanism.", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_InterpreterLooseRules, W("InterpreterLooseRules"), 1, "If non-zero, allow ECMA spec violations required by managed C++.", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterUseCaching, W("InterpreterUseCaching"), 1, "If non-zero, use the caching mechanism.") +RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterLooseRules, W("InterpreterLooseRules"), 1, "If non-zero, allow ECMA spec violations required by managed C++.") RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterPrintPostMortem, W("InterpreterPrintPostMortem"), 0, "Prints summary information about the execution to the console") -RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_InterpreterLogFile, W("InterpreterLogFile"), "If non-null, append interpreter logging to this file, else use stdout", CLRConfig::EEConfig_default) +RETAIL_CONFIG_STRING_INFO(INTERNAL_InterpreterLogFile, W("InterpreterLogFile"), "If non-null, append interpreter logging to this file, else use stdout") RETAIL_CONFIG_DWORD_INFO(INTERNAL_DumpInterpreterStubs, W("DumpInterpreterStubs"), 0, "Prints all interpreter stubs that are created to the console") RETAIL_CONFIG_DWORD_INFO(INTERNAL_TraceInterpreterEntries, W("TraceInterpreterEntries"), 0, "Logs entries to interpreted methods to the console") RETAIL_CONFIG_DWORD_INFO(INTERNAL_TraceInterpreterIL, W("TraceInterpreterIL"), 0, "Logs individual instructions of interpreted methods to the console") @@ -415,7 +408,7 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterFallback, W("InterpreterFallback"), /// /// Loader heap /// -CONFIG_DWORD_INFO_EX(INTERNAL_LoaderHeapCallTracing, W("LoaderHeapCallTracing"), 0, "Loader heap troubleshooting", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_LoaderHeapCallTracing, W("LoaderHeapCallTracing"), 0, "Loader heap troubleshooting") RETAIL_CONFIG_DWORD_INFO(INTERNAL_CodeHeapReserveForJumpStubs, W("CodeHeapReserveForJumpStubs"), 1, "Percentage of code heap to reserve for jump stubs") RETAIL_CONFIG_DWORD_INFO(INTERNAL_NGenReserveForJumpStubs, W("NGenReserveForJumpStubs"), 0, "Percentage of ngen image size to reserve for jump stubs") RETAIL_CONFIG_DWORD_INFO(INTERNAL_BreakOnOutOfMemoryWithinRange, W("BreakOnOutOfMemoryWithinRange"), 0, "Break before out of memory within range exception is thrown") @@ -427,7 +420,7 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_LogEnable, W("LogEnable"), 0, "Turns on the tr RETAIL_CONFIG_DWORD_INFO(INTERNAL_LogFacility, W("LogFacility"), 0, "Specifies a facility mask for CLR log. (See 'loglf.h'; VM interprets string value as hex number.) Also used by stresslog.") RETAIL_CONFIG_DWORD_INFO(INTERNAL_LogFacility2, W("LogFacility2"), 0, "Specifies a facility mask for CLR log. (See 'loglf.h'; VM interprets string value as hex number.) Also used by stresslog.") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_logFatalError, W("logFatalError"), 1, "Specifies whether EventReporter logs fatal errors in the Windows event log.") -CONFIG_STRING_INFO_EX(INTERNAL_LogFile, W("LogFile"), "Specifies a file name for the CLR log.", CLRConfig::EEConfig_default) +CONFIG_STRING_INFO(INTERNAL_LogFile, W("LogFile"), "Specifies a file name for the CLR log.") CONFIG_DWORD_INFO(INTERNAL_LogFileAppend, W("LogFileAppend"), 0 , "Specifies whether to append to or replace the CLR log file.") CONFIG_DWORD_INFO(INTERNAL_LogFlushFile, W("LogFlushFile"), 0 , "Specifies whether to flush the CLR log file on each write.") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_LogLevel, W("LogLevel"), 0 , "4=10 msgs, 9=1000000, 10=everything") @@ -439,32 +432,32 @@ CONFIG_DWORD_INFO(INTERNAL_LogWithPid, W("LogWithPid"), FALSE, "Appends pid to f /// /// MetaData /// -CONFIG_DWORD_INFO_EX(INTERNAL_MD_ApplyDeltaBreak, W("MD_ApplyDeltaBreak"), 0, "ASSERT when applying EnC", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_MD_ApplyDeltaBreak, W("MD_ApplyDeltaBreak"), 0, "ASSERT when applying EnC") RETAIL_CONFIG_DWORD_INFO(INTERNAL_AssertOnBadImageFormat, W("AssertOnBadImageFormat"), 0, "ASSERT when invalid MD read") -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_MD_DeltaCheck, W("MD_DeltaCheck"), 1, "Some checks of GUID when applying EnC (?)", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_MD_EncDelta, W("MD_EncDelta"), 0, "Forces EnC Delta format in MD (?)", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_MD_ForceNoColDesSharing, W("MD_ForceNoColDesSharing"), 0, "Don't know - the only usage I could find is #if 0 (?)", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_MD_KeepKnownCA, W("MD_KeepKnownCA"), 0, "Something with known CAs (?)", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_MD_MiniMDBreak, W("MD_MiniMDBreak"), 0, "ASSERT when creating CMiniMdRw class", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_MD_PreSaveBreak, W("MD_PreSaveBreak"), 0, "ASSERT when calling CMiniMdRw::PreSave", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_MD_RegMetaBreak, W("MD_RegMetaBreak"), 0, "ASSERT when creating RegMeta class", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_MD_RegMetaDump, W("MD_RegMetaDump"), 0, "Dump MD in 4 functions (?)", CLRConfig::EEConfig_default) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_DOTNET_MODIFIABLE_ASSEMBLIES, W("DOTNET_MODIFIABLE_ASSEMBLIES"), "Enables hot reload on debug built assemblies with the 'debug' keyword", CLRConfig::DontPrependCOMPlus_ | CLRConfig::TrimWhiteSpaceFromStringValue); +RETAIL_CONFIG_DWORD_INFO(INTERNAL_MD_DeltaCheck, W("MD_DeltaCheck"), 1, "Some checks of GUID when applying EnC (?)") +CONFIG_DWORD_INFO(INTERNAL_MD_EncDelta, W("MD_EncDelta"), 0, "Forces EnC Delta format in MD (?)") +RETAIL_CONFIG_DWORD_INFO(INTERNAL_MD_ForceNoColDesSharing, W("MD_ForceNoColDesSharing"), 0, "Don't know - the only usage I could find is #if 0 (?)") +CONFIG_DWORD_INFO(INTERNAL_MD_KeepKnownCA, W("MD_KeepKnownCA"), 0, "Something with known CAs (?)") +CONFIG_DWORD_INFO(INTERNAL_MD_MiniMDBreak, W("MD_MiniMDBreak"), 0, "ASSERT when creating CMiniMdRw class") +CONFIG_DWORD_INFO(INTERNAL_MD_PreSaveBreak, W("MD_PreSaveBreak"), 0, "ASSERT when calling CMiniMdRw::PreSave") +CONFIG_DWORD_INFO(INTERNAL_MD_RegMetaBreak, W("MD_RegMetaBreak"), 0, "ASSERT when creating RegMeta class") +CONFIG_DWORD_INFO(INTERNAL_MD_RegMetaDump, W("MD_RegMetaDump"), 0, "Dump MD in 4 functions (?)") +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_DOTNET_MODIFIABLE_ASSEMBLIES, W("DOTNET_MODIFIABLE_ASSEMBLIES"), "Enables hot reload on debug built assemblies with the 'debug' keyword", CLRConfig::LookupOptions::DontPrependCOMPlus_ | CLRConfig::LookupOptions::TrimWhiteSpaceFromStringValue); // Metadata - mscordbi only - this flag is only intended to mitigate potential issues in bug fix 458597. -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_MD_PreserveDebuggerMetadataMemory, W("MD_PreserveDebuggerMetadataMemory"), 0, "Save all versions of metadata memory in the debugger when debuggee metadata is updated", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_MD_PreserveDebuggerMetadataMemory, W("MD_PreserveDebuggerMetadataMemory"), 0, "Save all versions of metadata memory in the debugger when debuggee metadata is updated") /// /// Spinning heuristics /// // Note that these only take effect once the runtime has been started; prior to that the values hardcoded in g_SpinConstants (vars.cpp) are used -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_SpinInitialDuration, W("SpinInitialDuration"), 0x32, "Hex value specifying the first spin duration", EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_SpinBackoffFactor, W("SpinBackoffFactor"), 0x3, "Hex value specifying the growth of each successive spin duration", EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_SpinLimitProcCap, W("SpinLimitProcCap"), 0xFFFFFFFF, "Hex value specifying the largest value of NumProcs to use when calculating the maximum spin duration", EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_SpinLimitProcFactor, W("SpinLimitProcFactor"), 0x4E20, "Hex value specifying the multiplier on NumProcs to use when calculating the maximum spin duration", EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_SpinLimitConstant, W("SpinLimitConstant"), 0x0, "Hex value specifying the constant to add when calculating the maximum spin duration", EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_SpinRetryCount, W("SpinRetryCount"), 0xA, "Hex value specifying the number of times the entire spin process is repeated (when applicable)", EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_Monitor_SpinCount, W("Monitor_SpinCount"), 0x1e, "Hex value specifying the maximum number of spin iterations Monitor may perform upon contention on acquiring the lock before waiting.", EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_SpinInitialDuration, W("SpinInitialDuration"), 0x32, "Hex value specifying the first spin duration") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_SpinBackoffFactor, W("SpinBackoffFactor"), 0x3, "Hex value specifying the growth of each successive spin duration") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_SpinLimitProcCap, W("SpinLimitProcCap"), 0xFFFFFFFF, "Hex value specifying the largest value of NumProcs to use when calculating the maximum spin duration") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_SpinLimitProcFactor, W("SpinLimitProcFactor"), 0x4E20, "Hex value specifying the multiplier on NumProcs to use when calculating the maximum spin duration") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_SpinLimitConstant, W("SpinLimitConstant"), 0x0, "Hex value specifying the constant to add when calculating the maximum spin duration") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_SpinRetryCount, W("SpinRetryCount"), 0xA, "Hex value specifying the number of times the entire spin process is repeated (when applicable)") +RETAIL_CONFIG_DWORD_INFO(INTERNAL_Monitor_SpinCount, W("Monitor_SpinCount"), 0x1e, "Hex value specifying the maximum number of spin iterations Monitor may perform upon contention on acquiring the lock before waiting.") /// /// Native Binder @@ -474,27 +467,26 @@ CONFIG_DWORD_INFO(INTERNAL_NgenBind_ZapForbid, W("NgenBind_ZapForbid CONFIG_STRING_INFO(INTERNAL_NgenBind_ZapForbidExcludeList, W("NgenBind_ZapForbidExcludeList"), "") CONFIG_STRING_INFO(INTERNAL_NgenBind_ZapForbidList, W("NgenBind_ZapForbidList"), "") -CONFIG_DWORD_INFO_EX(INTERNAL_SymDiffDump, W("SymDiffDump"), 0, "Used to create the map file while binding the assembly. Used by SemanticDiffer", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_SymDiffDump, W("SymDiffDump"), 0, "Used to create the map file while binding the assembly. Used by SemanticDiffer") /// /// NGEN /// -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_NGen_JitName, W("NGen_JitName"), "", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_NGenFramed, W("NGenFramed"), (DWORD)-1, "Same as JitFramed, but for ngen", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_NGenOnlyOneMethod, W("NGenOnlyOneMethod"), 0, "", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_NgenOrder, W("NgenOrder"), 0, "", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_partialNGenStress, W("partialNGenStress"), 0, "", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_ZapDoNothing, W("ZapDoNothing"), 0, "", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_NgenForceFailureMask, W("NgenForceFailureMask"), (DWORD)-1, "Bitmask used to control which locations will check and raise the failure (defaults to bits: -1)", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_NgenForceFailureCount, W("NgenForceFailureCount"), 0, "If set to >0 and we have IBC data we will force a failure after we reference an IBC data item times", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_NgenForceFailureKind, W("NgenForceFailureKind"), 1, "If set to 1, We will throw a TypeLoad exception; If set to 2, We will cause an A/V", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_NGenFramed, W("NGenFramed"), (DWORD)-1, "Same as JitFramed, but for ngen") +CONFIG_DWORD_INFO(INTERNAL_NGenOnlyOneMethod, W("NGenOnlyOneMethod"), 0, "") +CONFIG_DWORD_INFO(INTERNAL_NgenOrder, W("NgenOrder"), 0, "") +CONFIG_DWORD_INFO(INTERNAL_partialNGenStress, W("partialNGenStress"), 0, "") +CONFIG_DWORD_INFO(INTERNAL_ZapDoNothing, W("ZapDoNothing"), 0, "") +CONFIG_DWORD_INFO(INTERNAL_NgenForceFailureMask, W("NgenForceFailureMask"), (DWORD)-1, "Bitmask used to control which locations will check and raise the failure (defaults to bits: -1)") +CONFIG_DWORD_INFO(INTERNAL_NgenForceFailureCount, W("NgenForceFailureCount"), 0, "If set to >0 and we have IBC data we will force a failure after we reference an IBC data item times") +CONFIG_DWORD_INFO(INTERNAL_NgenForceFailureKind, W("NgenForceFailureKind"), 1, "If set to 1, We will throw a TypeLoad exception; If set to 2, We will cause an A/V") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_NGenEnableCreatePdb, W("NGenEnableCreatePdb"), 0, "If set to >0 ngen.exe displays help on, recognizes createpdb in the command line") RETAIL_CONFIG_DWORD_INFO(INTERNAL_NGenSimulateDiskFull, W("NGenSimulateDiskFull"), 0, "If set to 1, ngen will throw a Disk full exception in ZapWriter.cpp:Save()") RETAIL_CONFIG_DWORD_INFO(INTERNAL_PartialNGen, W("PartialNGen"), (DWORD)-1, "Generate partial NGen images") CONFIG_DWORD_INFO(INTERNAL_NoASLRForNgen, W("NoASLRForNgen"), 0, "Turn off IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE bit in generated ngen images. Makes nidump output repeatable from run to run.") -RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_NativeImageSearchPaths, W("NativeImageSearchPaths"), "Extra search paths for native composite R2R images", CLRConfig::EEConfig_default) +RETAIL_CONFIG_STRING_INFO(INTERNAL_NativeImageSearchPaths, W("NativeImageSearchPaths"), "Extra search paths for native composite R2R images") #ifdef CROSSGEN_COMPILE RETAIL_CONFIG_DWORD_INFO(INTERNAL_CrossGenAssumeInputSigned, W("CrossGenAssumeInputSigned"), 1, "CrossGen should assume that its input assemblies will be signed before deployment") @@ -503,19 +495,19 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_CrossGenAssumeInputSigned, W("CrossGenAssumeIn /// /// Profiling API / ETW /// -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_COR_ENABLE_PROFILING, W("COR_ENABLE_PROFILING"), 0, "Flag to indicate whether profiling should be enabled for the currently running process.", CLRConfig::DontPrependCOMPlus_) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_COR_PROFILER, W("COR_PROFILER"), "Specifies GUID of profiler to load into currently running process", CLRConfig::DontPrependCOMPlus_) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_COR_PROFILER_PATH, W("COR_PROFILER_PATH"), "Specifies the path to the DLL of profiler to load into currently running process", CLRConfig::DontPrependCOMPlus_) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_COR_PROFILER_PATH_32, W("COR_PROFILER_PATH_32"), "Specifies the path to the DLL of profiler to load into currently running 32 bits process", CLRConfig::DontPrependCOMPlus_) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_COR_PROFILER_PATH_64, W("COR_PROFILER_PATH_64"), "Specifies the path to the DLL of profiler to load into currently running 64 bits process", CLRConfig::DontPrependCOMPlus_) -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_CORECLR_ENABLE_PROFILING, W("CORECLR_ENABLE_PROFILING"), 0, "CoreCLR only: Flag to indicate whether profiling should be enabled for the currently running process.", CLRConfig::DontPrependCOMPlus_) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER, W("CORECLR_PROFILER"), "CoreCLR only: Specifies GUID of profiler to load into currently running process", CLRConfig::DontPrependCOMPlus_) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH, W("CORECLR_PROFILER_PATH"), "CoreCLR only: Specifies the path to the DLL of profiler to load into currently running process", CLRConfig::DontPrependCOMPlus_) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_32, W("CORECLR_PROFILER_PATH_32"), "CoreCLR only: Specifies the path to the DLL of profiler to load into currently running 32 process", CLRConfig::DontPrependCOMPlus_) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_64, W("CORECLR_PROFILER_PATH_64"), "CoreCLR only: Specifies the path to the DLL of profiler to load into currently running 64 process", CLRConfig::DontPrependCOMPlus_) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_ARM32, W("CORECLR_PROFILER_PATH_ARM32"), "CoreCLR only: Specifies the path to the DLL of profiler to load into currently running ARM32 process", CLRConfig::DontPrependCOMPlus_) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_ARM64, W("CORECLR_PROFILER_PATH_ARM64"), "CoreCLR only: Specifies the path to the DLL of profiler to load into currently running ARM64 process", CLRConfig::DontPrependCOMPlus_) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_ProfAPI_ProfilerCompatibilitySetting, W("ProfAPI_ProfilerCompatibilitySetting"), "Specifies the profiler loading policy (the default is not to load a V2 profiler in V4)", CLRConfig::EEConfig_default | CLRConfig::TrimWhiteSpaceFromStringValue) +RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_COR_ENABLE_PROFILING, W("COR_ENABLE_PROFILING"), 0, "Flag to indicate whether profiling should be enabled for the currently running process.", CLRConfig::LookupOptions::DontPrependCOMPlus_) +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_COR_PROFILER, W("COR_PROFILER"), "Specifies GUID of profiler to load into currently running process", CLRConfig::LookupOptions::DontPrependCOMPlus_) +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_COR_PROFILER_PATH, W("COR_PROFILER_PATH"), "Specifies the path to the DLL of profiler to load into currently running process", CLRConfig::LookupOptions::DontPrependCOMPlus_) +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_COR_PROFILER_PATH_32, W("COR_PROFILER_PATH_32"), "Specifies the path to the DLL of profiler to load into currently running 32 bits process", CLRConfig::LookupOptions::DontPrependCOMPlus_) +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_COR_PROFILER_PATH_64, W("COR_PROFILER_PATH_64"), "Specifies the path to the DLL of profiler to load into currently running 64 bits process", CLRConfig::LookupOptions::DontPrependCOMPlus_) +RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_CORECLR_ENABLE_PROFILING, W("CORECLR_ENABLE_PROFILING"), 0, "CoreCLR only: Flag to indicate whether profiling should be enabled for the currently running process.", CLRConfig::LookupOptions::DontPrependCOMPlus_) +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER, W("CORECLR_PROFILER"), "CoreCLR only: Specifies GUID of profiler to load into currently running process", CLRConfig::LookupOptions::DontPrependCOMPlus_) +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH, W("CORECLR_PROFILER_PATH"), "CoreCLR only: Specifies the path to the DLL of profiler to load into currently running process", CLRConfig::LookupOptions::DontPrependCOMPlus_) +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_32, W("CORECLR_PROFILER_PATH_32"), "CoreCLR only: Specifies the path to the DLL of profiler to load into currently running 32 process", CLRConfig::LookupOptions::DontPrependCOMPlus_) +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_64, W("CORECLR_PROFILER_PATH_64"), "CoreCLR only: Specifies the path to the DLL of profiler to load into currently running 64 process", CLRConfig::LookupOptions::DontPrependCOMPlus_) +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_ARM32, W("CORECLR_PROFILER_PATH_ARM32"), "CoreCLR only: Specifies the path to the DLL of profiler to load into currently running ARM32 process", CLRConfig::LookupOptions::DontPrependCOMPlus_) +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_ARM64, W("CORECLR_PROFILER_PATH_ARM64"), "CoreCLR only: Specifies the path to the DLL of profiler to load into currently running ARM64 process", CLRConfig::LookupOptions::DontPrependCOMPlus_) +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_ProfAPI_ProfilerCompatibilitySetting, W("ProfAPI_ProfilerCompatibilitySetting"), "Specifies the profiler loading policy (the default is not to load a V2 profiler in V4)", CLRConfig::LookupOptions::TrimWhiteSpaceFromStringValue) RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ProfAPI_DetachMinSleepMs, W("ProfAPI_DetachMinSleepMs"), 0, "The minimum time, in milliseconds, the CLR will wait before checking whether a profiler that is in the process of detaching is ready to be unloaded.") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ProfAPI_DetachMaxSleepMs, W("ProfAPI_DetachMaxSleepMs"), 0, "The maximum time, in milliseconds, the CLR will wait before checking whether a profiler that is in the process of detaching is ready to be unloaded.") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ProfAPI_RejitOnAttach, W("ProfApi_RejitOnAttach"), 1, "Enables the ability for profilers to rejit methods on attach.") @@ -527,13 +519,13 @@ CONFIG_DWORD_INFO(INTERNAL_TestOnlyEnableICorProfilerInfo, W("ProfAPI_TestOnlyEn CONFIG_DWORD_INFO(INTERNAL_TestOnlyEnableObjectAllocatedHook, W("TestOnlyEnableObjectAllocatedHook"), 0, "Test-only flag that forces CLR to initialize on startup as if ObjectAllocated callback were requested, to enable post-attach ObjectAllocated functionality.") CONFIG_DWORD_INFO(INTERNAL_TestOnlyEnableSlowELTHooks, W("TestOnlyEnableSlowELTHooks"), 0, "Test-only flag that forces CLR to initialize on startup as if slow-ELT were requested, to enable post-attach ELT functionality.") -RETAIL_CONFIG_STRING_INFO_EX(UNSUPPORTED_ETW_ObjectAllocationEventsPerTypePerSec, W("ETW_ObjectAllocationEventsPerTypePerSec"), "Desired number of GCSampledObjectAllocation ETW events to be logged per type per second. If 0, then the default built in to the implementation for the enabled event (e.g., High, Low), will be used.", CLRConfig::EEConfig_default) +RETAIL_CONFIG_STRING_INFO(UNSUPPORTED_ETW_ObjectAllocationEventsPerTypePerSec, W("ETW_ObjectAllocationEventsPerTypePerSec"), "Desired number of GCSampledObjectAllocation ETW events to be logged per type per second. If 0, then the default built in to the implementation for the enabled event (e.g., High, Low), will be used.") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_ProfAPI_ValidateNGENInstrumentation, W("ProfAPI_ValidateNGENInstrumentation"), 0, "This flag enables additional validations when using the IMetaDataEmit APIs for NGEN'ed images to ensure only supported edits are made.") #ifdef FEATURE_PERFMAP -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_PerfMapEnabled, W("PerfMapEnabled"), 0, "This flag is used on Linux to enable writing /tmp/perf-$pid.map. It is disabled by default", CLRConfig::EEConfig_default) -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_PerfMapJitDumpPath, W("PerfMapJitDumpPath"), "Specifies a path to write the perf jitdump file. Defaults to GetTempPathA()", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_PerfMapIgnoreSignal, W("PerfMapIgnoreSignal"), 0, "When perf map is enabled, this option will configure the specified signal to be accepted and ignored as a marker in the perf logs. It is disabled by default", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_PerfMapEnabled, W("PerfMapEnabled"), 0, "This flag is used on Linux to enable writing /tmp/perf-$pid.map. It is disabled by default") +RETAIL_CONFIG_STRING_INFO(EXTERNAL_PerfMapJitDumpPath, W("PerfMapJitDumpPath"), "Specifies a path to write the perf jitdump file. Defaults to GetTempPathA()") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_PerfMapIgnoreSignal, W("PerfMapIgnoreSignal"), 0, "When perf map is enabled, this option will configure the specified signal to be accepted and ignored as a marker in the perf logs. It is disabled by default") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_PerfMapShowOptimizationTiers, W("PerfMapShowOptimizationTiers"), 1, "Shows optimization tiers in the perf map for methods, as part of the symbol name. Useful for seeing separate stack frames for different optimization tiers of each method.") RETAIL_CONFIG_STRING_INFO(EXTERNAL_NativeImagePerfMapFormat, W("NativeImagePerfMapFormat"), "Specifies the format of native image perfmap files generated by crossgen. Valid options are RVA or OFFSET.") #endif @@ -543,12 +535,12 @@ RETAIL_CONFIG_STRING_INFO(EXTERNAL_StartupDelayMS, W("StartupDelayMS"), "") /// /// Stress /// -CONFIG_DWORD_INFO_EX(INTERNAL_StressCOMCall, W("StressCOMCall"), 0, "", CLRConfig::EEConfig_default) RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StressLog, W("StressLog"), 0, "Turns on the stress log.") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_ForceEnc, W("ForceEnc"), 0, "Forces Edit and Continue to be on for all eligible modules.") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StressLogSize, W("StressLogSize"), 0, "Stress log size in bytes per thread.") RETAIL_CONFIG_STRING_INFO(UNSUPPORTED_StressLogFilename, W("StressLogFilename"), "Stress log filename for memory mapped stress log.") -CONFIG_DWORD_INFO_EX(INTERNAL_stressSynchronized, W("stressSynchronized"), 0, "Unknown if or where this is used; unless a test is specifically depending on this, it can be removed.", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_stressSynchronized, W("stressSynchronized"), 0, "Unknown if or where this is used; unless a test is specifically depending on this, it can be removed.") +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TotalStressLogSize, W("TotalStressLogSize"), 0, "Total stress log size in bytes.") /// /// Thread Suspend @@ -633,7 +625,7 @@ CONFIG_DWORD_INFO(INTERNAL_OSR_HighId, W("OSR_HighId"), 10000000, "High end of e /// Profile Guided Opts /// #ifdef FEATURE_PGO -RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_PGODataPath, W("PGODataPath"), "Read/Write PGO data from/to the indicated file.", CLRConfig::EEConfig_default) +RETAIL_CONFIG_STRING_INFO(INTERNAL_PGODataPath, W("PGODataPath"), "Read/Write PGO data from/to the indicated file.") RETAIL_CONFIG_DWORD_INFO(INTERNAL_ReadPGOData, W("ReadPGOData"), 0, "Read PGO data") RETAIL_CONFIG_DWORD_INFO(INTERNAL_WritePGOData, W("WritePGOData"), 0, "Write PGO data") RETAIL_CONFIG_DWORD_INFO(INTERNAL_TieredPGO, W("TieredPGO"), 0, "Instrument Tier0 code and make counts available to Tier1") @@ -654,14 +646,14 @@ CONFIG_DWORD_INFO(INTERNAL_TypeLoader_InjectInterfaceDuplicates, W("INTERNAL_Typ /// /// Virtual call stubs /// -CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubCollideMonoPct, W("VirtualCallStubCollideMonoPct"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubCollideWritePct, W("VirtualCallStubCollideWritePct"), 100, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubDumpLogCounter, W("VirtualCallStubDumpLogCounter"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubDumpLogIncr, W("VirtualCallStubDumpLogIncr"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_VirtualCallStubLogging, W("VirtualCallStubLogging"), 0, "Worth keeping, but should be moved into \"#ifdef STUB_LOGGING\" blocks. This goes for most (or all) of the stub logging infrastructure.", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubMissCount, W("VirtualCallStubMissCount"), 100, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubResetCacheCounter, W("VirtualCallStubResetCacheCounter"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_VirtualCallStubResetCacheIncr, W("VirtualCallStubResetCacheIncr"), 0, "Used only when STUB_LOGGING is defined, which by default is not.", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_VirtualCallStubCollideMonoPct, W("VirtualCallStubCollideMonoPct"), 0, "Used only when STUB_LOGGING is defined, which by default is not.") +CONFIG_DWORD_INFO(INTERNAL_VirtualCallStubCollideWritePct, W("VirtualCallStubCollideWritePct"), 100, "Used only when STUB_LOGGING is defined, which by default is not.") +CONFIG_DWORD_INFO(INTERNAL_VirtualCallStubDumpLogCounter, W("VirtualCallStubDumpLogCounter"), 0, "Used only when STUB_LOGGING is defined, which by default is not.") +CONFIG_DWORD_INFO(INTERNAL_VirtualCallStubDumpLogIncr, W("VirtualCallStubDumpLogIncr"), 0, "Used only when STUB_LOGGING is defined, which by default is not.") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_VirtualCallStubLogging, W("VirtualCallStubLogging"), 0, "Worth keeping, but should be moved into \"#ifdef STUB_LOGGING\" blocks. This goes for most (or all) of the stub logging infrastructure.") +CONFIG_DWORD_INFO(INTERNAL_VirtualCallStubMissCount, W("VirtualCallStubMissCount"), 100, "Used only when STUB_LOGGING is defined, which by default is not.") +CONFIG_DWORD_INFO(INTERNAL_VirtualCallStubResetCacheCounter, W("VirtualCallStubResetCacheCounter"), 0, "Used only when STUB_LOGGING is defined, which by default is not.") +CONFIG_DWORD_INFO(INTERNAL_VirtualCallStubResetCacheIncr, W("VirtualCallStubResetCacheIncr"), 0, "Used only when STUB_LOGGING is defined, which by default is not.") /// /// Watson @@ -679,15 +671,15 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_CreateDumpDiagnostics, W("CreateDumpDiagnostic /// /// Zap /// -RETAIL_CONFIG_STRING_INFO_EX(INTERNAL_ZapBBInstr, W("ZapBBInstr"), "", CLRConfig::EEConfig_default) +RETAIL_CONFIG_STRING_INFO(INTERNAL_ZapBBInstr, W("ZapBBInstr"), "") RETAIL_CONFIG_STRING_INFO(EXTERNAL_ZapBBInstrDir, W("ZapBBInstrDir"), "") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ZapDisable, W("ZapDisable"), 0, "") -CONFIG_STRING_INFO_EX(INTERNAL_ZapExclude, W("ZapExclude"), "", CLRConfig::EEConfig_default) -CONFIG_STRING_INFO_EX(INTERNAL_ZapOnly, W("ZapOnly"), "", CLRConfig::EEConfig_default) +CONFIG_STRING_INFO(INTERNAL_ZapExclude, W("ZapExclude"), "") +CONFIG_STRING_INFO(INTERNAL_ZapOnly, W("ZapOnly"), "") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ZapRequire, W("ZapRequire"), 0, "") RETAIL_CONFIG_STRING_INFO(EXTERNAL_ZapRequireExcludeList, W("ZapRequireExcludeList"), "") RETAIL_CONFIG_STRING_INFO(EXTERNAL_ZapRequireList, W("ZapRequireList"), "") -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_ZapSet, W("ZapSet"), "", CLRConfig::EEConfig_default) +RETAIL_CONFIG_STRING_INFO(EXTERNAL_ZapSet, W("ZapSet"), "") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ReadyToRun, W("ReadyToRun"), 1, "Enable/disable use of ReadyToRun native code") // On by default for CoreCLR RETAIL_CONFIG_STRING_INFO(EXTERNAL_ReadyToRunExcludeList, W("ReadyToRunExcludeList"), "List of assemblies that cannot use Ready to Run images") @@ -707,7 +699,6 @@ RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_InteropValidatePinnedObjects, W("InteropVal RETAIL_CONFIG_DWORD_INFO(EXTERNAL_InteropLogArguments, W("InteropLogArguments"), 0, "Log all pinned arguments passed to an interop call") RETAIL_CONFIG_STRING_INFO(UNSUPPORTED_LogCCWRefCountChange, W("LogCCWRefCountChange"), "Outputs debug information and calls LogCCWRefCountChange_BREAKPOINT when AddRef or Release is called on a CCW.") RETAIL_CONFIG_DWORD_INFO(INTERNAL_EnableRCWCleanupOnSTAShutdown, W("EnableRCWCleanupOnSTAShutdown"), 0, "Performs RCW cleanup when STA shutdown is detected using IInitializeSpy in classic processes.") -RETAIL_CONFIG_DWORD_INFO(EXTERNAL_AllowDComReflection, W("AllowDComReflection"), 0, "Allows out of process DCOM clients to marshal blocked reflection types.") // // EventPipe @@ -731,14 +722,14 @@ RETAIL_CONFIG_STRING_INFO(INTERNAL_GCGenAnalysisCmd, W("GCGenAnalysisCmd"), "An // // Diagnostics Ports // -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DOTNET_DefaultDiagnosticPortSuspend, W("DOTNET_DefaultDiagnosticPortSuspend"), 0, "This sets the deafult diagnostic port to suspend causing the runtime to pause during startup before major subsystems are started. Resume using the Diagnostics IPC ResumeStartup command on the default diagnostic port.", CLRConfig::DontPrependCOMPlus_); -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_DOTNET_DiagnosticPorts, W("DOTNET_DiagnosticPorts"), "A semicolon delimited list of additional Diagnostic Ports, where a Diagnostic Port is a NamedPipe path without '\\\\.\\pipe\\' on Windows or the full path of Unix Domain Socket on Linux/Unix followed by optional tags, e.g., ',connect,nosuspend;'", CLRConfig::DontPrependCOMPlus_); +RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DOTNET_DefaultDiagnosticPortSuspend, W("DOTNET_DefaultDiagnosticPortSuspend"), 0, "This sets the deafult diagnostic port to suspend causing the runtime to pause during startup before major subsystems are started. Resume using the Diagnostics IPC ResumeStartup command on the default diagnostic port.", CLRConfig::LookupOptions::DontPrependCOMPlus_); +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_DOTNET_DiagnosticPorts, W("DOTNET_DiagnosticPorts"), "A semicolon delimited list of additional Diagnostic Ports, where a Diagnostic Port is a NamedPipe path without '\\\\.\\pipe\\' on Windows or the full path of Unix Domain Socket on Linux/Unix followed by optional tags, e.g., ',connect,nosuspend;'", CLRConfig::LookupOptions::DontPrependCOMPlus_); // // LTTng // RETAIL_CONFIG_STRING_INFO(INTERNAL_LTTngConfig, W("LTTngConfig"), "Configuration for LTTng.") -RETAIL_CONFIG_DWORD_INFO(UNSUPORTED_LTTng, W("LTTng"), 1, "If COMPlus_LTTng is set to 0, this will prevent the LTTng library from being loaded at runtime") +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_LTTng, W("LTTng"), 1, "If COMPlus_LTTng is set to 0, this will prevent the LTTng library from being loaded at runtime") #ifdef FEATURE_GDBJIT @@ -763,32 +754,32 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_GDBJitEmitDebugFrame, W("GDBJitEmitDebugFrame" // // DO NOT ADD ANY MORE CONFIG SWITCHES TO THIS SECTION! // ** -CONFIG_DWORD_INFO_EX(INTERNAL_ActivatePatchSkip, W("ActivatePatchSkip"), 0, "Allows an assert when ActivatePatchSkip is called", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_ActivatePatchSkip, W("ActivatePatchSkip"), 0, "Allows an assert when ActivatePatchSkip is called") CONFIG_DWORD_INFO(INTERNAL_AlwaysUseMetadataInterfaceMapLayout, W("AlwaysUseMetadataInterfaceMapLayout"), 0, "Used for debugging generic interface map layout.") CONFIG_DWORD_INFO(INTERNAL_AssertOnUnneededThis, W("AssertOnUnneededThis"), 0, "While the ConfigDWORD is unnecessary, the contained ASSERT should be kept. This may result in some work tracking down violating MethodDescCallSites.") -CONFIG_DWORD_INFO_EX(INTERNAL_AssertStacktrace, W("AssertStacktrace"), 1, "", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_clearNativeImageStress, W("clearNativeImageStress"), 0, "", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_AssertStacktrace, W("AssertStacktrace"), 1, "") +CONFIG_DWORD_INFO(INTERNAL_clearNativeImageStress, W("clearNativeImageStress"), 0, "") CONFIG_DWORD_INFO(INTERNAL_CPUFamily, W("CPUFamily"), 0xFFFFFFFF, "") CONFIG_DWORD_INFO(INTERNAL_CPUFeatures, W("CPUFeatures"), 0xFFFFFFFF, "") -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DisableConfigCache, W("DisableConfigCache"), 0, "Used to disable the \"probabilistic\" config cache, which walks through the appropriate config registry keys on init and probabilistically keeps track of which exist.", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_DisableConfigCache, W("DisableConfigCache"), 0, "Used to disable the \"probabilistic\" config cache, which walks through the appropriate config registry keys on init and probabilistically keeps track of which exist.") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_DisableStackwalkCache, W("DisableStackwalkCache"), 0, "") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DoubleArrayToLargeObjectHeap, W("DoubleArrayToLargeObjectHeap"), 0, "Controls double[] placement") CONFIG_STRING_INFO(INTERNAL_DumpOnClassLoad, W("DumpOnClassLoad"), "Dumps information about loaded class to log.") CONFIG_DWORD_INFO(INTERNAL_ExpandAllOnLoad, W("ExpandAllOnLoad"), 0, "") -CONFIG_DWORD_INFO_EX(INTERNAL_ForceRelocs, W("ForceRelocs"), 0, "", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_ForceRelocs, W("ForceRelocs"), 0, "") CONFIG_DWORD_INFO(INTERNAL_GenerateLongJumpDispatchStubRatio, W("GenerateLongJumpDispatchStubRatio"), 0, "Useful for testing VSD on AMD64") -CONFIG_DWORD_INFO_EX(INTERNAL_HashStack, W("HashStack"), 0, "", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_HashStack, W("HashStack"), 0, "") CONFIG_DWORD_INFO(INTERNAL_HostManagerConfig, W("HostManagerConfig"), (DWORD)-1, "") CONFIG_DWORD_INFO(INTERNAL_HostTestThreadAbort, W("HostTestThreadAbort"), 0, "") CONFIG_STRING_INFO(INTERNAL_InvokeHalt, W("InvokeHalt"), "Throws an assert when the given method is invoked through reflection.") CONFIG_DWORD_INFO(INTERNAL_MaxStubUnwindInfoSegmentSize, W("MaxStubUnwindInfoSegmentSize"), 0, "") CONFIG_DWORD_INFO(INTERNAL_MessageDebugOut, W("MessageDebugOut"), 0, "") -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_NativeImageRequire, W("NativeImageRequire"), 0, "", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_NestedEhOom, W("NestedEhOom"), 0, "", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_NativeImageRequire, W("NativeImageRequire"), 0, "") +CONFIG_DWORD_INFO(INTERNAL_NestedEhOom, W("NestedEhOom"), 0, "") #define INTERNAL_NoGuiOnAssert_Default 1 -RETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_NoGuiOnAssert, W("NoGuiOnAssert"), INTERNAL_NoGuiOnAssert_Default, "", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_NoProcedureSplitting, W("NoProcedureSplitting"), 0, "", CLRConfig::EEConfig_default) -CONFIG_DWORD_INFO_EX(INTERNAL_NoStringInterning, W("NoStringInterning"), 1, "Disallows string interning. I see no value in it anymore.", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(INTERNAL_NoGuiOnAssert, W("NoGuiOnAssert"), INTERNAL_NoGuiOnAssert_Default, "") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_NoProcedureSplitting, W("NoProcedureSplitting"), 0, "") +CONFIG_DWORD_INFO(INTERNAL_NoStringInterning, W("NoStringInterning"), 1, "Disallows string interning. I see no value in it anymore.") CONFIG_DWORD_INFO(INTERNAL_PauseOnLoad, W("PauseOnLoad"), 0, "Stops in SystemDomain::init. I think it can be removed.") CONFIG_DWORD_INFO(INTERNAL_PerfAllocsSizeThreshold, W("PerfAllocsSizeThreshold"), 0x3FFFFFFF, "Log facility LF_GCALLOC logs object allocations. This flag controls which ones also log stacktraces. Predates ClrProfiler.") CONFIG_DWORD_INFO(INTERNAL_PerfNumAllocsThreshold, W("PerfNumAllocsThreshold"), 0x3FFFFFFF, "Log facility LF_GCALLOC logs object allocations. This flag controls which ones also log stacktraces. Predates ClrProfiler.") @@ -797,18 +788,16 @@ RETAIL_CONFIG_DWORD_INFO(EXTERNAL_Prepopulate1, W("Prepopulate1"), 1, "") CONFIG_STRING_INFO(INTERNAL_PrestubGC, W("PrestubGC"), "") CONFIG_STRING_INFO(INTERNAL_PrestubHalt, W("PrestubHalt"), "") RETAIL_CONFIG_STRING_INFO(EXTERNAL_RestrictedGCStressExe, W("RestrictedGCStressExe"), "") -CONFIG_DWORD_INFO_EX(INTERNAL_ReturnSourceTypeForTesting, W("ReturnSourceTypeForTesting"), 0, "Allows returning the (internal only) source type of an IL to Native mapping for debugging purposes", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_RSStressLog, W("RSStressLog"), 0, "Allows turning on logging for RS startup", CLRConfig::EEConfig_default) +CONFIG_DWORD_INFO(INTERNAL_ReturnSourceTypeForTesting, W("ReturnSourceTypeForTesting"), 0, "Allows returning the (internal only) source type of an IL to Native mapping for debugging purposes") +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_RSStressLog, W("RSStressLog"), 0, "Allows turning on logging for RS startup") CONFIG_DWORD_INFO(INTERNAL_SBDumpOnNewIndex, W("SBDumpOnNewIndex"), 0, "Used for Syncblock debugging. It's been a while since any of those have been used.") CONFIG_DWORD_INFO(INTERNAL_SBDumpOnResize, W("SBDumpOnResize"), 0, "Used for Syncblock debugging. It's been a while since any of those have been used.") CONFIG_DWORD_INFO(INTERNAL_SBDumpStyle, W("SBDumpStyle"), 0, "Used for Syncblock debugging. It's been a while since any of those have been used.") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_SleepOnExit, W("SleepOnExit"), 0, "Used for lrak detection. I'd say deprecated by umdh.") CONFIG_DWORD_INFO(INTERNAL_StubLinkerUnwindInfoVerificationOn, W("StubLinkerUnwindInfoVerificationOn"), 0, "") -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_SuccessExit, W("SuccessExit"), 0, "", CLRConfig::EEConfig_default) +RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_SuccessExit, W("SuccessExit"), 0, "") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TestDataConsistency, W("TestDataConsistency"), FALSE, "Allows ensuring the left side is not holding locks (and may thus be in an inconsistent state) when inspection occurs") -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_ThreadGuardPages, W("ThreadGuardPages"), 0, "", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_Timeline, W("Timeline"), 0, "", CLRConfig::EEConfig_default) -RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TotalStressLogSize, W("TotalStressLogSize"), 0, "Total stress log size in bytes.") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_ThreadGuardPages, W("ThreadGuardPages"), 0, "") #ifdef _DEBUG RETAIL_CONFIG_DWORD_INFO(EXTERNAL_TraceWrap, W("TraceWrap"), 0, "") diff --git a/src/coreclr/inc/utilcode.h b/src/coreclr/inc/utilcode.h index d2aea0041f7be..366312e376958 100644 --- a/src/coreclr/inc/utilcode.h +++ b/src/coreclr/inc/utilcode.h @@ -1010,134 +1010,6 @@ void SplitPath(__in SString const &path, __inout_opt SString *fname, __inout_opt SString *ext); -#if !defined(NO_CLRCONFIG) - -//***************************************************************************** -// -// **** REGUTIL - Static helper functions for reading/writing to Windows registry. -// -//***************************************************************************** - - -class REGUTIL -{ -public: -//***************************************************************************** - - enum CORConfigLevel - { - COR_CONFIG_ENV = 0x01, - COR_CONFIG_USER = 0x02, - COR_CONFIG_MACHINE = 0x04, - - COR_CONFIG_REGISTRY = (COR_CONFIG_USER|COR_CONFIG_MACHINE), - COR_CONFIG_ALL = (COR_CONFIG_ENV|COR_CONFIG_USER|COR_CONFIG_MACHINE), - }; - - // - // NOTE: The following function is deprecated; use the CLRConfig class instead. - // To access a configuration value through CLRConfig, add an entry in file:../inc/CLRConfigValues.h. - // - static DWORD GetConfigDWORD_DontUse_( - LPCWSTR name, - DWORD defValue, - CORConfigLevel level = COR_CONFIG_ALL, - BOOL fPrependCOMPLUS = TRUE); - - // - // NOTE: The following function is deprecated; use the CLRConfig class instead. - // To access a configuration value through CLRConfig, add an entry in file:../inc/CLRConfigValues.h. - // - static HRESULT GetConfigDWORD_DontUse_( - LPCWSTR name, - DWORD defValue, - __out DWORD * result, - CORConfigLevel level = COR_CONFIG_ALL, - BOOL fPrependCOMPLUS = TRUE); - - static ULONGLONG GetConfigULONGLONG_DontUse_( - LPCWSTR name, - ULONGLONG defValue, - CORConfigLevel level = COR_CONFIG_ALL, - BOOL fPrependCOMPLUS = TRUE); - - // - // NOTE: The following function is deprecated; use the CLRConfig class instead. - // To access a configuration value through CLRConfig, add an entry in file:../inc/CLRConfigValues.h. - // - static DWORD GetConfigFlag_DontUse_( - LPCWSTR name, - DWORD bitToSet, - BOOL defValue = FALSE); - - // - // NOTE: The following function is deprecated; use the CLRConfig class instead. - // To access a configuration value through CLRConfig, add an entry in file:../inc/CLRConfigValues.h. - // - static LPWSTR GetConfigString_DontUse_( - LPCWSTR name, - BOOL fPrependCOMPLUS = TRUE, - CORConfigLevel level = COR_CONFIG_ALL, - BOOL fUsePerfCache = TRUE); - - static void FreeConfigString(__in __in_z LPWSTR name); - -private: - static LPWSTR EnvGetString(LPCWSTR name, BOOL fPrependCOMPLUS); - -private: -//***************************************************************************** -// Get either a DWORD or ULONGLONG. Always puts the result in a ULONGLONG that -// you can safely cast to a DWORD if fGetDWORD is TRUE. -//***************************************************************************** - static HRESULT GetConfigInteger( - LPCWSTR name, - ULONGLONG defValue, - __out ULONGLONG * result, - BOOL fGetDWORD = TRUE, - CORConfigLevel level = COR_CONFIG_ALL, - BOOL fPrependCOMPLUS = TRUE); -public: - - -//***************************************************************************** -// (Optional) Initialize the config registry cache -// (see ConfigCacheValueNameSeenPerhaps, below.) -//***************************************************************************** - static void InitOptionalConfigCache(); - -private: - - -//***************************************************************************** -// Return TRUE if the registry value name might have been seen in the registry -// at startup; -// return FALSE if the value was definitely not seen at startup. -// -// Perf Optimization for VSWhidbey:113373. -//***************************************************************************** - static BOOL RegCacheValueNameSeenPerhaps( - LPCWSTR name); -//***************************************************************************** -// Return TRUE if the environment variable name might have been seen at startup; -// return FALSE if the value was definitely not seen at startup. -//***************************************************************************** - static BOOL EnvCacheValueNameSeenPerhaps( - LPCWSTR name); - - static BOOL s_fUseRegCache; // Enable registry cache; if FALSE, CCVNSP - // always returns TRUE. - static BOOL s_fUseEnvCache; // Enable env cache. - - // Open the .NetFramework keys once and cache the handles - static HKEY s_hMachineFrameworkKey; - static HKEY s_hUserFrameworkKey; -}; - -#include "clrconfig.h" - -#endif // defined(NO_CLRCONFIG) - #include "ostype.h" #define CLRGetTickCount64() GetTickCount64() @@ -3743,8 +3615,10 @@ class MethodNamesList : public MethodNamesListBase #if !defined(NO_CLRCONFIG) +#include "clrconfig.h" + /**************************************************************************/ -/* simple wrappers around the REGUTIL and MethodNameList routines that make +/* simple wrappers around the CLRConfig and MethodNameList routines that make the lookup lazy */ /* to be used as static variable - no constructor/destructor, assumes zero diff --git a/src/coreclr/md/debug_metadata.h b/src/coreclr/md/debug_metadata.h index 7e18e4affc0fd..6dfb79931490d 100644 --- a/src/coreclr/md/debug_metadata.h +++ b/src/coreclr/md/debug_metadata.h @@ -33,7 +33,7 @@ #pragma once -// Include for REGUTIL class used in Debug_ReportError +// Include for CLRConfig class used in Debug_ReportError #include // -------------------------------------------------------------------------------------- diff --git a/src/coreclr/utilcode/CMakeLists.txt b/src/coreclr/utilcode/CMakeLists.txt index c7c5861f129b4..0f9606d93535a 100644 --- a/src/coreclr/utilcode/CMakeLists.txt +++ b/src/coreclr/utilcode/CMakeLists.txt @@ -36,7 +36,6 @@ set(UTILCODE_COMMON_SOURCES corimage.cpp format1.cpp prettyprintsig.cpp - regutil.cpp sha1.cpp sigbuilder.cpp sigparser.cpp diff --git a/src/coreclr/utilcode/clrconfig.cpp b/src/coreclr/utilcode/clrconfig.cpp index 6c0f6eca65477..01dd0412e68cb 100644 --- a/src/coreclr/utilcode/clrconfig.cpp +++ b/src/coreclr/utilcode/clrconfig.cpp @@ -4,18 +4,333 @@ // CLRConfig.cpp // -// -// Unified method of accessing configuration values from environment variables, -// registry and config file. See file:../inc/CLRConfigValues.h for details on how to add config values. -// -//***************************************************************************** - #include "stdafx.h" #include "clrconfig.h" +#include "sstring.h" +#include "ex.h" + +// Config prefixes +#define COMPLUS_PREFIX W("COMPlus_") +#define LEN_OF_COMPLUS_PREFIX 8 + +using ConfigDWORDInfo = CLRConfig::ConfigDWORDInfo; +using ConfigStringInfo = CLRConfig::ConfigStringInfo; +using LookupOptions = CLRConfig::LookupOptions; + +namespace +{ + // + // ProbabilisticNameSet: + // + // (Used by ConfigCache, below. If used elsewhere, might justify + // promotion to a standalone header file.) + // + // Represent a set of names in a small, fixed amount of storage. + // We turn a name into a small integer, then add the integer to a bitvector. + // An old trick we used in VC++4 minimal rebuild. + // + // For best results, the number of elements should be a fraction of + // the total number of bits in 'bits'. + // + // Note, only the const methods are thread-safe. + // Callers are responsible for providing their own synchronization when + // constructing and Add'ing names to the set. + // + class ProbabilisticNameSet { + public: + ProbabilisticNameSet() + { + WRAPPER_NO_CONTRACT; + + memset(bits, 0, sizeof(bits)); + } + + // Add a name to the set. + // + void Add(LPCWSTR name) + { + WRAPPER_NO_CONTRACT; + + unsigned i, mask; + GetBitIndex(name, 0, &i, &mask); + bits[i] |= mask; + } + + void Add(LPCWSTR name, DWORD count) + { + WRAPPER_NO_CONTRACT; + + unsigned i, mask; + GetBitIndex(name, count, &i, &mask); + bits[i] |= mask; + } + + // Return TRUE if a name *may have* been added to the set; + // return FALSE if the name *definitely* was NOT ever added to the set. + // + BOOL MayContain(LPCWSTR name) const + { + WRAPPER_NO_CONTRACT; + + unsigned i, mask; + GetBitIndex(name, 0, &i, &mask); + return !!(bits[i] & mask); + } + + private: + static const unsigned cbitSet = 256U; + static const unsigned cbitWord = 8U*sizeof(unsigned); + unsigned bits[cbitSet/cbitWord]; + + // Return the word index and bit mask corresponding to the bitvector member + // addressed by the *case-insensitive* hash of the given name. + // + void GetBitIndex(LPCWSTR name, DWORD count, unsigned* pi, unsigned* pmask) const + { + LIMITED_METHOD_CONTRACT; + unsigned hash; + if (count > 0) + hash = HashiStringNKnownLower80(name, count) % cbitSet; + else + hash = HashiStringKnownLower80(name) % cbitSet; + *pi = hash / cbitWord; + *pmask = (1U << (hash % cbitWord)); + } + }; + + BOOL s_fUseEnvCache = FALSE; + ProbabilisticNameSet s_EnvNames; // set of environment value names seen + + BOOL EnvCacheValueNameSeenPerhaps(LPCWSTR name) + { + WRAPPER_NO_CONTRACT; + + return !s_fUseEnvCache + || s_EnvNames.MayContain(name); + } + + //***************************************************************************** + // Reads from the environment setting + //***************************************************************************** + LPWSTR EnvGetString(LPCWSTR name, bool fPrependCOMPLUS) + { + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + FORBID_FAULT; + CANNOT_TAKE_LOCK; + } + CONTRACTL_END; + + WCHAR buff[64]; + + if(wcslen(name) > (size_t)(64 - 1 - (fPrependCOMPLUS ? LEN_OF_COMPLUS_PREFIX : 0))) + { + return NULL; + } + + if (fPrependCOMPLUS) + { + if (!EnvCacheValueNameSeenPerhaps(name)) + return NULL; + + wcscpy_s(buff, _countof(buff), COMPLUS_PREFIX); + } + else + { + *buff = 0; + } + + wcscat_s(buff, _countof(buff), name); + + FAULT_NOT_FATAL(); // We don't report OOM errors here, we return a default value. + + NewArrayHolder ret = NULL; + HRESULT hr = S_OK; + DWORD Len; + EX_TRY + { + PathString temp; + + Len = WszGetEnvironmentVariable(buff, temp); + if (Len != 0) + { + ret = temp.GetCopyOfUnicodeString(); + } + + } + EX_CATCH_HRESULT(hr); + + if (hr != S_OK) + { + SetLastError(hr); + } + + if(ret != NULL) + return ret.Extract(); + + return NULL; + } + + HRESULT GetConfigDWORD( + LPCWSTR name, + DWORD defValue, + __out DWORD *result, + bool fPrependCOMPLUS) + { + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + FORBID_FAULT; + CANNOT_TAKE_LOCK; + } + CONTRACTL_END; + + SUPPORTS_DAC_HOST_ONLY; + + FAULT_NOT_FATAL(); // We don't report OOM errors here, we return a default value. + + NewArrayHolder val = EnvGetString(name, fPrependCOMPLUS); + if (val != NULL) + { + errno = 0; + LPWSTR endPtr; + DWORD configMaybe = wcstoul(val, &endPtr, 16); // treat it has hex + BOOL fSuccess = ((errno != ERANGE) && (endPtr != val)); + if (fSuccess) + { + *result = configMaybe; + return (S_OK); + } + } + + *result = defValue; + return (E_FAIL); + } + + LPWSTR GetConfigString( + LPCWSTR name, + bool fPrependCOMPLUS) + { + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + FORBID_FAULT; + } + CONTRACTL_END; + + NewArrayHolder ret(NULL); + + FAULT_NOT_FATAL(); // We don't report OOM errors here, we return a default value. + + ret = EnvGetString(name, fPrependCOMPLUS); + if (ret != NULL) + { + if (*ret != W('\0')) + { + ret.SuppressRelease(); + return(ret); + } + ret.Clear(); + } + + return NULL; + } + + bool CheckLookupOption(const ConfigDWORDInfo & info, LookupOptions option) + { + LIMITED_METHOD_CONTRACT; + return ((info.options & option) == option); + } + + bool CheckLookupOption(const ConfigStringInfo & info, LookupOptions option) + { + LIMITED_METHOD_CONTRACT; + return ((info.options & option) == option); + } -#ifndef ERANGE -#define ERANGE 34 -#endif + bool CheckLookupOption(LookupOptions infoOptions, LookupOptions optionToCheck) + { + LIMITED_METHOD_CONTRACT; + return ((infoOptions & optionToCheck) == optionToCheck); + } + + //--------------------------------------------------------------------------------------- + // + // Given an input string, returns a newly-allocated string equal to the input but with + // leading and trailing whitespace trimmed off. If input is already trimmed, or if + // trimming would result in an empty string, this function sets the output string to NULL + // + // Caller must free *pwszTrimmed if non-NULL + // + // Arguments: + // * wszOrig - String to trim + // * pwszTrimmed - [out]: On return, points to newly allocated, trimmed string (or + // NULL) + // + // Return Value: + // HRESULT indicating success or failure. + // + HRESULT TrimWhiteSpace(LPCWSTR wszOrig, __deref_out_z LPWSTR * pwszTrimmed) + { + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + } + CONTRACTL_END; + + _ASSERTE(wszOrig != NULL); + _ASSERTE(pwszTrimmed != NULL); + + // In case we return early, set [out] to NULL by default + *pwszTrimmed = NULL; + + // Get pointers into internal string that show where to do the trimming. + size_t cchOrig = wcslen(wszOrig); + if (!FitsIn(cchOrig)) + return COR_E_OVERFLOW; + DWORD cchAfterTrim = (DWORD) cchOrig; + LPCWSTR wszAfterTrim = wszOrig; + ::TrimWhiteSpace(&wszAfterTrim, &cchAfterTrim); + + // Is input string already trimmed? If so, save an allocation and just return. + if ((wszOrig == wszAfterTrim) && (cchOrig == cchAfterTrim)) + { + // Yup, just return success + return S_OK; + } + + if (cchAfterTrim == 0) + { + // After trimming, there's nothing left, so just return NULL + return S_OK; + } + + // Create a new buffer to hold a copy of the trimmed string. Caller will be + // responsible for this buffer if we return it. + NewArrayHolder wszTrimmedCopy(new (nothrow) WCHAR[cchAfterTrim + 1]); + if (wszTrimmedCopy == NULL) + { + return E_OUTOFMEMORY; + } + + errno_t err = wcsncpy_s(wszTrimmedCopy, cchAfterTrim + 1, wszAfterTrim, cchAfterTrim); + if (err != 0) + { + return E_FAIL; + } + + // Successfully made a copy of the trimmed string. Return it. Caller will be responsible for + // deleting it. + wszTrimmedCopy.SuppressRelease(); + *pwszTrimmed = wszTrimmedCopy; + return S_OK; + } +} // // Creating structs using the macro table in CLRConfigValues.h @@ -23,13 +338,13 @@ // These macros intialize ConfigDWORDInfo structs. #define RETAIL_CONFIG_DWORD_INFO(symbol, name, defaultValue, description) \ - const CLRConfig::ConfigDWORDInfo CLRConfig::symbol = {name, defaultValue, CLRConfig::EEConfig_default}; + const CLRConfig::ConfigDWORDInfo CLRConfig::symbol = {name, defaultValue, CLRConfig::LookupOptions::Default}; #define RETAIL_CONFIG_DWORD_INFO_EX(symbol, name, defaultValue, description, lookupOptions) \ const CLRConfig::ConfigDWORDInfo CLRConfig::symbol = {name, defaultValue, lookupOptions}; // These macros intialize ConfigStringInfo structs. #define RETAIL_CONFIG_STRING_INFO(symbol, name, description) \ - const CLRConfig::ConfigStringInfo CLRConfig::symbol = {name, CLRConfig::EEConfig_default}; + const CLRConfig::ConfigStringInfo CLRConfig::symbol = {name, CLRConfig::LookupOptions::Default}; #define RETAIL_CONFIG_STRING_INFO_EX(symbol, name, description, lookupOptions) \ const CLRConfig::ConfigStringInfo CLRConfig::symbol = {name, lookupOptions}; // @@ -37,11 +352,11 @@ // #ifdef _DEBUG #define CONFIG_DWORD_INFO(symbol, name, defaultValue, description) \ - const CLRConfig::ConfigDWORDInfo CLRConfig::symbol = {name, defaultValue, CLRConfig::EEConfig_default}; + const CLRConfig::ConfigDWORDInfo CLRConfig::symbol = {name, defaultValue, CLRConfig::LookupOptions::Default}; #define CONFIG_DWORD_INFO_EX(symbol, name, defaultValue, description, lookupOptions) \ const CLRConfig::ConfigDWORDInfo CLRConfig::symbol = {name, defaultValue, lookupOptions}; #define CONFIG_STRING_INFO(symbol, name, description) \ - const CLRConfig::ConfigStringInfo CLRConfig::symbol = {name, CLRConfig::EEConfig_default}; + const CLRConfig::ConfigStringInfo CLRConfig::symbol = {name, CLRConfig::LookupOptions::Default}; #define CONFIG_STRING_INFO_EX(symbol, name, description, lookupOptions) \ const CLRConfig::ConfigStringInfo CLRConfig::symbol = {name, lookupOptions}; #else @@ -63,7 +378,6 @@ #undef CONFIG_DWORD_INFO_EX #undef CONFIG_STRING_INFO_EX - // // Look up a DWORD config value. // @@ -88,14 +402,9 @@ DWORD CLRConfig::GetConfigValue(const ConfigDWORDInfo & info, /* [Out] */ bool * _ASSERTE (isDefault != nullptr); - // - // Set up REGUTIL options. - // - REGUTIL::CORConfigLevel level = GetConfigLevel(info.options); - BOOL prependCOMPlus = !CheckLookupOption(info, DontPrependCOMPlus_); - + bool prependCOMPlus = !CheckLookupOption(info, LookupOptions::DontPrependCOMPlus_); DWORD resultMaybe; - HRESULT hr = REGUTIL::GetConfigDWORD_DontUse_(info.name, info.defaultValue, &resultMaybe, level, prependCOMPlus); + HRESULT hr = GetConfigDWORD(info.name, info.defaultValue, &resultMaybe, prependCOMPlus); // Ignore the default value even if it's set explicitly. if (resultMaybe != info.defaultValue) @@ -195,16 +504,10 @@ HRESULT CLRConfig::GetConfigValue(const ConfigStringInfo & info, __deref_out_z L LPWSTR result = NULL; + bool prependCOMPlus = !CheckLookupOption(info, LookupOptions::DontPrependCOMPlus_); + result = GetConfigString(info.name, prependCOMPlus); - // - // Set up REGUTIL options. - // - REGUTIL::CORConfigLevel level = GetConfigLevel(info.options); - BOOL prependCOMPlus = !CheckLookupOption(info, DontPrependCOMPlus_); - - result = REGUTIL::GetConfigString_DontUse_(info.name, prependCOMPlus, level); - - if ((result != NULL) && CheckLookupOption(info, TrimWhiteSpaceFromStringValue)) + if ((result != NULL) && CheckLookupOption(info, LookupOptions::TrimWhiteSpaceFromStringValue)) { // If this fails, result remains untouched, so we'll just return the untrimmed // value. @@ -239,46 +542,44 @@ BOOL CLRConfig::IsConfigOptionSpecified(LPCWSTR name) } CONTRACTL_END; - // Check REGUTIL, both with and without the COMPlus_ prefix { LPWSTR result = NULL; - result = REGUTIL::GetConfigString_DontUse_(name, TRUE); + result = GetConfigString(name, true /* fPrependCOMPLUS */); if (result != NULL) { FreeConfigString(result); return TRUE; } - result = REGUTIL::GetConfigString_DontUse_(name, FALSE); + result = GetConfigString(name, false /* fPrependCOMPLUS */); if (result != NULL) { FreeConfigString(result); return TRUE; } - } return FALSE; } -//--------------------------------------------------------------------------------------- // -// Given an input string, returns a newly-allocated string equal to the input but with -// leading and trailing whitespace trimmed off. If input is already trimmed, or if -// trimming would result in an empty string, this function sets the output string to NULL -// -// Caller must free *pwszTrimmed if non-NULL +// Deallocation function for code:CLRConfig::FreeConfigString // -// Arguments: -// * wszOrig - String to trim -// * pwszTrimmed - [out]: On return, points to newly allocated, trimmed string (or -// NULL) +// static +void CLRConfig::FreeConfigString(__in_z LPWSTR str) +{ + LIMITED_METHOD_CONTRACT; + + // See EnvGetString(). + delete [] str; +} + // -// Return Value: -// HRESULT indicating success or failure. +// Initialize the internal cache faster lookup. // -HRESULT CLRConfig::TrimWhiteSpace(LPCWSTR wszOrig, __deref_out_z LPWSTR * pwszTrimmed) +// static +void CLRConfig::InitCache() { CONTRACTL { @@ -287,77 +588,49 @@ HRESULT CLRConfig::TrimWhiteSpace(LPCWSTR wszOrig, __deref_out_z LPWSTR * pwszTr } CONTRACTL_END; - _ASSERTE(wszOrig != NULL); - _ASSERTE(pwszTrimmed != NULL); - - // In case we return early, set [out] to NULL by default - *pwszTrimmed = NULL; + // Check if caching is disabled. + if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_DisableConfigCache) != 0) + return; - // Get pointers into internal string that show where to do the trimming. - size_t cchOrig = wcslen(wszOrig); - if (!FitsIn(cchOrig)) - return COR_E_OVERFLOW; - DWORD cchAfterTrim = (DWORD) cchOrig; - LPCWSTR wszAfterTrim = wszOrig; - ::TrimWhiteSpace(&wszAfterTrim, &cchAfterTrim); - - // Is input string already trimmed? If so, save an allocation and just return. - if ((wszOrig == wszAfterTrim) && (cchOrig == cchAfterTrim)) - { - // Yup, just return success - return S_OK; - } - - if (cchAfterTrim == 0) +#ifdef TARGET_WINDOWS + // Create a cache of environment variables + WCHAR* wszStrings = WszGetEnvironmentStrings(); + if (wszStrings != NULL) { - // After trimming, there's nothing left, so just return NULL - return S_OK; - } + // GetEnvironmentStrings returns pointer to a null terminated block containing + // null terminated strings + for(WCHAR *wszCurr = wszStrings; *wszCurr; wszCurr++) + { + WCHAR wch = towlower(*wszCurr); + + // Lets only cache env variables with the COMPlus prefix only + if (wch == W('c')) + { + WCHAR *wszName = wszCurr; + + // Look for the separator between name and value + while (*wszCurr && *wszCurr != W('=')) + wszCurr++; + + if (*wszCurr == W('=')) + { + // Check the prefix + if(!SString::_wcsnicmp(wszName, COMPLUS_PREFIX, LEN_OF_COMPLUS_PREFIX)) + { + wszName += LEN_OF_COMPLUS_PREFIX; + s_EnvNames.Add(wszName, (DWORD) (wszCurr - wszName)); + } + } + + } + // Look for current string termination + while (*wszCurr) + wszCurr++; - // Create a new buffer to hold a copy of the trimmed string. Caller will be - // responsible for this buffer if we return it. - NewArrayHolder wszTrimmedCopy(new (nothrow) WCHAR[cchAfterTrim + 1]); - if (wszTrimmedCopy == NULL) - { - return E_OUTOFMEMORY; - } + } - errno_t err = wcsncpy_s(wszTrimmedCopy, cchAfterTrim + 1, wszAfterTrim, cchAfterTrim); - if (err != 0) - { - return E_FAIL; + WszFreeEnvironmentStrings(wszStrings); + s_fUseEnvCache = TRUE; } - - // Successfully made a copy of the trimmed string. Return it. Caller will be responsible for - // deleting it. - wszTrimmedCopy.SuppressRelease(); - *pwszTrimmed = wszTrimmedCopy; - return S_OK; -} - - -// -// Deallocation function for code:CLRConfig::FreeConfigString -// -void CLRConfig::FreeConfigString(__in_z LPWSTR str) -{ - LIMITED_METHOD_CONTRACT; - - delete [] str; -} - -// -// Helper method to translate LookupOptions to REGUTIL::CORConfigLevel. -// -//static -REGUTIL::CORConfigLevel CLRConfig::GetConfigLevel(LookupOptions options) -{ - LIMITED_METHOD_CONTRACT; - - REGUTIL::CORConfigLevel level = (REGUTIL::CORConfigLevel) 0; - - if(CheckLookupOption(options, IgnoreEnv) == FALSE) - level = static_cast(level | REGUTIL::COR_CONFIG_ENV); - - return static_cast(level | REGUTIL::COR_CONFIG_USER | REGUTIL::COR_CONFIG_MACHINE); +#endif // TARGET_WINDOWS } diff --git a/src/coreclr/utilcode/regutil.cpp b/src/coreclr/utilcode/regutil.cpp deleted file mode 100644 index fcfbe6eb7c7cd..0000000000000 --- a/src/coreclr/utilcode/regutil.cpp +++ /dev/null @@ -1,759 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -//***************************************************************************** -// regutil.cpp -// - -// -// This module contains a set of functions that can be used to access the -// registry. -// -//***************************************************************************** - - -#include "stdafx.h" -#include "utilcode.h" -#include "mscoree.h" -#include "sstring.h" -#include "ex.h" - -#define COMPLUS_PREFIX W("COMPlus_") -#define LEN_OF_COMPLUS_PREFIX 8 - -#if (!defined(FEATURE_UTILCODE_NO_DEPENDENCIES) || defined(DEBUG)) && !defined(TARGET_UNIX) -#define ALLOW_REGISTRY -#endif - -#undef WszRegCreateKeyEx -#undef WszRegOpenKeyEx -#undef WszRegOpenKey -#define WszRegCreateKeyEx RegCreateKeyExW -#define WszRegOpenKeyEx RegOpenKeyExW -#define WszRegOpenKey(hKey, wszSubKey, phkRes) RegOpenKeyExW(hKey, wszSubKey, 0, KEY_ALL_ACCESS, phkRes) - -//***************************************************************************** -// Reads from the environment setting -//***************************************************************************** -LPWSTR REGUTIL::EnvGetString(LPCWSTR name, BOOL fPrependCOMPLUS) -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - FORBID_FAULT; - CANNOT_TAKE_LOCK; - } - CONTRACTL_END; - - WCHAR buff[64]; - - if(wcslen(name) > (size_t)(64 - 1 - (fPrependCOMPLUS ? LEN_OF_COMPLUS_PREFIX : 0))) - { - return NULL; - } - - if (fPrependCOMPLUS) - { -#ifdef ALLOW_REGISTRY - if (!EnvCacheValueNameSeenPerhaps(name)) - return NULL; -#endif // ALLOW_REGISTRY - wcscpy_s(buff, _countof(buff), COMPLUS_PREFIX); - } - else - { - *buff = 0; - } - - wcscat_s(buff, _countof(buff), name); - - FAULT_NOT_FATAL(); // We don't report OOM errors here, we return a default value. - - - NewArrayHolder ret = NULL; - HRESULT hr = S_OK; - DWORD Len; - EX_TRY - { - PathString temp; - - Len = WszGetEnvironmentVariable(buff, temp); - if (Len != 0) - { - ret = temp.GetCopyOfUnicodeString(); - } - - } - EX_CATCH_HRESULT(hr); - - if (hr != S_OK) - { - SetLastError(hr); - } - - if(ret != NULL) - { - return ret.Extract(); - } - - return NULL; - - -} - -//***************************************************************************** -// Reads a DWORD from the COR configuration according to the level specified -// Returns back defValue if the key cannot be found -//***************************************************************************** -DWORD REGUTIL::GetConfigDWORD_DontUse_(LPCWSTR name, DWORD defValue, CORConfigLevel level, BOOL fPrependCOMPLUS) -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - FORBID_FAULT; - CANNOT_TAKE_LOCK; - } - CONTRACTL_END; - - SUPPORTS_DAC_HOST_ONLY; - - ULONGLONG result; - GetConfigInteger(name, defValue, &result, TRUE, level, fPrependCOMPLUS); - - return (DWORD)result; -} - -#define uniwcst(val, endptr, base) (fGetDWORD ? wcstoul(val, endptr, base) : _wcstoui64(val, endptr, base)) - -// -// Look up a dword config value, and write the result to the DWORD passed in by reference. -// -// Return value: -// * E_FAIL if the value is not found. (result is assigned the default value) -// * S_OK if the value is found. (result is assigned the value that was found) -// -// Arguments: -// * info - see file:../inc/CLRConfig.h for details -// * result - Pointer to the output DWORD. -// -// static -HRESULT REGUTIL::GetConfigDWORD_DontUse_(LPCWSTR name, DWORD defValue, __out DWORD * result, CORConfigLevel level, BOOL fPrependCOMPLUS) -{ - ULONGLONG ullResult; - HRESULT hr = GetConfigInteger(name, defValue, &ullResult, TRUE, level, fPrependCOMPLUS); - *result = (DWORD)ullResult; - return hr; -} - -ULONGLONG REGUTIL::GetConfigULONGLONG_DontUse_(LPCWSTR name, ULONGLONG defValue, CORConfigLevel level, BOOL fPrependCOMPLUS) -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - FORBID_FAULT; - CANNOT_TAKE_LOCK; - } - CONTRACTL_END; - - SUPPORTS_DAC_HOST_ONLY; - - ULONGLONG result; - GetConfigInteger(name, defValue, &result, FALSE, level, fPrependCOMPLUS); - - return result; -} - -// This function should really be refactored to return the string from the environment and let the caller decide -// what to convert it to; and return the buffer read from the reg call. -// Note for PAL: right now PAL does not have a _wcstoui64 API, so I am temporarily reading in all numbers as -// a 32-bit number. When we have the _wcstoui64 API on MAC we will use uniwcst instead of wcstoul. -HRESULT REGUTIL::GetConfigInteger(LPCWSTR name, ULONGLONG defValue, __out ULONGLONG * result, BOOL fGetDWORD, CORConfigLevel level, BOOL fPrependCOMPLUS) -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - FORBID_FAULT; - CANNOT_TAKE_LOCK; - } - CONTRACTL_END; - - SUPPORTS_DAC_HOST_ONLY; - - ULONGLONG rtn; - ULONGLONG ret = 0; - DWORD type = 0; - DWORD size = 4; - - FAULT_NOT_FATAL(); // We don't report OOM errors here, we return a default value. - - if (level & COR_CONFIG_ENV) - { - WCHAR* val = EnvGetString(name, fPrependCOMPLUS); // try getting it from the environement first - if (val != 0) { - errno = 0; - LPWSTR endPtr; - rtn = uniwcst(val, &endPtr, 16); // treat it has hex - BOOL fSuccess = ((errno != ERANGE) && (endPtr != val)); - delete[] val; - - if (fSuccess) // success - { - *result = rtn; - return (S_OK); - } - } - } - - // Early out if no registry access, simplifies following code. - // - if (!(level & COR_CONFIG_REGISTRY)) - { - *result = defValue; - return (E_FAIL); - } - -#ifdef ALLOW_REGISTRY - // Probe the config cache to see if there is any point - // probing the registry; if not, don't bother. - // - if (!RegCacheValueNameSeenPerhaps(name)) - { - *result = defValue; - return (E_FAIL); - } -#endif // ALLOW_REGISTRY - - if (level & COR_CONFIG_USER) - { -#ifdef ALLOW_REGISTRY - { - LONG retVal = ERROR_SUCCESS; - BOOL bCloseHandle = FALSE; - HKEY userKey = s_hUserFrameworkKey; - - if (userKey == INVALID_HANDLE_VALUE) - { - retVal = WszRegOpenKeyEx(HKEY_CURRENT_USER, FRAMEWORK_REGISTRY_KEY_W, 0, KEY_READ, &userKey); - bCloseHandle = TRUE; - } - - if (retVal == ERROR_SUCCESS) - { - rtn = WszRegQueryValueEx(userKey, name, 0, &type, (LPBYTE)&ret, &size); - - if (bCloseHandle) - VERIFY(!RegCloseKey(userKey)); - - if (rtn == ERROR_SUCCESS && (type == REG_DWORD || (!fGetDWORD && type == REG_QWORD))) - { - *result = ret; - return (S_OK); - } - } - } -#endif // ALLOW_REGISTRY - } - - if (level & COR_CONFIG_MACHINE) - { -#ifdef ALLOW_REGISTRY - { - LONG retVal = ERROR_SUCCESS; - BOOL bCloseHandle = FALSE; - HKEY machineKey = s_hMachineFrameworkKey; - - if (machineKey == INVALID_HANDLE_VALUE) - { - retVal = WszRegOpenKeyEx(HKEY_LOCAL_MACHINE, FRAMEWORK_REGISTRY_KEY_W, 0, KEY_READ, &machineKey); - bCloseHandle = TRUE; - } - - if (retVal == ERROR_SUCCESS) - { - rtn = WszRegQueryValueEx(machineKey, name, 0, &type, (LPBYTE)&ret, &size); - - if (bCloseHandle) - VERIFY(!RegCloseKey(machineKey)); - - if (rtn == ERROR_SUCCESS && (type == REG_DWORD || (!fGetDWORD && type == REG_QWORD))) - { - *result = ret; - return (S_OK); - } - } - } -#endif // ALLOW_REGISTRY - } - - *result = defValue; - return (E_FAIL); -} - -//***************************************************************************** -// Reads a string from the COR configuration according to the level specified -// The caller is responsible for deallocating the returned string by -// calling code:REGUTIL::FreeConfigString or using a code:ConfigStringHolder -//***************************************************************************** - -LPWSTR REGUTIL::GetConfigString_DontUse_(LPCWSTR name, BOOL fPrependCOMPLUS, CORConfigLevel level, BOOL fUsePerfCache) -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - FORBID_FAULT; - } - CONTRACTL_END; - -#ifdef ALLOW_REGISTRY - HRESULT lResult; - RegKeyHolder userKey = NULL; - RegKeyHolder machineKey = NULL; - RegKeyHolder fusionKey = NULL; - DWORD type; - DWORD size; -#endif // ALLOW_REGISTRY - NewArrayHolder ret(NULL); - - FAULT_NOT_FATAL(); // We don't report OOM errors here, we return a default value. - - if (level & COR_CONFIG_ENV) - { - ret = EnvGetString(name, fPrependCOMPLUS); // try getting it from the environement first - if (ret != 0) { - if (*ret != 0) - { - ret.SuppressRelease(); - return(ret); - } - ret.Clear(); - } - } - - // Early out if no registry access, simplifies following code. - // - if (!(level & COR_CONFIG_REGISTRY)) - { - return(ret); - } - -#ifdef ALLOW_REGISTRY - // Probe the config cache to see if there is any point - // probing the registry; if not, don't bother. - // - if (fUsePerfCache && !RegCacheValueNameSeenPerhaps(name)) - return ret; -#endif // ALLOW_REGISTRY - - if (level & COR_CONFIG_USER) - { -#ifdef ALLOW_REGISTRY - BOOL bUsingCachedKey = FALSE; - - if (s_hUserFrameworkKey != INVALID_HANDLE_VALUE) - { - bUsingCachedKey = TRUE; - userKey = s_hUserFrameworkKey; - } - - if (bUsingCachedKey || WszRegOpenKeyEx(HKEY_CURRENT_USER, FRAMEWORK_REGISTRY_KEY_W, 0, KEY_READ, &userKey) == ERROR_SUCCESS) - { - BOOL bReturn = FALSE; - if (WszRegQueryValueEx(userKey, name, 0, &type, 0, &size) == ERROR_SUCCESS && - type == REG_SZ) - { - ret = (LPWSTR) new (nothrow) BYTE [size]; - if (ret) - { - ret[0] = W('\0'); - lResult = WszRegQueryValueEx(userKey, name, 0, 0, (LPBYTE) ret.GetValue(), &size); - _ASSERTE(lResult == ERROR_SUCCESS); - { - ret.SuppressRelease(); - } - } - bReturn = TRUE; - } - - if (bUsingCachedKey) - userKey.SuppressRelease(); - - if (bReturn) - return ret; - } - -#endif // ALLOW_REGISTRY - } - - if (level & COR_CONFIG_MACHINE) - { -#ifdef ALLOW_REGISTRY - BOOL bUsingCachedKey = FALSE; - - if (s_hMachineFrameworkKey != INVALID_HANDLE_VALUE) - { - bUsingCachedKey = TRUE; - machineKey = s_hMachineFrameworkKey; - } - - if (bUsingCachedKey || WszRegOpenKeyEx(HKEY_LOCAL_MACHINE, FRAMEWORK_REGISTRY_KEY_W, 0, KEY_READ, &machineKey) == ERROR_SUCCESS) - { - BOOL bReturn = FALSE; - if (WszRegQueryValueEx(machineKey, name, 0, &type, 0, &size) == ERROR_SUCCESS && - type == REG_SZ) - { - ret = (LPWSTR) new (nothrow) BYTE [size]; - if (ret) - { - ret[0] = W('\0'); - lResult = WszRegQueryValueEx(machineKey, name, 0, 0, (LPBYTE) ret.GetValue(), &size); - _ASSERTE(lResult == ERROR_SUCCESS); - { - ret.SuppressRelease(); - } - } - bReturn = TRUE; - } - - if (bUsingCachedKey) - machineKey.SuppressRelease(); - - if (bReturn) - return ret; - } - -#endif // ALLOW_REGISTRY - } - - return NULL; -} - -//***************************************************************************** -// Deallocation function for code:REGUTIL::GetConfigString_DontUse_ -// -// Notes: -// Use a code:ConfigStringHolder to automatically call this. -//***************************************************************************** -void REGUTIL::FreeConfigString(__in_z LPWSTR str) -{ - LIMITED_METHOD_CONTRACT; - - delete [] str; -} - -//***************************************************************************** -// Reads a BIT flag from the COR configuration according to the level specified -// Returns back defValue if the key cannot be found -//***************************************************************************** -DWORD REGUTIL::GetConfigFlag_DontUse_(LPCWSTR name, DWORD bitToSet, BOOL defValue) -{ - WRAPPER_NO_CONTRACT; - - return(GetConfigDWORD_DontUse_(name, defValue) != 0 ? bitToSet : 0); -} - - -#ifdef ALLOW_REGISTRY - - - -// -// ProbabilisticNameSet: -// -// (Used by ConfigCache, below. If used elsewhere, might justify -// promotion to a standalone header file.) -// -// Represent a set of names in a small, fixed amount of storage. -// We turn a name into a small integer, then add the integer to a bitvector. -// An old trick we used in VC++4 minimal rebuild. -// -// For best results, the number of elements should be a fraction of -// the total number of bits in 'bits'. -// -// Note, only the const methods are thread-safe. -// Callers are responsible for providing their own synchronization when -// constructing and Add'ing names to the set. -// -class ProbabilisticNameSet { -public: - ProbabilisticNameSet() - { - WRAPPER_NO_CONTRACT; - - memset(bits, 0, sizeof(bits)); - } - - // Add a name to the set. - // - void Add(LPCWSTR name) - { - WRAPPER_NO_CONTRACT; - - unsigned i, mask; - GetBitIndex(name, 0, &i, &mask); - bits[i] |= mask; - } - - void Add(LPCWSTR name, DWORD count) - { - WRAPPER_NO_CONTRACT; - - unsigned i, mask; - GetBitIndex(name, count, &i, &mask); - bits[i] |= mask; - } - - // Return TRUE if a name *may have* been added to the set; - // return FALSE if the name *definitely* was NOT ever added to the set. - // - BOOL MayContain(LPCWSTR name) const - { - WRAPPER_NO_CONTRACT; - - unsigned i, mask; - GetBitIndex(name, 0, &i, &mask); - return !!(bits[i] & mask); - } - -private: - static const unsigned cbitSet = 256U; - static const unsigned cbitWord = 8U*sizeof(unsigned); - unsigned bits[cbitSet/cbitWord]; - - // Return the word index and bit mask corresponding to the bitvector member - // addressed by the *case-insensitive* hash of the given name. - // - void GetBitIndex(LPCWSTR name, DWORD count, unsigned* pi, unsigned* pmask) const - { - LIMITED_METHOD_CONTRACT; - unsigned hash; - if (count > 0) - hash = HashiStringNKnownLower80(name, count) % cbitSet; - else - hash = HashiStringKnownLower80(name) % cbitSet; - *pi = hash / cbitWord; - *pmask = (1U << (hash % cbitWord)); - } - -}; - - -// From the Win32 SDK docs: -// Registry Element Size Limits -// ... -// The maximum size of a value name is as follows: -// Windows Server 2003 and Windows XP: 16,383 characters -// Windows 2000: 260 ANSI characters or 16,383 Unicode characters. -// Windows Me/98/95: 255 characters -// Despite that, we only cache value names of 80 characters or less -- -// longer names don't make sense as configuration settings names. -// -static const unsigned cchRegValueNameMax = 80; - -BOOL REGUTIL::s_fUseRegCache = FALSE; -BOOL REGUTIL::s_fUseEnvCache = FALSE; -HKEY REGUTIL::s_hMachineFrameworkKey = (HKEY) INVALID_HANDLE_VALUE; -HKEY REGUTIL::s_hUserFrameworkKey = (HKEY) INVALID_HANDLE_VALUE; -static ProbabilisticNameSet regNames; // set of registry value names seen; should be - // a static field of REGUTIL but I don't - // want to expose ProbabilisticNameSet. -static ProbabilisticNameSet envNames; // set of environment value names seen; - -// "Registry Configuration Cache" -// -// Initialize the (optional) registry config cache. -// -// The purpose of the cache is to avoid hundreds of registry probes -// otherwise incurred by calls to GetConfigDWORD_DontUse_ and GetConfigString_DontUse_. -// -// We accomplish this by enumerating the relevant registry keys and -// remembering the extant value names; and then by avoiding probing -// for a name that was not seen in the enumeration (initialization) phase. -// -// It is optional in the sense that REGUTIL facilities like -// GetConfigDWORD_DontUse_ and GetConfigString_DontUse_ will work fine if the cache -// is never initialized; however, each config access then will hit -// the registry (typically multiple times to search HKCU and HKLM). -// -// -// Initialization: Enumerate these registry keys -// HKCU Software\Microsoft\.NetFramework -// HKLM Software\Microsoft\.NetFramework -// for value names, and "remember" them in the ProbalisticNameSet 'names'. -// -// If we ever find a reg value named DisableConfigCache under any of these -// three keys, the feature is disabled. -// -// This method is not thread-safe. It should only be called once. -// -// Perf Optimization for VSWhidbey:113373. -// -void REGUTIL::InitOptionalConfigCache() -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - } - CONTRACTL_END; - - static const HKEY roots[] = { HKEY_CURRENT_USER, - HKEY_LOCAL_MACHINE}; - - LONG l = ERROR_SUCCESS; // general Win32 API error return code - HKEY hkey = NULL; - - // No caching if the environment variable COMPlus_DisableConfigCache is set - // - if (CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_DisableConfigCache) != 0) - goto failure; - - // Enumerate each root - // - for (int i = 0; i < NumItems(roots); i++) { - hkey = NULL; // defensive - l = WszRegOpenKeyEx(roots[i], FRAMEWORK_REGISTRY_KEY_W, 0, KEY_READ, &hkey); - if (l == ERROR_FILE_NOT_FOUND) { - // That registry key is not present. - // For example, installation with no HKCU\...\.NETFramework. - // Should be OK to proceed. - continue; - } - 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 - // later attempts to access them (open the key) would also hit access - // denied and continue on probing other locations. - continue; - } - else if (l != ERROR_SUCCESS) { - // Something else went wrong. To be safe, don't enable the cache. - goto failure; - } - - // Enumerate every value name under this key. - // - for (int j = 0; ; j++) { - WCHAR wszValue[cchRegValueNameMax + 1]; - DWORD dwValueSize = NumItems(wszValue); - l = WszRegEnumValue(hkey, j, wszValue, &dwValueSize, - NULL, NULL, NULL, NULL); - - if (l == ERROR_SUCCESS) { - // Add value name to the names cache. - regNames.Add(wszValue); - } - else if (l == ERROR_NO_MORE_ITEMS) { - // Expected case: we've considered every value under this key. - break; - } - else if ((l == ERROR_INSUFFICIENT_BUFFER || l == ERROR_MORE_DATA) && - (dwValueSize > cchRegValueNameMax)) { - // Name is too long. That's OK, we don't cache such names. - continue; - } - else if (l == ERROR_ACCESS_DENIED) { - // As above, ignore access denied and continue on trying to cache - continue; - } - else { - // WszRegEnumValue failed OOM, or something else went wrong. - // To be safe, don't enable the cache. - goto failure; - } - } - - // Save the handles to framework regkeys so that future reads dont have to - // open it again - if (roots[i] == HKEY_CURRENT_USER) - s_hUserFrameworkKey = hkey; - else if (roots[i] == HKEY_LOCAL_MACHINE) - s_hMachineFrameworkKey = hkey; - else - RegCloseKey(hkey); - - hkey = NULL; - } - - // Success. We've enumerated all value names under the roots; - // enable the REGUTIL value name config cache. - // - s_fUseRegCache = TRUE; - - // Now create a cache of environment variables - if (WCHAR * wszStrings = WszGetEnvironmentStrings()) - { - // GetEnvironmentStrings returns pointer to a null terminated block containing - // null terminated strings - for(WCHAR *wszCurr = wszStrings; *wszCurr; wszCurr++) - { - WCHAR wch = towlower(*wszCurr); - - // Lets only cache env variables with the COMPlus prefix only - if (wch == W('c')) - { - WCHAR *wszName = wszCurr; - - // Look for the separator between name and value - while (*wszCurr && *wszCurr != W('=')) - wszCurr++; - - if (*wszCurr == W('=')) - { - // Check the prefix - if(!SString::_wcsnicmp(wszName, COMPLUS_PREFIX, LEN_OF_COMPLUS_PREFIX)) - { - wszName += LEN_OF_COMPLUS_PREFIX; - envNames.Add(wszName, (DWORD) (wszCurr - wszName)); - } - } - - } - // Look for current string termination - while (*wszCurr) - wszCurr++; - - } - - WszFreeEnvironmentStrings(wszStrings); - s_fUseEnvCache = TRUE; - - } - return; - -failure: - if (hkey != NULL) - RegCloseKey(hkey); -} - -// Return TRUE if the registry value name was seen (or might have been seen) -// in the registry at cache initialization time; -// return FALSE if it definitely was not seen at startup. -// -// If not using the config cache, return TRUE always. -// -// Perf Optimization for VSWhidbey:113373. -// -BOOL REGUTIL::RegCacheValueNameSeenPerhaps(LPCWSTR name) -{ - WRAPPER_NO_CONTRACT; - - return !s_fUseRegCache - || (wcslen(name) > cchRegValueNameMax) - || regNames.MayContain(name); -} - -BOOL REGUTIL::EnvCacheValueNameSeenPerhaps(LPCWSTR name) -{ - WRAPPER_NO_CONTRACT; - - return !s_fUseEnvCache - || envNames.MayContain(name); -} - -#endif // ALLOW_REGISTRY diff --git a/src/coreclr/vm/ceemain.cpp b/src/coreclr/vm/ceemain.cpp index 0e8060ef65e0e..95acb304a01ff 100644 --- a/src/coreclr/vm/ceemain.cpp +++ b/src/coreclr/vm/ceemain.cpp @@ -305,12 +305,8 @@ HRESULT EnsureEEStarted() { BEGIN_ENTRYPOINT_NOTHROW; -#ifndef TARGET_UNIX // The sooner we do this, the sooner we avoid probing registry entries. - // (Perf Optimization for VSWhidbey:113373.) - REGUTIL::InitOptionalConfigCache(); -#endif - + CLRConfig::InitCache(); BOOL bStarted=FALSE; diff --git a/src/coreclr/vm/comcallablewrapper.cpp b/src/coreclr/vm/comcallablewrapper.cpp index 06357458e7698..018cb91076e74 100644 --- a/src/coreclr/vm/comcallablewrapper.cpp +++ b/src/coreclr/vm/comcallablewrapper.cpp @@ -4192,11 +4192,6 @@ BOOL ComCallWrapperTemplate::IsSafeTypeForMarshalling() return TRUE; } - if ((CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_AllowDComReflection) != 0)) - { - return TRUE; - } - BOOL isSafe = TRUE; PTR_MethodTable pMt = this->GetClassType().GetMethodTable(); EX_TRY diff --git a/src/coreclr/vm/compatibilityswitch.cpp b/src/coreclr/vm/compatibilityswitch.cpp index 49ce4a400c6e8..aedddbc7cbbf4 100644 --- a/src/coreclr/vm/compatibilityswitch.cpp +++ b/src/coreclr/vm/compatibilityswitch.cpp @@ -23,7 +23,7 @@ FCIMPL1(StringObject*, CompatibilitySwitch::GetValue, StringObject* switchNameUN HELPER_METHOD_FRAME_BEGIN_RET_1(name); CLRConfig::ConfigStringInfo info; info.name = name->GetBuffer(); - info.options = CLRConfig::EEConfig_default; + info.options = CLRConfig::LookupOptions::Default; LPWSTR strVal = CLRConfig::GetConfigValue(info); refName = StringObject::NewString(strVal); HELPER_METHOD_FRAME_END(); diff --git a/src/coreclr/vm/gcenv.ee.cpp b/src/coreclr/vm/gcenv.ee.cpp index 2318c7ba28101..7849958d06874 100644 --- a/src/coreclr/vm/gcenv.ee.cpp +++ b/src/coreclr/vm/gcenv.ee.cpp @@ -1125,7 +1125,7 @@ bool GCToEEInterface::GetBooleanConfigValue(const char* privateKey, const char* // otherwise, ask the config subsystem. if (CLRConfig::IsConfigOptionSpecified(configKey)) { - CLRConfig::ConfigDWORDInfo info { configKey , 0, CLRConfig::EEConfig_default }; + CLRConfig::ConfigDWORDInfo info { configKey , 0, CLRConfig::LookupOptions::Default }; *value = CLRConfig::GetConfigValue(info) != 0; return true; } @@ -1170,7 +1170,7 @@ bool GCToEEInterface::GetIntConfigValue(const char* privateKey, const char* publ // so have to fake it with getting the string and converting to uint64_t if (CLRConfig::IsConfigOptionSpecified(configKey)) { - CLRConfig::ConfigStringInfo info { configKey, CLRConfig::EEConfig_default }; + CLRConfig::ConfigStringInfo info { configKey, CLRConfig::LookupOptions::Default }; LPWSTR out = CLRConfig::GetConfigValue(info); if (!out) { @@ -1226,7 +1226,7 @@ bool GCToEEInterface::GetStringConfigValue(const char* privateKey, const char* p return false; } - CLRConfig::ConfigStringInfo info { configKey, CLRConfig::EEConfig_default }; + CLRConfig::ConfigStringInfo info { configKey, CLRConfig::LookupOptions::Default }; LPWSTR fromClrConfig = CLRConfig::GetConfigValue(info); LPCWSTR out = fromClrConfig; if (out == NULL) diff --git a/src/coreclr/vm/jithost.cpp b/src/coreclr/vm/jithost.cpp index 798d594c4630b..504e389faa62a 100644 --- a/src/coreclr/vm/jithost.cpp +++ b/src/coreclr/vm/jithost.cpp @@ -26,7 +26,7 @@ int JitHost::getIntConfigValue(const WCHAR* name, int defaultValue) WRAPPER_NO_CONTRACT; // Translate JIT call into runtime configuration query - CLRConfig::ConfigDWORDInfo info{ name, (DWORD)defaultValue, CLRConfig::EEConfig_default }; + CLRConfig::ConfigDWORDInfo info{ name, (DWORD)defaultValue, CLRConfig::LookupOptions::Default }; // Perform a CLRConfig look up on behalf of the JIT. return CLRConfig::GetConfigValue(info); @@ -37,7 +37,7 @@ const WCHAR* JitHost::getStringConfigValue(const WCHAR* name) WRAPPER_NO_CONTRACT; // Translate JIT call into runtime configuration query - CLRConfig::ConfigStringInfo info{ name, CLRConfig::EEConfig_default }; + CLRConfig::ConfigStringInfo info{ name, CLRConfig::LookupOptions::Default }; // Perform a CLRConfig look up on behalf of the JIT. return CLRConfig::GetConfigValue(info); From 647ed7978df04a28631a64f886dde96c53a3593e Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Mon, 29 Mar 2021 15:48:17 -0700 Subject: [PATCH 2/4] Update comment. --- src/coreclr/vm/ceemain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/vm/ceemain.cpp b/src/coreclr/vm/ceemain.cpp index 95acb304a01ff..3efde73df285b 100644 --- a/src/coreclr/vm/ceemain.cpp +++ b/src/coreclr/vm/ceemain.cpp @@ -305,7 +305,7 @@ HRESULT EnsureEEStarted() { BEGIN_ENTRYPOINT_NOTHROW; - // The sooner we do this, the sooner we avoid probing registry entries. + // Initialize our configuration cache to avoid unuseful probing. CLRConfig::InitCache(); BOOL bStarted=FALSE; From 0f080da5cfc75c213cd4b40333167efbeb5fda34 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Mon, 29 Mar 2021 16:46:45 -0700 Subject: [PATCH 3/4] Remove registry key defines from corhdr.h. --- src/coreclr/inc/corhdr.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/coreclr/inc/corhdr.h b/src/coreclr/inc/corhdr.h index a4c5e6d639bf3..de3e95df31e06 100644 --- a/src/coreclr/inc/corhdr.h +++ b/src/coreclr/inc/corhdr.h @@ -16,18 +16,6 @@ #ifndef __CORHDR_H__ #define __CORHDR_H__ -#define FRAMEWORK_REGISTRY_KEY "Software\\Microsoft\\.NETFramework" -#define FRAMEWORK_REGISTRY_KEY_W W("Software\\Microsoft\\.NETFramework") - -// keys for HKCU -#ifdef HOST_64BIT -#define USER_FRAMEWORK_REGISTRY_KEY "Software\\Microsoft\\.NETFramework64" -#define USER_FRAMEWORK_REGISTRY_KEY_W W("Software\\Microsoft\\.NETFramework64") -#else -#define USER_FRAMEWORK_REGISTRY_KEY "Software\\Microsoft\\.NETFramework" -#define USER_FRAMEWORK_REGISTRY_KEY_W W("Software\\Microsoft\\.NETFramework") -#endif - #include #ifdef _MSC_VER From e5a659cc59f093aec2f580c6c0e3600bc371ac95 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Mon, 29 Mar 2021 19:32:02 -0700 Subject: [PATCH 4/4] Remove NO_CLRCONFIG ifdef. --- src/coreclr/inc/utilcode.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/coreclr/inc/utilcode.h b/src/coreclr/inc/utilcode.h index 366312e376958..a3c446bb74788 100644 --- a/src/coreclr/inc/utilcode.h +++ b/src/coreclr/inc/utilcode.h @@ -3613,8 +3613,6 @@ class MethodNamesList : public MethodNamesListBase } }; -#if !defined(NO_CLRCONFIG) - #include "clrconfig.h" /**************************************************************************/ @@ -3709,8 +3707,6 @@ class ConfigMethodSet BYTE m_inited; }; -#endif // !defined(NO_CLRCONFIG) - //***************************************************************************** // Convert a pointer to a string into a GUID. //*****************************************************************************