#include <new> // placement new
#endif // _WIN32
-
using OBJECTHANDLE = InteropLib::OBJECTHANDLE;
using AllocScenario = InteropLibImports::AllocScenario;
using TryInvokeICustomQueryInterfaceResult = InteropLibImports::TryInvokeICustomQueryInterfaceResult;
// 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
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
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,
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)
using CreateObjectFlags = InteropLib::Com::CreateObjectFlags;
using CreateComInterfaceFlags = InteropLib::Com::CreateComInterfaceFlags;
-
namespace
{
-
void* GetCurrentCtxCookieWrapper()
{
STATIC_CONTRACT_WRAPPER;
#else
return NULL;
#endif // FEATURE_COMINTEROP_APARTMENT_SUPPORT
-
}
// This class is used to track the external object within the runtime.
else
#endif
{
-#ifdef FEATURE_COMWRAPPERS
+#ifdef FEATURE_COMWRAPPERS
pWeakReferenceSource = reinterpret_cast<IWeakReferenceSource*>(ComWrappersNative::GetIdentityForObject(pObject, IID_IWeakReferenceSource, &wrapperId));
-#endif
+#endif
}
-
if (pWeakReferenceSource == nullptr)
{
return nullptr;
NewHolder<NativeComWeakHandleInfo> comWeakHandleInfo(GetComWeakReferenceInfo(&target));
#endif // FEATURE_COMINTEROP || FEATURE_COMWRAPPERS
-
WeakHandleSpinLockHolder handle(AcquireWeakHandleSpinLock(weakReference), &weakReference);
GCX_NOTRIGGER();