Skip to content

Commit

Permalink
Delete legacy HRESULTs and error messages (dotnet#68252)
Browse files Browse the repository at this point in the history
Number of HRESULTs and error messages related to GAC, CAS and other concepts remove in .NET Core
existed just to provide mapping in Marshal.GetExceptionForHR API. They were otherwise unused.

Deleting these HRESULTs is observable behavior change in Marshal.GetExceptionForHR. It should be
acceptable change given that these HRESULTs are never returned by the runtime and very unlikely to
be used by user code.
  • Loading branch information
jkotas authored and directhex committed Apr 21, 2022
1 parent 5ca4240 commit 5135336
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 289 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/binder/assemblybindercommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ namespace BINDER_SPACE

hr = BindSatelliteResourceFromBundle(pRequestedAssemblyName, fileName, pBindResult);

if (pBindResult->HaveResult() || (FAILED(hr) && hr != FUSION_E_CONFIGURATION_ERROR))
if (pBindResult->HaveResult() || FAILED(hr))
{
return hr;
}
Expand All @@ -725,7 +725,7 @@ namespace BINDER_SPACE
pBindResult,
BinderTracing::PathSource::PlatformResourceRoots);

if (pBindResult->HaveResult() || (FAILED(hr) && hr != FUSION_E_CONFIGURATION_ERROR))
if (pBindResult->HaveResult() || FAILED(hr))
{
return hr;
}
Expand Down
15 changes: 0 additions & 15 deletions src/coreclr/dlls/mscorrc/mscorrc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -111,26 +111,15 @@ BEGIN

COR_E_APPDOMAINUNLOADED "Error: Attempt to access unloaded AppDomain."
COR_E_MISSINGMETHOD "Error: Missing method '%2' from class '%1'."
COR_E_FIXUPSINEXE "Cannot load executable '%1' because it contains extra relocations or has relocations stripped."

COR_E_FILELOAD "Unable to load file '%1'."
COR_E_ASSEMBLYEXPECTED "The module '%1' was expected to contain an assembly manifest."
FUSION_E_REF_DEF_MISMATCH "The located assembly's manifest definition with name '%1' does not match the assembly reference."
FUSION_E_INVALID_PRIVATE_ASM_LOCATION "The found private assembly, '%1', was located outside the ApplicationBase."
FUSION_E_SIGNATURE_CHECK_FAILED "Strong name signature verification failed for assembly '%1'. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key."
COR_E_MODULE_HASH_CHECK_FAILED "The check of the module's hash failed for file '%1'."
FUSION_E_PRIVATE_ASM_DISALLOWED "Assembly '%1' is required to be strongly named."
FUSION_E_INVALID_NAME "The given assembly name, '%1', was invalid."
FUSION_E_ASM_MODULE_MISSING "A module specified in the manifest of assembly '%1' could not be found."
FUSION_E_CODE_DOWNLOAD_DISABLED "HTTP download of assemblies has been disabled for this appdomain."
FUSION_E_HOST_GAC_ASM_MISMATCH "The assembly returned from the host store has a different strong name signature than the corresponding one in GAC. Assembly: '%1'"
FUSION_E_LOADFROM_BLOCKED "LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host."
FUSION_E_CACHEFILE_FAILED "Failed to add file to AppDomain cache."
FUSION_E_APP_DOMAIN_LOCKED "The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest."
FUSION_E_CONFIGURATION_ERROR "The requested assembly name was neither found in the GAC nor in the manifest or the manifest's specified location is wrong."
FUSION_E_MANIFEST_PARSE_ERROR "Unexpected error while parsing the specified manifest."
IDS_EE_HASH_VAL_FAILED "Hash validation failed for file or assembly '%1'."
CORSEC_E_MISSING_STRONGNAME "Assembly '%1' is missing the required strong name."
CORSEC_E_INVALID_PUBLICKEY "The public key for assembly '%1' was invalid."
CORSEC_E_INVALID_STRONGNAME "Strong name validation failed for assembly '%1'."
CORSEC_E_SIGNATURE_MISMATCH "The allocated signature slot for assembly '%1' does not correspond to the generated signature size."
Expand Down Expand Up @@ -164,7 +153,6 @@ BEGIN
// These strings are generated from within the EE.
STRINGTABLE DISCARDABLE
BEGIN
CEE_E_CVTRES_NOT_FOUND "Could not execute CVTRES.EXE."
IDS_EE_THREAD_APARTMENT_NOT_SUPPORTED "The system does not support the %1 thread apartment."
IDS_EE_NDIRECT_UNSUPPORTED_SIG "Method's type signature is not PInvoke compatible."
IDS_EE_COM_UNSUPPORTED_SIG "Method's type signature is not Interop compatible."
Expand Down Expand Up @@ -376,9 +364,6 @@ BEGIN
IDS_CLASSLOAD_METHOD_NOT_IMPLEMENTED "Could not call method '%1' on type '%2' with an instance of '%3' from assembly '%4' because there is no implementation for the method."

