From 017e701748a61613bd2e86ded89e50bf6bf877ff Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Thu, 5 Aug 2021 12:44:13 -0700 Subject: [PATCH] Rename interoplibinterface.cpp -> interoplibinterface_comwrappers.cpp (#56921) --- src/coreclr/interop/comwrappers.cpp | 1 - src/coreclr/interop/referencetrackertypes.hpp | 4 +-- src/coreclr/interop/trackerobjectmanager.cpp | 7 +++-- src/coreclr/vm/CMakeLists.txt | 31 +++++++++++----------- ...ace.cpp => interoplibinterface_comwrappers.cpp} | 3 --- src/coreclr/vm/weakreferencenative.cpp | 6 ++--- 6 files changed, 22 insertions(+), 30 deletions(-) rename src/coreclr/vm/{interoplibinterface.cpp => interoplibinterface_comwrappers.cpp} (99%) diff --git a/src/coreclr/interop/comwrappers.cpp b/src/coreclr/interop/comwrappers.cpp index a4afa67..5600b6a 100644 --- a/src/coreclr/interop/comwrappers.cpp +++ b/src/coreclr/interop/comwrappers.cpp @@ -9,7 +9,6 @@ #include // placement new #endif // _WIN32 - using OBJECTHANDLE = InteropLib::OBJECTHANDLE; using AllocScenario = InteropLibImports::AllocScenario; using TryInvokeICustomQueryInterfaceResult = InteropLibImports::TryInvokeICustomQueryInterfaceResult; diff --git a/src/coreclr/interop/referencetrackertypes.hpp b/src/coreclr/interop/referencetrackertypes.hpp index 6e703a9..ba5adc8 100644 --- a/src/coreclr/interop/referencetrackertypes.hpp +++ b/src/coreclr/interop/referencetrackertypes.hpp @@ -8,7 +8,7 @@ // Documentation found at https://docs.microsoft.com/windows/win32/api/windows.ui.xaml.hosting.referencetracker/ -//64bd43f8-bfee-4ec4-b7eb-2935158dae21 +// 64bd43f8-bfee-4ec4-b7eb-2935158dae21 const GUID IID_IReferenceTrackerTarget = { 0x64bd43f8, 0xbfee, 0x4ec4, { 0xb7, 0xeb, 0x29, 0x35, 0x15, 0x8d, 0xae, 0x21} }; class DECLSPEC_UUID("64bd43f8-bfee-4ec4-b7eb-2935158dae21") IReferenceTrackerTarget : public IUnknown @@ -46,7 +46,7 @@ public: STDMETHOD(FoundTrackerTarget)(_In_ IReferenceTrackerTarget* target) = 0; }; -//11d3b13a-180e-4789-a8be-7712882893e6 +// 11d3b13a-180e-4789-a8be-7712882893e6 const GUID IID_IReferenceTracker = { 0x11d3b13a, 0x180e, 0x4789, { 0xa8, 0xbe, 0x77, 0x12, 0x88, 0x28, 0x93, 0xe6} }; class DECLSPEC_UUID("11d3b13a-180e-4789-a8be-7712882893e6") IReferenceTracker : public IUnknown diff --git a/src/coreclr/interop/trackerobjectmanager.cpp b/src/coreclr/interop/trackerobjectmanager.cpp index 6f4bebc..0a199b7 100644 --- a/src/coreclr/interop/trackerobjectmanager.cpp +++ b/src/coreclr/interop/trackerobjectmanager.cpp @@ -9,14 +9,13 @@ using RuntimeCallContext = InteropLibImports::RuntimeCallContext; namespace { - - //29a71c6a-3c42-4416-a39d-e2825a07a773 + // 29a71c6a-3c42-4416-a39d-e2825a07a773 const GUID IID_IReferenceTrackerHost = { 0x29a71c6a, 0x3c42, 0x4416, { 0xa3, 0x9d, 0xe2, 0x82, 0x5a, 0x7, 0xa7, 0x73} }; - //3cf184b4-7ccb-4dda-8455-7e6ce99a3298 + // 3cf184b4-7ccb-4dda-8455-7e6ce99a3298 const GUID IID_IReferenceTrackerManager = { 0x3cf184b4, 0x7ccb, 0x4dda, { 0x84, 0x55, 0x7e, 0x6c, 0xe9, 0x9a, 0x32, 0x98} }; - //04b3486c-4687-4229-8d14-505ab584dd88 + // 04b3486c-4687-4229-8d14-505ab584dd88 const GUID IID_IFindReferenceTargetsCallback = { 0x04b3486c, 0x4687, 0x4229, { 0x8d, 0x14, 0x50, 0x5a, 0xb5, 0x84, 0xdd, 0x88} }; // In order to minimize the impact of a constructor running on module load, diff --git a/src/coreclr/vm/CMakeLists.txt b/src/coreclr/vm/CMakeLists.txt index d0f9652..5cb683b 100644 --- a/src/coreclr/vm/CMakeLists.txt +++ b/src/coreclr/vm/CMakeLists.txt @@ -562,23 +562,22 @@ list(APPEND VM_SOURCES_WKS list(APPEND VM_HEADERS_WKS interoplibinterface.h ) -if(FEATURE_COMWRAPPERS OR FEATURE_OBJCMARSHAL) - if (FEATURE_COMWRAPPERS) - list(APPEND VM_SOURCES_WKS - interoplibinterface.cpp - rcwrefcache.cpp - ) - list(APPEND VM_HEADERS_WKS - rcwrefcache.h - ) - endif (FEATURE_COMWRAPPERS) - if (FEATURE_OBJCMARSHAL) - list(APPEND VM_SOURCES_WKS - interoplibinterface_objc.cpp - ) - endif (FEATURE_OBJCMARSHAL) -endif(FEATURE_COMWRAPPERS OR FEATURE_OBJCMARSHAL) +if(FEATURE_COMWRAPPERS) + list(APPEND VM_SOURCES_WKS + interoplibinterface_comwrappers.cpp + rcwrefcache.cpp + ) + list(APPEND VM_HEADERS_WKS + rcwrefcache.h + ) +endif(FEATURE_COMWRAPPERS) + +if(FEATURE_OBJCMARSHAL) + list(APPEND VM_SOURCES_WKS + interoplibinterface_objc.cpp + ) +endif(FEATURE_OBJCMARSHAL) if(CLR_CMAKE_TARGET_WIN32) diff --git a/src/coreclr/vm/interoplibinterface.cpp b/src/coreclr/vm/interoplibinterface_comwrappers.cpp similarity index 99% rename from src/coreclr/vm/interoplibinterface.cpp rename to src/coreclr/vm/interoplibinterface_comwrappers.cpp index 746c228..030cabf 100644 --- a/src/coreclr/vm/interoplibinterface.cpp +++ b/src/coreclr/vm/interoplibinterface_comwrappers.cpp @@ -19,10 +19,8 @@ using CreateObjectFlags = InteropLib::Com::CreateObjectFlags; using CreateComInterfaceFlags = InteropLib::Com::CreateComInterfaceFlags; - namespace { - void* GetCurrentCtxCookieWrapper() { STATIC_CONTRACT_WRAPPER; @@ -32,7 +30,6 @@ namespace #else return NULL; #endif // FEATURE_COMINTEROP_APARTMENT_SUPPORT - } // This class is used to track the external object within the runtime. diff --git a/src/coreclr/vm/weakreferencenative.cpp b/src/coreclr/vm/weakreferencenative.cpp index 1354f35..ab2b6f9 100644 --- a/src/coreclr/vm/weakreferencenative.cpp +++ b/src/coreclr/vm/weakreferencenative.cpp @@ -148,12 +148,11 @@ NativeComWeakHandleInfo* GetComWeakReferenceInfo(OBJECTREF* pObject) else #endif { -#ifdef FEATURE_COMWRAPPERS +#ifdef FEATURE_COMWRAPPERS pWeakReferenceSource = reinterpret_cast(ComWrappersNative::GetIdentityForObject(pObject, IID_IWeakReferenceSource, &wrapperId)); -#endif +#endif } - if (pWeakReferenceSource == nullptr) { return nullptr; @@ -771,7 +770,6 @@ NOINLINE void SetWeakReferenceTarget(WEAKREFERENCEREF weakReference, OBJECTREF t NewHolder comWeakHandleInfo(GetComWeakReferenceInfo(&target)); #endif // FEATURE_COMINTEROP || FEATURE_COMWRAPPERS - WeakHandleSpinLockHolder handle(AcquireWeakHandleSpinLock(weakReference), &weakReference); GCX_NOTRIGGER(); -- 2.7.4