未验证 提交 e54e7ac7 编写于 作者: J Jeremy Koritzinsky 提交者: GitHub

Remove code that is only applicable to emitting mscorlib.dll for .NET Framework (#92034)

* Remove code that is only applicable to emitting mscorlib.dll for .NET Framework

These code blocks only apply to compiling/emitting the core library with a GUID (which we only do in .NET Framework) and a custom module name (which we only do in .NET Framework). Additionally, we build SPCL with Roslyn, so even then these code-paths are dead.

* Remove dead GUIDs
上级 d34ed289
......@@ -23,35 +23,6 @@
extern "C" {
#endif
// {BED7F4EA-1A96-11d2-8F08-00A0C9A6186D}
EXTERN_GUID(LIBID_ComPlusRuntime, 0xbed7f4ea, 0x1a96, 0x11d2, 0x8f, 0x8, 0x0, 0xa0, 0xc9, 0xa6, 0x18, 0x6d);
// {90883F05-3D28-11D2-8F17-00A0C9A6186D}
EXTERN_GUID(GUID_ExportedFromComPlus, 0x90883f05, 0x3d28, 0x11d2, 0x8f, 0x17, 0x0, 0xa0, 0xc9, 0xa6, 0x18, 0x6d);
// {0F21F359-AB84-41e8-9A78-36D110E6D2F9}
EXTERN_GUID(GUID_ManagedName, 0xf21f359, 0xab84, 0x41e8, 0x9a, 0x78, 0x36, 0xd1, 0x10, 0xe6, 0xd2, 0xf9);
// {54FC8F55-38DE-4703-9C4E-250351302B1C}
EXTERN_GUID(GUID_Function2Getter, 0x54fc8f55, 0x38de, 0x4703, 0x9c, 0x4e, 0x25, 0x3, 0x51, 0x30, 0x2b, 0x1c);
// CLSID_CorMetaDataDispenserRuntime: {1EC2DE53-75CC-11d2-9775-00A0C9B4D50C}
// Dispenser coclass for version 1.5 and 2.0 meta data. To get the "latest" bind
// to CLSID_MetaDataDispenser.
EXTERN_GUID(CLSID_CorMetaDataDispenserRuntime, 0x1ec2de53, 0x75cc, 0x11d2, 0x97, 0x75, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);
// {CD2BC5C9-F452-4326-B714-F9C539D4DA58}
EXTERN_GUID(GUID_DispIdOverride, 0xcd2bc5c9, 0xf452, 0x4326, 0xb7, 0x14, 0xf9, 0xc5, 0x39, 0xd4, 0xda, 0x58);
// {B64784EB-D8D4-4d9b-9ACD-0E30806426F7}
EXTERN_GUID(GUID_ForceIEnumerable, 0xb64784eb, 0xd8d4, 0x4d9b, 0x9a, 0xcd, 0x0e, 0x30, 0x80, 0x64, 0x26, 0xf7);
// {2941FF83-88D8-4F73-B6A9-BDF8712D000D}
EXTERN_GUID(GUID_PropGetCA, 0x2941ff83, 0x88d8, 0x4f73, 0xb6, 0xa9, 0xbd, 0xf8, 0x71, 0x2d, 0x00, 0x0d);
// {29533527-3683-4364-ABC0-DB1ADD822FA2}
EXTERN_GUID(GUID_PropPutCA, 0x29533527, 0x3683, 0x4364, 0xab, 0xc0, 0xdb, 0x1a, 0xdd, 0x82, 0x2f, 0xa2);
// CLSID_CLR_v1_MetaData: {005023CA-72B1-11D3-9FC4-00C04F79A0A3}
// Used to generate v1 metadata (for v1.0 and v1.1 CLR compatibility).
EXTERN_GUID(CLSID_CLR_v1_MetaData, 0x005023ca, 0x72b1, 0x11d3, 0x9f, 0xc4, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);
......@@ -166,18 +137,6 @@ EXTERN_GUID(CLSID_Cor, 0xbee00010, 0xee77, 0x11d0, 0xa0, 0x15, 0x00, 0xc0, 0x4f,
// dispenser on the machine.
EXTERN_GUID(CLSID_CorMetaDataDispenser, 0xe5cb7a31, 0x7512, 0x11d2, 0x89, 0xce, 0x0, 0x80, 0xc7, 0x92, 0xe5, 0xd8);
// CLSID_CorMetaDataDispenserReg: {435755FF-7397-11d2-9771-00A0C9B4D50C}
// Dispenser coclass for version 1.0 meta data. To get the "latest" bind
// to CLSID_CorMetaDataDispenser.
EXTERN_GUID(CLSID_CorMetaDataDispenserReg, 0x435755ff, 0x7397, 0x11d2, 0x97, 0x71, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);
// CLSID_CorMetaDataReg: {87F3A1F5-7397-11d2-9771-00A0C9B4D50C}
// For COM+ Meta Data, Data Driven Registration
EXTERN_GUID(CLSID_CorMetaDataReg, 0x87f3a1f5, 0x7397, 0x11d2, 0x97, 0x71, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);
interface IMetaDataDispenser;
//-------------------------------------
......
......@@ -16,9 +16,6 @@
#include "strongnameinternal.h"
#include "sstring.h"
#define COM_RUNTIME_LIBRARY "ComRuntimeLibrary"
//*******************************************************************************
// Find the MethodSpec by Method and Instantiation
//*******************************************************************************
......@@ -2477,7 +2474,6 @@ ImportHelper::ImportTypeDef(
LPCUTF8 szModuleImport;
mdToken tkOuterRes = mdTokenNil;
HRESULT hr = S_OK;
BOOL bBCL = false;
_ASSERTE(pMiniMdEmit && pCommonImport && ptkType);
_ASSERTE(TypeFromToken(tdImport) == mdtTypeDef && tdImport != mdTypeDefNil);
......@@ -2494,43 +2490,7 @@ ImportHelper::ImportTypeDef(
}
IfFailGo(static_cast<IMetaModelCommon*>(pMiniMdEmit)->CommonGetScopeProps(0, &MvidEmit));
if (pCommonAssemImport == NULL && strcmp(szModuleImport, COM_RUNTIME_LIBRARY) == 0)
{
const BYTE *pBlob; // Blob with dispid.
ULONG cbBlob; // Length of blob.
WCHAR wzBlob[40]; // Wide char format of guid.
int ix; // Loop control.
hr = pCommonImport->CommonGetCustomAttributeByName(1, INTEROP_GUID_TYPE, (const void **)&pBlob, &cbBlob);
if (hr != S_FALSE)
{
// Should be in format. Total length == 41
// <0x0001><0x24>01234567-0123-0123-0123-001122334455<0x0000>
if ((cbBlob == 41) || (GET_UNALIGNED_VAL16(pBlob) == 1))
{
for (ix=1; ix<=36; ++ix)
wzBlob[ix] = pBlob[ix+2];
wzBlob[0] = '{';
wzBlob[37] = '}';
wzBlob[38] = 0;
// It's ok that we ignore the hr here. It's not needed, but I
// don't want to remove it in case a code analysis tool will complain
// about not capturing return codes.
hr = LPCWSTRToGuid(wzBlob, &GuidImport) ? S_OK : E_FAIL;
}
}
bBCL = (GuidImport == LIBID_ComPlusRuntime);
}
// Compute the ResolutionScope for the imported type.
if (bBCL)
{
// This is the case that we are referring to SPCL but client does not provide the manifest for
// SPCL!! Do not generate ModuleRef to the SPCL. But instead we should just leave the
// ResolutionScope empty
tkOuterRes = mdTokenNil;
}
else if (MvidAssemImport == MvidAssemEmit && MvidImport == MvidEmit)
if (MvidAssemImport == MvidAssemEmit && MvidImport == MvidEmit)
{
// The TypeDef is in the same Assembly and the Same scope.
if (bReturnTd)
......@@ -2979,9 +2939,6 @@ HRESULT ImportHelper::CreateModuleRefFromScope( // S_OK or error.
*ptkModuleRef = TokenFromRid(iRecordEmit, mdtModuleRef);
IfFailGo(pMiniMdEmit->UpdateENCLog(*ptkModuleRef));
// It is a bug to create an ModuleRef to SPCL
_ASSERTE(strcmp(szName, COM_RUNTIME_LIBRARY) != 0);
// Set the name of ModuleRef.
IfFailGo(pMiniMdEmit->PutString(TBL_ModuleRef, ModuleRefRec::COL_Name,
pRecordEmit, szName));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册