Skip to content

Commit

Permalink
Remove unused CLR_E_BIND_* errors (dotnet#91488)
Browse files Browse the repository at this point in the history
  • Loading branch information
elinor-fung authored Sep 5, 2023
1 parent 6de0e22 commit 34b6fec
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 57 deletions.
36 changes: 0 additions & 36 deletions src/coreclr/inc/corerror.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2067,42 +2067,6 @@
<SymbolicName>CLDB_E_INTERNALERROR</SymbolicName>
</HRESULT>

<HRESULT NumericValue="0x80132000">
<SymbolicName>CLR_E_BIND_ASSEMBLY_VERSION_TOO_LOW</SymbolicName>
<Message>"The bound assembly has a version that is lower than that of the request."</Message>
<Comment>For AppX binder, indicates that bound assembly has a version lower than that requested, and we will refuse version rollback.</Comment>
</HRESULT>

<HRESULT NumericValue="0x80132001">
<SymbolicName>CLR_E_BIND_ASSEMBLY_PUBLIC_KEY_MISMATCH</SymbolicName>
<Message>"The assembly version has a public key token that does not match that of the request."</Message>
<Comment>For AppX binder, indicates that bound assembly's public key token doesn't match the key in the assembly name.</Comment>
</HRESULT>

<HRESULT NumericValue="0x80132002">
<SymbolicName>CLR_E_BIND_IMAGE_UNAVAILABLE</SymbolicName>
<Message>"The requested image was not found or is unavailable."</Message>
<Comment>Occurs if a request for a native image is made on an BINDER_SPACE::Assembly interface when one is not available.</Comment>
</HRESULT>

<HRESULT NumericValue="0x80132003">
<SymbolicName>CLR_E_BIND_UNRECOGNIZED_IDENTITY_FORMAT</SymbolicName>
<Message>"The provided identity format is not recognized."</Message>
<Comment>If a binder is provided an identity format that it cannot parse, it returns this error.</Comment>
</HRESULT>

<HRESULT NumericValue="0x80132004">
<SymbolicName>CLR_E_BIND_ASSEMBLY_NOT_FOUND</SymbolicName>
<Message>"A binding for the specified assembly name was not found."</Message>
<Comment>Returned by binders that bind based on assembly identity.</Comment>
</HRESULT>

<HRESULT NumericValue="0x80132005">
<SymbolicName>CLR_E_BIND_TYPE_NOT_FOUND</SymbolicName>
<Message>"A binding for the specified type name was not found."</Message>
<Comment>Returned by binders that bind based on type identity.</Comment>
</HRESULT>

<HRESULT NumericValue="0x80132006">
<SymbolicName>CLR_E_BIND_ARCHITECTURE_MISMATCH</SymbolicName>
<Message>"The assembly architecture is not compatible with the current process architecture."</Message>
Expand Down
6 changes: 0 additions & 6 deletions src/coreclr/pal/prebuilt/corerror/mscorurt.rc
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,6 @@ BEGIN
MSG_FOR_URT_HR(CORDBG_E_ASSEMBLY_UPDATES_APPLIED) "The operation is not supported because assembly updates have been applied."
MSG_FOR_URT_HR(PEFMT_E_64BIT) "File is PE32+."
MSG_FOR_URT_HR(PEFMT_E_32BIT) "File is PE32"
MSG_FOR_URT_HR(CLR_E_BIND_ASSEMBLY_VERSION_TOO_LOW) "The bound assembly has a version that is lower than that of the request."
MSG_FOR_URT_HR(CLR_E_BIND_ASSEMBLY_PUBLIC_KEY_MISMATCH) "The assembly version has a public key token that does not match that of the request."
MSG_FOR_URT_HR(CLR_E_BIND_IMAGE_UNAVAILABLE) "The requested image was not found or is unavailable."
MSG_FOR_URT_HR(CLR_E_BIND_UNRECOGNIZED_IDENTITY_FORMAT) "The provided identity format is not recognized."
MSG_FOR_URT_HR(CLR_E_BIND_ASSEMBLY_NOT_FOUND) "A binding for the specified assembly name was not found."
MSG_FOR_URT_HR(CLR_E_BIND_TYPE_NOT_FOUND) "A binding for the specified type name was not found."
MSG_FOR_URT_HR(CLR_E_BIND_ARCHITECTURE_MISMATCH) "The assembly architecture is not compatible with the current process architecture."
MSG_FOR_URT_HR(CLR_E_GC_OOM) "Failfast due to an OOM during a GC"
MSG_FOR_URT_HR(CLR_E_GC_BAD_AFFINITY_CONFIG) "GCHeapAffinitizeMask or GCHeapAffinitizeRanges didn't specify any CPUs the current process is affinitized to."
Expand Down
6 changes: 0 additions & 6 deletions src/coreclr/pal/prebuilt/inc/corerror.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,6 @@
#define PEFMT_E_64BIT EMAKEHR(0x1d02)
#define PEFMT_E_32BIT EMAKEHR(0x1d0b)
#define CLDB_E_INTERNALERROR EMAKEHR(0x1fff)
#define CLR_E_BIND_ASSEMBLY_VERSION_TOO_LOW EMAKEHR(0x2000)
#define CLR_E_BIND_ASSEMBLY_PUBLIC_KEY_MISMATCH EMAKEHR(0x2001)
#define CLR_E_BIND_IMAGE_UNAVAILABLE EMAKEHR(0x2002)
#define CLR_E_BIND_UNRECOGNIZED_IDENTITY_FORMAT EMAKEHR(0x2003)
#define CLR_E_BIND_ASSEMBLY_NOT_FOUND EMAKEHR(0x2004)
#define CLR_E_BIND_TYPE_NOT_FOUND EMAKEHR(0x2005)
#define CLR_E_BIND_ARCHITECTURE_MISMATCH EMAKEHR(0x2006)
#define CLR_E_GC_OOM EMAKEHR(0x2009)
#define CLR_E_GC_BAD_AFFINITY_CONFIG EMAKEHR(0x200a)
Expand Down
9 changes: 6 additions & 3 deletions src/coreclr/vm/assembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1634,11 +1634,14 @@ OBJECTREF Assembly::GetExposedObject()
BOOL Assembly::FileNotFound(HRESULT hr)
{
LIMITED_METHOD_CONTRACT;
return IsHRESULTForExceptionKind(hr, kFileNotFoundException) ||
if (IsHRESULTForExceptionKind(hr, kFileNotFoundException))
return TRUE;

#ifdef FEATURE_COMINTEROP
(hr == RO_E_METADATA_NAME_NOT_FOUND) ||
return hr == RO_E_METADATA_NAME_NOT_FOUND;
#else
return FALSE;
#endif //FEATURE_COMINTEROP
(hr == CLR_E_BIND_TYPE_NOT_FOUND);
}


Expand Down
1 change: 1 addition & 0 deletions src/coreclr/vm/excep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5778,6 +5778,7 @@ extern "C" void QCALLTYPE FileLoadException_GetMessageForHR(UINT32 hresult, QCal
case COR_E_BADIMAGEFORMAT:
case COR_E_NEWER_RUNTIME:
case COR_E_ASSEMBLYEXPECTED:
case CLR_E_BIND_ARCHITECTURE_MISMATCH:
bNoGeekStuff = TRUE;
break;
}
Expand Down
10 changes: 4 additions & 6 deletions src/coreclr/vm/rexcep.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ DEFINE_EXCEPTION(g_SystemNS, ApplicationException, false, C
DEFINE_EXCEPTION(g_SystemNS, ArithmeticException, false, COR_E_ARITHMETIC)

DEFINE_EXCEPTION(g_SystemNS, ArgumentException, false,
COR_E_ARGUMENT, STD_CTL_SCODE(449), STD_CTL_SCODE(450), CLR_E_BIND_UNRECOGNIZED_IDENTITY_FORMAT)
COR_E_ARGUMENT, STD_CTL_SCODE(449), STD_CTL_SCODE(450))

DEFINE_EXCEPTION(g_SystemNS, ArgumentOutOfRangeException, false, COR_E_ARGUMENTOUTOFRANGE, HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION))
DEFINE_EXCEPTION(g_SystemNS, ArrayTypeMismatchException, false, COR_E_ARRAYTYPEMISMATCH)
Expand Down Expand Up @@ -144,7 +144,7 @@ DEFINE_EXCEPTION(g_SystemNS, FieldAccessException, false, C
DEFINE_EXCEPTION(g_IONS, FileLoadException, true,
COR_E_FILELOAD,
FUSION_E_INVALID_NAME,
FUSION_E_PRIVATE_ASM_DISALLOWED,
FUSION_E_PRIVATE_ASM_DISALLOWED,
FUSION_E_REF_DEF_MISMATCH,
HRESULT_FROM_WIN32(ERROR_TOO_MANY_OPEN_FILES),
HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), HRESULT_FROM_WIN32(ERROR_LOCK_VIOLATION),
Expand All @@ -162,9 +162,7 @@ DEFINE_EXCEPTION(g_IONS, FileNotFoundException, true,
HRESULT_FROM_WIN32(ERROR_WRONG_TARGET_NAME), INET_E_UNKNOWN_PROTOCOL,
INET_E_CONNECTION_TIMEOUT, INET_E_CANNOT_CONNECT, INET_E_RESOURCE_NOT_FOUND,
INET_E_OBJECT_NOT_FOUND, INET_E_DOWNLOAD_FAILURE, INET_E_DATA_NOT_AVAILABLE,
HRESULT_FROM_WIN32(ERROR_DLL_NOT_FOUND),
CLR_E_BIND_ASSEMBLY_VERSION_TOO_LOW, CLR_E_BIND_ASSEMBLY_PUBLIC_KEY_MISMATCH,
CLR_E_BIND_ASSEMBLY_NOT_FOUND)
HRESULT_FROM_WIN32(ERROR_DLL_NOT_FOUND))

DEFINE_EXCEPTION(g_SystemNS, FormatException, false, COR_E_FORMAT)

Expand Down Expand Up @@ -250,7 +248,7 @@ DEFINE_EXCEPTION(g_SystemNS, TypeInitializationException, false, C

#ifdef FEATURE_COMINTEROP
DEFINE_EXCEPTION(g_SystemNS, TypeLoadException, false, COR_E_TYPELOAD,
RO_E_METADATA_NAME_NOT_FOUND, CLR_E_BIND_TYPE_NOT_FOUND)
RO_E_METADATA_NAME_NOT_FOUND)
#else
DEFINE_EXCEPTION(g_SystemNS, TypeLoadException, false, COR_E_TYPELOAD)
#endif
Expand Down

0 comments on commit 34b6fec

Please sign in to comment.