diff options
Diffstat (limited to 'src/inc')
-rw-r--r-- | src/inc/MSCOREE.IDL | 18 | ||||
-rw-r--r-- | src/inc/arrayholder.h | 80 | ||||
-rw-r--r-- | src/inc/corhost.h | 5 | ||||
-rw-r--r-- | src/inc/corinfo.h | 3 | ||||
-rw-r--r-- | src/inc/releaseholder.h | 77 | ||||
-rw-r--r-- | src/inc/utilcode.h | 12 |
6 files changed, 187 insertions, 8 deletions
diff --git a/src/inc/MSCOREE.IDL b/src/inc/MSCOREE.IDL index 97e2f2aca6..53d4ce3bb0 100644 --- a/src/inc/MSCOREE.IDL +++ b/src/inc/MSCOREE.IDL @@ -86,6 +86,9 @@ cpp_quote("EXTERN_GUID(IID_ICLRRuntimeHost, 0x90F1A06C, 0x7712, 0x4762, 0x86, 0x // IID ICLRRuntimeHost2: uuid(712AB73F-2C22-4807-AD7E-F501D7B72C2D) cpp_quote("EXTERN_GUID(IID_ICLRRuntimeHost2, 0x712AB73F, 0x2C22, 0x4807, 0xAD, 0x7E, 0xF5, 0x01, 0xD7, 0xb7, 0x2C, 0x2D);") +// IID ICLRRuntimeHost4: uuid(64F6D366-D7C2-4F1F-B4B2-E8160CAC43AF) +cpp_quote("EXTERN_GUID(IID_ICLRRuntimeHost4, 0x64F6D366, 0xD7C2, 0x4F1F, 0xB4, 0xB2, 0xE8, 0x16, 0x0C, 0xAC, 0x43, 0xAF);") + // IID IID_ICLRExecutionManager: uuid(1000A3E7-B420-4620-AE30-FB19B587AD1D) cpp_quote("EXTERN_GUID(IID_ICLRExecutionManager, 0x1000A3E7, 0xB420, 0x4620, 0xAE, 0x30, 0xFB, 0x19, 0xB5, 0x87, 0xAD, 0x1D);") @@ -848,6 +851,21 @@ interface ICLRRuntimeHost2 : ICLRRuntimeHost }; [ + object, + uuid(64F6D366-D7C2-4F1F-B4B2-E8160CAC43AF), + version(4.0), + helpstring("Common Language Runtime Hosting Interface"), + pointer_default(unique), + local +] +interface ICLRRuntimeHost4 : ICLRRuntimeHost2 +{ + HRESULT UnloadAppDomain2([in] DWORD dwAppDomainId, + [in] BOOL fWaitUntilDone, + [out] int *pLatchedExitCode); +}; + +[ uuid(1000A3E7-B420-4620-AE30-FB19B587AD1D), version(1.0), helpstring("Pause and Resume Interface"), diff --git a/src/inc/arrayholder.h b/src/inc/arrayholder.h new file mode 100644 index 0000000000..681014fc95 --- /dev/null +++ b/src/inc/arrayholder.h @@ -0,0 +1,80 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +template <class T> +class ArrayHolder +{ +public: + ArrayHolder(T *ptr) + : m_ptr(ptr) + { + } + + ~ArrayHolder() + { + Clear(); + } + + ArrayHolder(const ArrayHolder &rhs) + { + m_ptr = const_cast<ArrayHolder *>(&rhs)->Detach(); + } + + ArrayHolder &operator=(T *ptr) + { + Clear(); + m_ptr = ptr; + return *this; + } + + const T &operator[](int i) const + { + return m_ptr[i]; + } + + T &operator[](int i) + { + return m_ptr[i]; + } + + operator const T *() const + { + return m_ptr; + } + + operator T *() + { + return m_ptr; + } + + T **operator&() + { + return &m_ptr; + } + + T *GetPtr() + { + return m_ptr; + } + + T *Detach() + { + T *ret = m_ptr; + m_ptr = NULL; + return ret; + } + +private: + void Clear() + { + if (m_ptr) + { + delete [] m_ptr; + m_ptr = NULL; + } + } + +private: + T *m_ptr; +}; diff --git a/src/inc/corhost.h b/src/inc/corhost.h index 3aabe9ed5d..59ab23cd27 100644 --- a/src/inc/corhost.h +++ b/src/inc/corhost.h @@ -137,6 +137,7 @@ protected: STDMETHODIMP UnloadAppDomain(DWORD dwDomainId, BOOL fWaitUntilDone); + STDMETHODIMP UnloadAppDomain2(DWORD dwDomainId, BOOL fWaitUntilDone, int *pLatchedExitCode); public: static ULONG GetHostVersion() { @@ -275,7 +276,7 @@ class CorHost2 : #ifndef FEATURE_PAL , public IPrivateManagedExceptionReporting /* This interface is for internal Watson testing only*/ #endif // FEATURE_PAL - , public ICLRRuntimeHost2 + , public ICLRRuntimeHost4 , public CorExecutionManager { friend struct _DacGlobals; @@ -337,6 +338,8 @@ public: STDMETHODIMP UnloadAppDomain(DWORD dwDomainId, BOOL fWaitUntilDone); + STDMETHODIMP UnloadAppDomain2(DWORD dwDomainId, BOOL fWaitUntilDone, int *pLatchedExitCode); + STDMETHODIMP GetCurrentAppDomainId(DWORD *pdwAppDomainId); STDMETHODIMP ExecuteApplication(LPCWSTR pwzAppFullName, diff --git a/src/inc/corinfo.h b/src/inc/corinfo.h index cbc4464e1d..97f395800e 100644 --- a/src/inc/corinfo.h +++ b/src/inc/corinfo.h @@ -213,7 +213,6 @@ TODO: Talk about initializing strutures before use #define SELECTANY extern __declspec(selectany) #endif -// Update this one SELECTANY const GUID JITEEVersionIdentifier = { /* f00b3f49-ddd2-49be-ba43-6e49ffa66959 */ 0xf00b3f49, 0xddd2, @@ -959,6 +958,8 @@ enum CorInfoIntrinsics CORINFO_INTRINSIC_GetManagedThreadId, CORINFO_INTRINSIC_ByReference_Ctor, CORINFO_INTRINSIC_ByReference_Value, + CORINFO_INTRINSIC_Span_GetItem, + CORINFO_INTRINSIC_ReadOnlySpan_GetItem, CORINFO_INTRINSIC_Count, CORINFO_INTRINSIC_Illegal = -1, // Not a true intrinsic, diff --git a/src/inc/releaseholder.h b/src/inc/releaseholder.h new file mode 100644 index 0000000000..b2c42e3928 --- /dev/null +++ b/src/inc/releaseholder.h @@ -0,0 +1,77 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// This class acts a smart pointer which calls the Release method on any object +// you place in it when the ReleaseHolder class falls out of scope. You may use it +// just like you would a standard pointer to a COM object (including if (foo), +// if (!foo), if (foo == 0), etc) except for two caveats: +// 1. This class never calls AddRef and it always calls Release when it +// goes out of scope. +// 2. You should never use & to try to get a pointer to a pointer unless +// you call Release first, or you will leak whatever this object contains +// prior to updating its internal pointer. +template<class T> +class ReleaseHolder +{ +public: + ReleaseHolder() + : m_ptr(NULL) + {} + + ReleaseHolder(T* ptr) + : m_ptr(ptr) + {} + + ~ReleaseHolder() + { + Release(); + } + + void operator=(T *ptr) + { + Release(); + + m_ptr = ptr; + } + + T* operator->() + { + return m_ptr; + } + + operator T*() + { + return m_ptr; + } + + T** operator&() + { + return &m_ptr; + } + + T* GetPtr() const + { + return m_ptr; + } + + T* Detach() + { + T* pT = m_ptr; + m_ptr = NULL; + return pT; + } + + void Release() + { + if (m_ptr != NULL) + { + m_ptr->Release(); + m_ptr = NULL; + } + } + +private: + T* m_ptr; +}; + diff --git a/src/inc/utilcode.h b/src/inc/utilcode.h index 5394f1beb2..78dbf69226 100644 --- a/src/inc/utilcode.h +++ b/src/inc/utilcode.h @@ -1380,7 +1380,7 @@ public: static BOOL CanEnableGCNumaAware(); static void InitNumaNodeInfo(); -#if !defined(FEATURE_REDHAWK)&& !defined(FEATURE_PAL) +#if !defined(FEATURE_REDHAWK) private: // apis types //GetNumaHighestNodeNumber() @@ -1448,7 +1448,7 @@ public: static DWORD CalculateCurrentProcessorNumber(); //static void PopulateCPUUsageArray(void * infoBuffer, ULONG infoSize); -#if !defined(FEATURE_REDHAWK) && !defined(FEATURE_PAL) +#if !defined(FEATURE_REDHAWK) private: //GetLogicalProcessorInforomationEx() typedef BOOL @@ -5109,9 +5109,9 @@ BOOL IsIPInModule(HMODULE_TGT hModule, PCODE ip); //---------------------------------------------------------------------------------------- struct CoreClrCallbacks { - typedef IExecutionEngine* (__stdcall * pfnIEE_t)(); - typedef HRESULT (__stdcall * pfnGetCORSystemDirectory_t)(SString& pbuffer); - typedef void* (__stdcall * pfnGetCLRFunction_t)(LPCSTR functionName); + typedef IExecutionEngine* (* pfnIEE_t)(); + typedef HRESULT (* pfnGetCORSystemDirectory_t)(SString& pbuffer); + typedef void* (* pfnGetCLRFunction_t)(LPCSTR functionName); HINSTANCE m_hmodCoreCLR; pfnIEE_t m_pfnIEE; @@ -5516,6 +5516,6 @@ extern SpinConstants g_SpinConstants; // ====================================================================================== -void* __stdcall GetCLRFunction(LPCSTR FunctionName); +void* GetCLRFunction(LPCSTR FunctionName); #endif // __UtilCode_h__ |