IDS_CLASSLOAD_MISSINGMETHODRVA "Could not load type '%1' from assembly '%2' because the method '%3' has no implementation (no RVA)."
SECURITY_E_INCOMPATIBLE_EVIDENCE "Assembly '%1' already loaded without additional security evidence."
SECURITY_E_INCOMPATIBLE_SHARE "Assembly '%1' security permission grant set is incompatible between appdomains."
SECURITY_E_UNVERIFIABLE "Unverifiable assembly '%1' failed policy check."
IDS_CLASSLOAD_BAD_FIELD "Type '%1' from assembly '%2' has a field of an illegal type."
IDS_CLASSLOAD_MI_ILLEGAL_BODY "Body referenced in a method implementation must be defined in the same type. Type: '%1'. Assembly: '%2'."
IDS_CLASSLOAD_MI_ILLEGAL_TOKEN_BODY "Body token used in a method implementation is out of range. Type: '%1'. Assembly: '%2'."
Expand Down
150 changes: 0 additions & 150 deletions src/coreclr/inc/corerror.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@
<Comment> Not all bits specified were successfully applied </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131001">
<SymbolicName>CEE_E_CVTRES_NOT_FOUND</SymbolicName>
<Message>"cvtres.exe not found."</Message>
<Comment> cannot find cvtres.exe </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131013">
<SymbolicName>COR_E_TYPEUNLOADED</SymbolicName>
<Message>"Type has been unloaded."</Message>
Expand Down Expand Up @@ -148,12 +142,6 @@
<Comment> The module was expected to contain an assembly manifest.</Comment>
</HRESULT>

<HRESULT NumericValue="0x80131019">
<SymbolicName>COR_E_FIXUPSINEXE</SymbolicName>
<Message>"Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.)"</Message>
<Comment> Attempt to load an unverifiable exe with fixups (IAT with more than 2 sections or a TLS section) </Comment>
</HRESULT>

<HRESULT NumericValue="0x8013101b">
<SymbolicName>COR_E_NEWER_RUNTIME</SymbolicName>
<Message>"This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."</Message>
Expand All @@ -166,12 +154,6 @@
<Comment> The module cannot be loaded because only single file assemblies are supported. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131020">
<SymbolicName>HOST_E_DEADLOCK</SymbolicName>
<Message>"Host detected a deadlock on a blocking operation."</Message>
<Comment> Host detects deadlock on a blocking operation </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131022">
<SymbolicName>HOST_E_INVALIDOPERATION</SymbolicName>
<Message>"Invalid operation."</Message>
Expand All @@ -184,90 +166,24 @@
<Comment> CLR has been disabled due to unrecoverable error </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131027">
<SymbolicName>HOST_E_EXITPROCESS_THREADABORT</SymbolicName>
<Message>"Process exited due to ThreadAbort escalation."</Message>
<Comment> ExitProcess due to ThreadAbort escalation </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131028">
<SymbolicName>HOST_E_EXITPROCESS_ADUNLOAD</SymbolicName>
<Message>"Process exited due to AD Unload escalation."</Message>
<Comment> ExitProcess due to AD Unload escalation </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131029">
<SymbolicName>HOST_E_EXITPROCESS_TIMEOUT</SymbolicName>
<Message>"Process exited due to Timeout escalation."</Message>
<Comment> ExitProcess due to Timeout escalation </Comment>
</HRESULT>

<HRESULT NumericValue="0x8013102a">
<SymbolicName>HOST_E_EXITPROCESS_OUTOFMEMORY</SymbolicName>
<Message>"Process exited due to OutOfMemory escalation."</Message>
<Comment> ExitProcess due to OutOfMemory escalation </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131039">
<SymbolicName>COR_E_MODULE_HASH_CHECK_FAILED</SymbolicName>
<Message>"The check of the module's hash failed."</Message>
<Comment> The check of the module's hash failed. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131040">
<SymbolicName>FUSION_E_REF_DEF_MISMATCH</SymbolicName>
<Message>"The located assembly's manifest definition does not match the assembly reference."</Message>
<Comment> The located assembly's manifest definition does not match the assembly reference. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131041">
<SymbolicName>FUSION_E_INVALID_PRIVATE_ASM_LOCATION</SymbolicName>
<Message>"The private assembly was located outside the appbase directory."</Message>
<Comment> The private assembly was located outside the appbase directory. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131042">
<SymbolicName>FUSION_E_ASM_MODULE_MISSING</SymbolicName>
<Message>"A module specified in the manifest was not found."</Message>
<Comment> A module specified in the manifest was not found. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131044">
<SymbolicName>FUSION_E_PRIVATE_ASM_DISALLOWED</SymbolicName>
<Message>"A strongly-named assembly is required."</Message>
<Comment> A strongly-named assembly is required. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131045">
<SymbolicName>FUSION_E_SIGNATURE_CHECK_FAILED</SymbolicName>
<Message>"Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key."</Message>
<Comment> The check of the signature failed. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131047">
<SymbolicName>FUSION_E_INVALID_NAME</SymbolicName>
<Message>"The given assembly name was invalid."</Message>
<Comment> The given assembly name was invalid. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131048">
<SymbolicName>FUSION_E_CODE_DOWNLOAD_DISABLED</SymbolicName>
<Message>"HTTP download of assemblies has been disabled for this appdomain."</Message>
<Comment> HTTP download of assemblies has been disabled for this appdomain. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131050">
<SymbolicName>FUSION_E_HOST_GAC_ASM_MISMATCH</SymbolicName>
<Message>"Assembly in host store has a different signature than assembly in GAC."</Message>
<Comment> Assembly in host store has a different signature than assembly in GAC </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131051">
<SymbolicName>FUSION_E_LOADFROM_BLOCKED</SymbolicName>
<Message>"LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host."</Message>
<Comment> Hosted environment doesn't permit loading by location </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131052">
<SymbolicName>FUSION_E_CACHEFILE_FAILED</SymbolicName>
<Message>"Failed to add file to AppDomain cache."</Message>
Expand All @@ -280,30 +196,12 @@
<Comment> The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131054">
<SymbolicName>FUSION_E_CONFIGURATION_ERROR</SymbolicName>
<Message>"The requested assembly name was neither found in the GAC nor in the manifest or the manifest's specified location is wrong."</Message>
<Comment> The requested assembly name was neither found in the GAC nor in the manifest or the manifest's specified location is wrong </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131055">
<SymbolicName>FUSION_E_MANIFEST_PARSE_ERROR</SymbolicName>
<Message>"Unexpected error while parsing the specified manifest."</Message>
<Comment> Unexpected error while parsing the specified manifest </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131058">
<SymbolicName>COR_E_LOADING_REFERENCE_ASSEMBLY</SymbolicName>
<Message>"Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context."</Message>
<Comment> Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131059">
<SymbolicName>COR_E_NI_AND_RUNTIME_VERSION_MISMATCH</SymbolicName>
<Message>"The native image could not be loaded, because it was generated for use by a different version of the runtime."</Message>
<Comment> The native image could not be loaded, because it was generated for use by a different version of the runtime. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131069">
<SymbolicName>COR_E_LOADING_WINMD_REFERENCE_ASSEMBLY</SymbolicName>
<Message>"Contract Windows Runtime assemblies cannot be loaded for execution. Make sure your application only contains non-contract Windows Runtime assemblies."</Message>
Expand Down Expand Up @@ -1290,24 +1188,6 @@
<Comment> The runtime cannot be suspened since a suspension is already in progress. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131401">
<SymbolicName>SECURITY_E_INCOMPATIBLE_SHARE</SymbolicName>
<Message>"Loading this assembly would produce a different grant set from other instances."</Message>
<Comment> Loading this assembly would produce a different grant set from other instances </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131402">
<SymbolicName>SECURITY_E_UNVERIFIABLE</SymbolicName>
<Message>"Unverifiable code failed policy check."</Message>
<Comment> Unverifable code failed policy check </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131403">
<SymbolicName>SECURITY_E_INCOMPATIBLE_EVIDENCE</SymbolicName>
<Message>"Assembly already loaded without additional security evidence."</Message>
<Comment> Assembly already loaded without additional security evidence. </Comment>
</HRESULT>

<HRESULT NumericValue="0x80131416">
<SymbolicName>CORSEC_E_POLICY_EXCEPTION</SymbolicName>
<Message>"PolicyException thrown."</Message>
Expand Down Expand Up @@ -1338,12 +1218,6 @@
<Comment> Strong name validation failed </Comment>
</HRESULT>

<HRESULT NumericValue="0x8013141b">
<SymbolicName>CORSEC_E_MISSING_STRONGNAME</SymbolicName>
<Message>"Assembly is not strong named."</Message>
<Comment> Assembly is not strong named </Comment>
</HRESULT>

<HRESULT NumericValue="0x8013141d">
<SymbolicName>CORSEC_E_INVALID_IMAGE_FORMAT</SymbolicName>
<Message>"Invalid assembly file format."</Message>
Expand Down Expand Up @@ -2177,12 +2051,6 @@
<Comment>Failure when calling a data target method.</Comment>
</HRESULT>

<HRESULT NumericValue="0x80131c64">
<SymbolicName>CORDBG_E_NO_IMAGE_AVAILABLE</SymbolicName>
<Message>"Couldn't find a native image."</Message>
<Comment>Couldn't find a native image.</Comment>
</HRESULT>

<HRESULT NumericValue="0x80131c68">
<SymbolicName>CORDBG_E_UNSUPPORTED_DELEGATE</SymbolicName>
<Message>"The delegate contains a delegate currently not supported by the API."</Message>
Expand Down Expand Up @@ -2247,24 +2115,6 @@
<Comment>Returned by binders that bind based on type identity.</Comment>
</HRESULT>

<HRESULT NumericValue="0x80132006">
<SymbolicName>CLR_E_BIND_SYS_ASM_NI_MISSING</SymbolicName>
<Message>"Could not use native image because System.Private.CoreLib.dll is missing a native image"</Message>
<Comment>Returned when loading an assembly that only has a native image and no IL and cannot hardbind to System.Private.CoreLib.ni.dll.</Comment>
</HRESULT>

<HRESULT NumericValue="0x80132007">
<SymbolicName>CLR_E_BIND_NI_SECURITY_FAILURE</SymbolicName>
<Message>"Native image was generated in a different trust level than present at runtime"</Message>
<Comment>Returned when an assembly is NGened in full trust and then used in partial trust or vice versa.</Comment>
</HRESULT>

<HRESULT NumericValue="0x80132008">
<SymbolicName>CLR_E_BIND_NI_DEP_IDENTITY_MISMATCH</SymbolicName>
<Message>"Native image identity mismatch with respect to its dependencies"</Message>
<Comment>Returned when an assembly's identities have changed so the native image is no longer valid.</Comment>
</HRESULT>

<HRESULT NumericValue="0x80132009">
<SymbolicName>CLR_E_GC_OOM</SymbolicName>
<Message>"Failfast due to an OOM during a GC"</Message>
Expand Down
Loading

0 comments on commit 5135336

Please sign in to comment.