summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung Yoon Whang <suwhang@microsoft.com>2018-07-22 20:56:42 -0700
committerGitHub <noreply@github.com>2018-07-22 20:56:42 -0700
commitcc96914f80b6873c555d0ed377042537ef99f1af (patch)
tree026d241960b09179fd5132861763261e1f43f8d4
parent45f1ec9c4d91733c76868870ff85f2beafabdd39 (diff)
downloadcoreclr-cc96914f80b6873c555d0ed377042537ef99f1af.tar.gz
coreclr-cc96914f80b6873c555d0ed377042537ef99f1af.tar.bz2
coreclr-cc96914f80b6873c555d0ed377042537ef99f1af.zip
Enable profiler attach on Windows (#18762)
* try building clr with prof attach enabled * define ICLRProfiling interface * profattach.dll now builds with CreateCLRProfiling export * remove try catch * basic attach working now * build with profiler attach feature only on win * Fix linux build * cleanup * more cleanup * more cleanup * remove profattach dll * remove useless unix exports in mscorwks * remove profattach from dll cmakelist * Add back ifdef * cleanup * change LINUX to UNIX in clrdefinitions * Fix broken checked builds * Remove CLRProfilingClassFactory and metadata.h include from profattach.cpp * remove useless extern C * Add this back in * adding ifndef DACCESS_COMPILE * Try building with FWD define ICLRProfiling interface * Test commit - removing additional definition from metahost.h to see if this will pass CI runs * Address pr comments
-rw-r--r--clr.coreclr.props1
-rw-r--r--clr.defines.targets2
-rw-r--r--clrdefinitions.cmake4
-rw-r--r--src/dlls/mscoree/mscorwks_ntdef.src1
-rw-r--r--src/inc/corprof.idl22
-rw-r--r--src/inc/metahost.idl26
-rw-r--r--src/pal/prebuilt/inc/corprof.h297
-rw-r--r--src/pal/prebuilt/inc/metahost.h105
-rw-r--r--src/vm/profattach.cpp91
-rw-r--r--src/vm/profattach.h3
-rw-r--r--src/vm/profdetach.cpp2
11 files changed, 249 insertions, 305 deletions
diff --git a/clr.coreclr.props b/clr.coreclr.props
index 7c402c7f19..e4f2483f95 100644
--- a/clr.coreclr.props
+++ b/clr.coreclr.props
@@ -32,5 +32,6 @@
<FeatureCominteropApartmentSupport>true</FeatureCominteropApartmentSupport>
<FeatureAppX>true</FeatureAppX>
<FeatureWin32Registry>true</FeatureWin32Registry>
+ <FeatureProfAttach>true</FeatureProfAttach>
</PropertyGroup>
</Project> \ No newline at end of file
diff --git a/clr.defines.targets b/clr.defines.targets
index b9f159eb0c..04bfbda7fc 100644
--- a/clr.defines.targets
+++ b/clr.defines.targets
@@ -26,7 +26,7 @@
<DefineConstants Condition="'$(FeatureDefaultInterfaces)' == 'true'">$(DefineConstants);FEATURE_DEFAULT_INTERFACES</DefineConstants>
<DefineConstants Condition="'$(ProfilingSupportedBuild)' == 'true'">$(DefineConstants);PROFILING_SUPPORTED</DefineConstants>
-
+ <DefineConstants Condition="'$(FeatureProfAttach)' == 'true'">$(DefineConstants);FEATURE_PROFAPI_ATTACH_DETACH</DefineConstants>
<DefineConstants Condition="'$(TargetsUnix)' == 'true'">$(DefineConstants);PLATFORM_UNIX</DefineConstants>
<DefineConstants Condition="'$(TargetsWindows)' == 'true'">$(DefineConstants);PLATFORM_WINDOWS</DefineConstants>
diff --git a/clrdefinitions.cmake b/clrdefinitions.cmake
index ab77f70236..4f12e4b793 100644
--- a/clrdefinitions.cmake
+++ b/clrdefinitions.cmake
@@ -182,6 +182,10 @@ if(CLR_CMAKE_PLATFORM_LINUX)
endif(CLR_CMAKE_PLATFORM_LINUX)
add_definitions(-DFEATURE_PREJIT)
+if(NOT CLR_CMAKE_PLATFORM_UNIX)
+ add_definitions(-DFEATURE_PROFAPI_ATTACH_DETACH)
+endif(NOT CLR_CMAKE_PLATFORM_UNIX)
+
add_definitions(-DFEATURE_READYTORUN)
set(FEATURE_READYTORUN 1)
diff --git a/src/dlls/mscoree/mscorwks_ntdef.src b/src/dlls/mscoree/mscorwks_ntdef.src
index 8917836d72..c0670c2db3 100644
--- a/src/dlls/mscoree/mscorwks_ntdef.src
+++ b/src/dlls/mscoree/mscorwks_ntdef.src
@@ -32,3 +32,4 @@ EXPORTS
GetMetaDataInternalInterfaceFromPublic
GetMetaDataPublicInterfaceFromInternal
+ CreateCLRProfiling
diff --git a/src/inc/corprof.idl b/src/inc/corprof.idl
index f5da6e25a0..4f0cd6b961 100644
--- a/src/inc/corprof.idl
+++ b/src/inc/corprof.idl
@@ -3983,3 +3983,25 @@ interface ICorProfilerAssemblyReferenceProvider : IUnknown
// assembly specified in the wszAssemblyPath argument of the GetAssemblyReferences callback.
HRESULT AddAssemblyReference(const COR_PRF_ASSEMBLY_REFERENCE_INFO * pAssemblyRefInfo);
};
+
+
+/***************************************************************************************
+** ICLRProfiling **
+** Activated using mscoree!CLRCreateInstance. Export AttachProfiler API to profilers **
+***************************************************************************************/
+[
+ uuid(B349ABE3-B56F-4689-BFCD-76BF39D888EA),
+ version(1.0),
+ helpstring("CoreCLR profiling interface for profiler attach"),
+ local
+]
+interface ICLRProfiling : IUnknown
+{
+ HRESULT AttachProfiler(
+ [in] DWORD dwProfileeProcessID,
+ [in] DWORD dwMillisecondsMax, // optional
+ [in] const CLSID * pClsidProfiler,
+ [in] LPCWSTR wszProfilerPath, // optional
+ [in, size_is(cbClientData)] void * pvClientData, // optional
+ [in] UINT cbClientData); // optional
+}
diff --git a/src/inc/metahost.idl b/src/inc/metahost.idl
index 2bc7f1a3c9..4a430276da 100644
--- a/src/inc/metahost.idl
+++ b/src/inc/metahost.idl
@@ -87,9 +87,6 @@ cpp_quote("EXTERN_GUID(CLSID_CLRDebuggingLegacy, 0xDF8395B5, 0xA4BA, 0x450b, 0xA
// CLSID CLRProfiling interface : uuid{BD097ED8-733E-43fe-8ED7-A95FF9A8448C}
cpp_quote("EXTERN_GUID(CLSID_CLRProfiling, 0xbd097ed8, 0x733e, 0x43fe, 0x8e, 0xd7, 0xa9, 0x5f, 0xf9, 0xa8, 0x44, 0x8c);")
-// IID ICLRProfiling interface : uuid{B349ABE3-B56F-4689-BFCD-76BF39D888EA}
-cpp_quote("EXTERN_GUID(IID_ICLRProfiling, 0xb349abe3, 0xb56f, 0x4689, 0xbf, 0xcd, 0x76, 0xbf, 0x39, 0xd8, 0x88, 0xea);")
-
// IID ICLRDebuggingLibraryProvider interface : uuid{3151C08D-4D09-4f9b-8838-2880BF18FE51}
cpp_quote("EXTERN_GUID(IID_ICLRDebuggingLibraryProvider, 0x3151c08d, 0x4d09, 0x4f9b, 0x88, 0x38, 0x28, 0x80, 0xbf, 0x18, 0xfe, 0x51);")
@@ -333,27 +330,6 @@ interface ICLRMetaHostPolicy : IUnknown
[out, iid_is(riid), retval] LPVOID *ppRuntime);
} // interface ICLRMetaHostPolicy
-/***************************************************************************************
- ** ICLRProfiling **
- ** Activated using mscoree!CLRCreateInstance. Export AttachProfiler API to profilers **
- ***************************************************************************************/
-[
- uuid(B349ABE3-B56F-4689-BFCD-76BF39D888EA),
- version(1.0),
- helpstring("CLR profiling interface for MetaHost interface"),
- local
-]
-interface ICLRProfiling : IUnknown
-{
- HRESULT AttachProfiler(
- [in] DWORD dwProfileeProcessID,
- [in] DWORD dwMillisecondsMax, // optional
- [in] const CLSID * pClsidProfiler,
- [in] LPCWSTR wszProfilerPath, // optional
- [in, size_is(cbClientData)] void * pvClientData, // optional
- [in] UINT cbClientData); // optional
-}
-
/*************************************************************************************
** This structure defines the version of a CLR for debugging purposes. **
** The wStructVersion field allows for future revisions to this structure to be **
@@ -1099,7 +1075,6 @@ library CLRMetaHost
{
interface ICLRMetaHost;
interface ICLRMetaHostPolicy;
- interface ICLRProfiling;
interface ICLRDebuggingLibraryProvider;
interface ICLRDebugging;
interface ICLRRuntimeInfo;
@@ -1130,7 +1105,6 @@ library CLRMetaHost
// Scenario: Profiler attach for v4
// ICLRMetaHost::EnumerateLoadedRuntimes
- // ICLRRuntimeInfo::GetInterface(CLSID_CLRProfiling, IID_ICLRProfiling)
// Scenario: An installer needs to modify configuration of supported runtimes
// 1. ICLRMetaHost::EnumerateInstalledRuntimes
diff --git a/src/pal/prebuilt/inc/corprof.h b/src/pal/prebuilt/inc/corprof.h
index 5a4f8c37d6..0452914cb1 100644
--- a/src/pal/prebuilt/inc/corprof.h
+++ b/src/pal/prebuilt/inc/corprof.h
@@ -195,7 +195,7 @@ typedef interface ICorProfilerInfo8 ICorProfilerInfo8;
#define __ICorProfilerInfo9_FWD_DEFINED__
typedef interface ICorProfilerInfo9 ICorProfilerInfo9;
-#endif /* __ICorProfilerInfo9_FWD_DEFINED__ */
+#endif /* __ICorProfilerInfo9_FWD_DEFINED__ */
#ifndef __ICorProfilerMethodEnum_FWD_DEFINED__
@@ -219,6 +219,13 @@ typedef interface ICorProfilerAssemblyReferenceProvider ICorProfilerAssemblyRefe
#endif /* __ICorProfilerAssemblyReferenceProvider_FWD_DEFINED__ */
+#ifndef __ICLRProfiling_FWD_DEFINED__
+#define __ICLRProfiling_FWD_DEFINED__
+typedef interface ICLRProfiling ICLRProfiling;
+
+#endif /* __ICLRProfiling_FWD_DEFINED__ */
+
+
/* header files for imported files */
#include "unknwn.h"
@@ -521,10 +528,10 @@ enum __MIDL___MIDL_itf_corprof_0000_0000_0006
COR_PRF_HIGH_ADD_ASSEMBLY_REFERENCES = 0x1,
COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED = 0x2,
COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS = 0x4,
- COR_PRF_HIGH_DISABLE_TIERED_COMPILATION = 0x8,
+ COR_PRF_HIGH_DISABLE_TIERED_COMPILATION = 0x8,
COR_PRF_HIGH_REQUIRE_PROFILE_IMAGE = 0,
COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH = ( COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED | COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS ) ,
- COR_PRF_HIGH_MONITOR_IMMUTABLE = ( COR_PRF_HIGH_DISABLE_TIERED_COMPILATION )
+ COR_PRF_HIGH_MONITOR_IMMUTABLE = COR_PRF_HIGH_DISABLE_TIERED_COMPILATION
} COR_PRF_HIGH_MONITOR;
typedef /* [public] */
@@ -14225,7 +14232,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9;
#if defined(__cplusplus) && !defined(CINTERFACE)
- MIDL_INTERFACE("008170db-f8cc-4796-9a51-dc8aa0b47012")
+ MIDL_INTERFACE("008170DB-F8CC-4796-9A51-DC8AA0B47012")
ICorProfilerInfo9 : public ICorProfilerInfo8
{
public:
@@ -14251,7 +14258,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorProfilerInfo9Vtbl
{
@@ -14846,303 +14853,303 @@ EXTERN_C const IID IID_ICorProfilerInfo9;
#ifdef COBJMACROS
-#define ICorProfilerInfo9_QueryInterface(This,riid,ppvObject) \
+#define ICorProfilerInfo9_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorProfilerInfo9_AddRef(This) \
+#define ICorProfilerInfo9_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorProfilerInfo9_Release(This) \
+#define ICorProfilerInfo9_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorProfilerInfo9_GetClassFromObject(This,objectId,pClassId) \
+#define ICorProfilerInfo9_GetClassFromObject(This,objectId,pClassId) \
( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )
-#define ICorProfilerInfo9_GetClassFromToken(This,moduleId,typeDef,pClassId) \
+#define ICorProfilerInfo9_GetClassFromToken(This,moduleId,typeDef,pClassId) \
( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )
-#define ICorProfilerInfo9_GetCodeInfo(This,functionId,pStart,pcSize) \
+#define ICorProfilerInfo9_GetCodeInfo(This,functionId,pStart,pcSize) \
( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )
-#define ICorProfilerInfo9_GetEventMask(This,pdwEvents) \
+#define ICorProfilerInfo9_GetEventMask(This,pdwEvents) \
( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )
-#define ICorProfilerInfo9_GetFunctionFromIP(This,ip,pFunctionId) \
+#define ICorProfilerInfo9_GetFunctionFromIP(This,ip,pFunctionId) \
( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )
-#define ICorProfilerInfo9_GetFunctionFromToken(This,moduleId,token,pFunctionId) \
+#define ICorProfilerInfo9_GetFunctionFromToken(This,moduleId,token,pFunctionId) \
( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )
-#define ICorProfilerInfo9_GetHandleFromThread(This,threadId,phThread) \
+#define ICorProfilerInfo9_GetHandleFromThread(This,threadId,phThread) \
( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )
-#define ICorProfilerInfo9_GetObjectSize(This,objectId,pcSize) \
+#define ICorProfilerInfo9_GetObjectSize(This,objectId,pcSize) \
( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )
-#define ICorProfilerInfo9_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \
+#define ICorProfilerInfo9_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \
( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )
-#define ICorProfilerInfo9_GetThreadInfo(This,threadId,pdwWin32ThreadId) \
+#define ICorProfilerInfo9_GetThreadInfo(This,threadId,pdwWin32ThreadId) \
( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )
-#define ICorProfilerInfo9_GetCurrentThreadID(This,pThreadId) \
+#define ICorProfilerInfo9_GetCurrentThreadID(This,pThreadId) \
( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )
-#define ICorProfilerInfo9_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \
+#define ICorProfilerInfo9_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \
( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )
-#define ICorProfilerInfo9_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \
+#define ICorProfilerInfo9_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \
( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )
-#define ICorProfilerInfo9_SetEventMask(This,dwEvents) \
+#define ICorProfilerInfo9_SetEventMask(This,dwEvents) \
( (This)->lpVtbl -> SetEventMask(This,dwEvents) )
-#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \
+#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \
( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )
-#define ICorProfilerInfo9_SetFunctionIDMapper(This,pFunc) \
+#define ICorProfilerInfo9_SetFunctionIDMapper(This,pFunc) \
( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )
-#define ICorProfilerInfo9_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \
+#define ICorProfilerInfo9_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \
( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )
-#define ICorProfilerInfo9_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \
+#define ICorProfilerInfo9_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \
( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )
-#define ICorProfilerInfo9_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \
+#define ICorProfilerInfo9_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \
( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )
-#define ICorProfilerInfo9_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \
+#define ICorProfilerInfo9_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \
( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )
-#define ICorProfilerInfo9_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \
+#define ICorProfilerInfo9_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \
( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )
-#define ICorProfilerInfo9_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \
+#define ICorProfilerInfo9_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \
( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )
-#define ICorProfilerInfo9_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \
+#define ICorProfilerInfo9_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \
( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )
-#define ICorProfilerInfo9_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \
+#define ICorProfilerInfo9_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \
( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )
-#define ICorProfilerInfo9_SetFunctionReJIT(This,functionId) \
+#define ICorProfilerInfo9_SetFunctionReJIT(This,functionId) \
( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )
-#define ICorProfilerInfo9_ForceGC(This) \
+#define ICorProfilerInfo9_ForceGC(This) \
( (This)->lpVtbl -> ForceGC(This) )
-#define ICorProfilerInfo9_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \
+#define ICorProfilerInfo9_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \
( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )
-#define ICorProfilerInfo9_GetInprocInspectionInterface(This,ppicd) \
+#define ICorProfilerInfo9_GetInprocInspectionInterface(This,ppicd) \
( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )
-#define ICorProfilerInfo9_GetInprocInspectionIThisThread(This,ppicd) \
+#define ICorProfilerInfo9_GetInprocInspectionIThisThread(This,ppicd) \
( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )
-#define ICorProfilerInfo9_GetThreadContext(This,threadId,pContextId) \
+#define ICorProfilerInfo9_GetThreadContext(This,threadId,pContextId) \
( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )
-#define ICorProfilerInfo9_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \
+#define ICorProfilerInfo9_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \
( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )
-#define ICorProfilerInfo9_EndInprocDebugging(This,dwProfilerContext) \
+#define ICorProfilerInfo9_EndInprocDebugging(This,dwProfilerContext) \
( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )
-#define ICorProfilerInfo9_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \
+#define ICorProfilerInfo9_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \
( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )
-#define ICorProfilerInfo9_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \
+#define ICorProfilerInfo9_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \
( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )
-#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \
+#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \
( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )
-#define ICorProfilerInfo9_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \
+#define ICorProfilerInfo9_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \
( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )
-#define ICorProfilerInfo9_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \
+#define ICorProfilerInfo9_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \
( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )
-#define ICorProfilerInfo9_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \
+#define ICorProfilerInfo9_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \
( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )
-#define ICorProfilerInfo9_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \
+#define ICorProfilerInfo9_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \
( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )
-#define ICorProfilerInfo9_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \
+#define ICorProfilerInfo9_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \
( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )
-#define ICorProfilerInfo9_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \
+#define ICorProfilerInfo9_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \
( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )
-#define ICorProfilerInfo9_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \
+#define ICorProfilerInfo9_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \
( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )
-#define ICorProfilerInfo9_EnumModuleFrozenObjects(This,moduleID,ppEnum) \
+#define ICorProfilerInfo9_EnumModuleFrozenObjects(This,moduleID,ppEnum) \
( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )
-#define ICorProfilerInfo9_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \
+#define ICorProfilerInfo9_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \
( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )
-#define ICorProfilerInfo9_GetBoxClassLayout(This,classId,pBufferOffset) \
+#define ICorProfilerInfo9_GetBoxClassLayout(This,classId,pBufferOffset) \
( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )
-#define ICorProfilerInfo9_GetThreadAppDomain(This,threadId,pAppDomainId) \
+#define ICorProfilerInfo9_GetThreadAppDomain(This,threadId,pAppDomainId) \
( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )
-#define ICorProfilerInfo9_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \
+#define ICorProfilerInfo9_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \
( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )
-#define ICorProfilerInfo9_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \
+#define ICorProfilerInfo9_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \
( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )
-#define ICorProfilerInfo9_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \
+#define ICorProfilerInfo9_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \
( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )
-#define ICorProfilerInfo9_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \
+#define ICorProfilerInfo9_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \
( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )
-#define ICorProfilerInfo9_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \
+#define ICorProfilerInfo9_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \
( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )
-#define ICorProfilerInfo9_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \
+#define ICorProfilerInfo9_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \
( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )
-#define ICorProfilerInfo9_GetObjectGeneration(This,objectId,range) \
+#define ICorProfilerInfo9_GetObjectGeneration(This,objectId,range) \
( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )
-#define ICorProfilerInfo9_GetNotifiedExceptionClauseInfo(This,pinfo) \
+#define ICorProfilerInfo9_GetNotifiedExceptionClauseInfo(This,pinfo) \
( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )
-#define ICorProfilerInfo9_EnumJITedFunctions(This,ppEnum) \
+#define ICorProfilerInfo9_EnumJITedFunctions(This,ppEnum) \
( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) )
-#define ICorProfilerInfo9_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \
+#define ICorProfilerInfo9_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \
( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) )
-#define ICorProfilerInfo9_SetFunctionIDMapper2(This,pFunc,clientData) \
+#define ICorProfilerInfo9_SetFunctionIDMapper2(This,pFunc,clientData) \
( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) )
-#define ICorProfilerInfo9_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \
+#define ICorProfilerInfo9_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \
( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) )
-#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \
+#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \
( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) )
-#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \
+#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \
( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) )
-#define ICorProfilerInfo9_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \
+#define ICorProfilerInfo9_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \
( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) )
-#define ICorProfilerInfo9_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \
+#define ICorProfilerInfo9_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \
( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) )
-#define ICorProfilerInfo9_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \
+#define ICorProfilerInfo9_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \
( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) )
-#define ICorProfilerInfo9_EnumModules(This,ppEnum) \
+#define ICorProfilerInfo9_EnumModules(This,ppEnum) \
( (This)->lpVtbl -> EnumModules(This,ppEnum) )
-#define ICorProfilerInfo9_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \
+#define ICorProfilerInfo9_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \
( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) )
-#define ICorProfilerInfo9_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \
+#define ICorProfilerInfo9_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \
( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) )
-#define ICorProfilerInfo9_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \
+#define ICorProfilerInfo9_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \
( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) )
-#define ICorProfilerInfo9_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \
+#define ICorProfilerInfo9_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \
( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) )
-#define ICorProfilerInfo9_EnumThreads(This,ppEnum) \
+#define ICorProfilerInfo9_EnumThreads(This,ppEnum) \
( (This)->lpVtbl -> EnumThreads(This,ppEnum) )
-#define ICorProfilerInfo9_InitializeCurrentThread(This) \
+#define ICorProfilerInfo9_InitializeCurrentThread(This) \
( (This)->lpVtbl -> InitializeCurrentThread(This) )
-#define ICorProfilerInfo9_RequestReJIT(This,cFunctions,moduleIds,methodIds) \
+#define ICorProfilerInfo9_RequestReJIT(This,cFunctions,moduleIds,methodIds) \
( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) )
-#define ICorProfilerInfo9_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \
+#define ICorProfilerInfo9_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \
( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) )
-#define ICorProfilerInfo9_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \
+#define ICorProfilerInfo9_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \
( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) )
-#define ICorProfilerInfo9_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \
+#define ICorProfilerInfo9_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \
( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) )
-#define ICorProfilerInfo9_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \
+#define ICorProfilerInfo9_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \
( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) )
-#define ICorProfilerInfo9_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \
+#define ICorProfilerInfo9_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \
( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) )
-#define ICorProfilerInfo9_EnumJITedFunctions2(This,ppEnum) \
+#define ICorProfilerInfo9_EnumJITedFunctions2(This,ppEnum) \
( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) )
-#define ICorProfilerInfo9_GetObjectSize2(This,objectId,pcSize) \
+#define ICorProfilerInfo9_GetObjectSize2(This,objectId,pcSize) \
( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) )
-#define ICorProfilerInfo9_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \
+#define ICorProfilerInfo9_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \
( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) )
-#define ICorProfilerInfo9_SetEventMask2(This,dwEventsLow,dwEventsHigh) \
+#define ICorProfilerInfo9_SetEventMask2(This,dwEventsLow,dwEventsHigh) \
( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) )
-#define ICorProfilerInfo9_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \
+#define ICorProfilerInfo9_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \
( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) )
-#define ICorProfilerInfo9_ApplyMetaData(This,moduleId) \
+#define ICorProfilerInfo9_ApplyMetaData(This,moduleId) \
( (This)->lpVtbl -> ApplyMetaData(This,moduleId) )
-#define ICorProfilerInfo9_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \
+#define ICorProfilerInfo9_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \
( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) )
-#define ICorProfilerInfo9_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \
+#define ICorProfilerInfo9_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \
( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) )
-#define ICorProfilerInfo9_IsFunctionDynamic(This,functionId,isDynamic) \
+#define ICorProfilerInfo9_IsFunctionDynamic(This,functionId,isDynamic) \
( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) )
-#define ICorProfilerInfo9_GetFunctionFromIP3(This,ip,functionId,pReJitId) \
+#define ICorProfilerInfo9_GetFunctionFromIP3(This,ip,functionId,pReJitId) \
( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) )
-#define ICorProfilerInfo9_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \
+#define ICorProfilerInfo9_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \
( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) )
-#define ICorProfilerInfo9_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \
+#define ICorProfilerInfo9_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \
( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) )
-#define ICorProfilerInfo9_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \
+#define ICorProfilerInfo9_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \
( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) )
-#define ICorProfilerInfo9_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \
+#define ICorProfilerInfo9_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \
( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorProfilerInfo9_INTERFACE_DEFINED__ */
+#endif /* __ICorProfilerInfo9_INTERFACE_DEFINED__ */
#ifndef __ICorProfilerMethodEnum_INTERFACE_DEFINED__
@@ -15469,6 +15476,96 @@ EXTERN_C const IID IID_ICorProfilerAssemblyReferenceProvider;
#endif /* __ICorProfilerAssemblyReferenceProvider_INTERFACE_DEFINED__ */
+#ifndef __ICLRProfiling_INTERFACE_DEFINED__
+#define __ICLRProfiling_INTERFACE_DEFINED__
+
+/* interface ICLRProfiling */
+/* [object][local][helpstring][version][uuid] */
+
+
+EXTERN_C const IID IID_ICLRProfiling;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("B349ABE3-B56F-4689-BFCD-76BF39D888EA")
+ ICLRProfiling : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE AttachProfiler(
+ /* [in] */ DWORD dwProfileeProcessID,
+ /* [in] */ DWORD dwMillisecondsMax,
+ /* [in] */ const CLSID *pClsidProfiler,
+ /* [in] */ LPCWSTR wszProfilerPath,
+ /* [size_is][in] */ void *pvClientData,
+ /* [in] */ UINT cbClientData) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ICLRProfilingVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ICLRProfiling * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ICLRProfiling * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ICLRProfiling * This);
+
+ HRESULT ( STDMETHODCALLTYPE *AttachProfiler )(
+ ICLRProfiling * This,
+ /* [in] */ DWORD dwProfileeProcessID,
+ /* [in] */ DWORD dwMillisecondsMax,
+ /* [in] */ const CLSID *pClsidProfiler,
+ /* [in] */ LPCWSTR wszProfilerPath,
+ /* [size_is][in] */ void *pvClientData,
+ /* [in] */ UINT cbClientData);
+
+ END_INTERFACE
+ } ICLRProfilingVtbl;
+
+ interface ICLRProfiling
+ {
+ CONST_VTBL struct ICLRProfilingVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ICLRProfiling_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ICLRProfiling_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ICLRProfiling_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ICLRProfiling_AttachProfiler(This,dwProfileeProcessID,dwMillisecondsMax,pClsidProfiler,wszProfilerPath,pvClientData,cbClientData) \
+ ( (This)->lpVtbl -> AttachProfiler(This,dwProfileeProcessID,dwMillisecondsMax,pClsidProfiler,wszProfilerPath,pvClientData,cbClientData) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ICLRProfiling_INTERFACE_DEFINED__ */
+
+
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
diff --git a/src/pal/prebuilt/inc/metahost.h b/src/pal/prebuilt/inc/metahost.h
index a8638683bc..aa6c78c944 100644
--- a/src/pal/prebuilt/inc/metahost.h
+++ b/src/pal/prebuilt/inc/metahost.h
@@ -59,13 +59,6 @@ typedef interface ICLRMetaHostPolicy ICLRMetaHostPolicy;
#endif /* __ICLRMetaHostPolicy_FWD_DEFINED__ */
-#ifndef __ICLRProfiling_FWD_DEFINED__
-#define __ICLRProfiling_FWD_DEFINED__
-typedef interface ICLRProfiling ICLRProfiling;
-
-#endif /* __ICLRProfiling_FWD_DEFINED__ */
-
-
#ifndef __ICLRDebuggingLibraryProvider_FWD_DEFINED__
#define __ICLRDebuggingLibraryProvider_FWD_DEFINED__
typedef interface ICLRDebuggingLibraryProvider ICLRDebuggingLibraryProvider;
@@ -129,13 +122,6 @@ typedef interface ICLRMetaHostPolicy ICLRMetaHostPolicy;
#endif /* __ICLRMetaHostPolicy_FWD_DEFINED__ */
-#ifndef __ICLRProfiling_FWD_DEFINED__
-#define __ICLRProfiling_FWD_DEFINED__
-typedef interface ICLRProfiling ICLRProfiling;
-
-#endif /* __ICLRProfiling_FWD_DEFINED__ */
-
-
#ifndef __ICLRDebuggingLibraryProvider_FWD_DEFINED__
#define __ICLRDebuggingLibraryProvider_FWD_DEFINED__
typedef interface ICLRDebuggingLibraryProvider ICLRDebuggingLibraryProvider;
@@ -194,7 +180,6 @@ EXTERN_GUID(IID_ICLRStrongName2, 0xC22ED5C5, 0x4B59, 0x4975, 0x90, 0xEB, 0x85, 0
EXTERN_GUID(IID_ICLRStrongName3, 0x22c7089b, 0xbbd3, 0x414a, 0xb6, 0x98, 0x21, 0x0f, 0x26, 0x3f, 0x1f, 0xed);
EXTERN_GUID(CLSID_CLRDebuggingLegacy, 0xDF8395B5, 0xA4BA, 0x450b, 0xA7, 0x7C, 0xA9, 0xA4, 0x77, 0x62, 0xC5, 0x20);
EXTERN_GUID(CLSID_CLRProfiling, 0xbd097ed8, 0x733e, 0x43fe, 0x8e, 0xd7, 0xa9, 0x5f, 0xf9, 0xa8, 0x44, 0x8c);
-EXTERN_GUID(IID_ICLRProfiling, 0xb349abe3, 0xb56f, 0x4689, 0xbf, 0xcd, 0x76, 0xbf, 0x39, 0xd8, 0x88, 0xea);
EXTERN_GUID(IID_ICLRDebuggingLibraryProvider, 0x3151c08d, 0x4d09, 0x4f9b, 0x88, 0x38, 0x28, 0x80, 0xbf, 0x18, 0xfe, 0x51);
EXTERN_GUID(IID_ICLRDebuggingLibraryProvider2, 0xE04E2FF1, 0xDCFD, 0x45D5, 0xBC, 0xD1, 0x16, 0xFF, 0xF2, 0xFA, 0xF7, 0xBA);
typedef HRESULT ( __stdcall *CLRCreateInstanceFnPtr )(
@@ -507,96 +492,6 @@ EXTERN_C const IID IID_ICLRMetaHostPolicy;
#endif /* __ICLRMetaHostPolicy_INTERFACE_DEFINED__ */
-#ifndef __ICLRProfiling_INTERFACE_DEFINED__
-#define __ICLRProfiling_INTERFACE_DEFINED__
-
-/* interface ICLRProfiling */
-/* [object][local][helpstring][version][uuid] */
-
-
-EXTERN_C const IID IID_ICLRProfiling;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("B349ABE3-B56F-4689-BFCD-76BF39D888EA")
- ICLRProfiling : public IUnknown
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE AttachProfiler(
- /* [in] */ DWORD dwProfileeProcessID,
- /* [in] */ DWORD dwMillisecondsMax,
- /* [in] */ const CLSID *pClsidProfiler,
- /* [in] */ LPCWSTR wszProfilerPath,
- /* [size_is][in] */ void *pvClientData,
- /* [in] */ UINT cbClientData) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ICLRProfilingVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ICLRProfiling * This,
- /* [in] */ REFIID riid,
- /* [annotation][iid_is][out] */
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ICLRProfiling * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ICLRProfiling * This);
-
- HRESULT ( STDMETHODCALLTYPE *AttachProfiler )(
- ICLRProfiling * This,
- /* [in] */ DWORD dwProfileeProcessID,
- /* [in] */ DWORD dwMillisecondsMax,
- /* [in] */ const CLSID *pClsidProfiler,
- /* [in] */ LPCWSTR wszProfilerPath,
- /* [size_is][in] */ void *pvClientData,
- /* [in] */ UINT cbClientData);
-
- END_INTERFACE
- } ICLRProfilingVtbl;
-
- interface ICLRProfiling
- {
- CONST_VTBL struct ICLRProfilingVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ICLRProfiling_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ICLRProfiling_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ICLRProfiling_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ICLRProfiling_AttachProfiler(This,dwProfileeProcessID,dwMillisecondsMax,pClsidProfiler,wszProfilerPath,pvClientData,cbClientData) \
- ( (This)->lpVtbl -> AttachProfiler(This,dwProfileeProcessID,dwMillisecondsMax,pClsidProfiler,wszProfilerPath,pvClientData,cbClientData) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ICLRProfiling_INTERFACE_DEFINED__ */
-
-
/* interface __MIDL_itf_metahost_0000_0003 */
/* [local] */
diff --git a/src/vm/profattach.cpp b/src/vm/profattach.cpp
index ff56f38405..981e937cdc 100644
--- a/src/vm/profattach.cpp
+++ b/src/vm/profattach.cpp
@@ -11,6 +11,7 @@
// ======================================================================================
+
#include "common.h"
#ifdef FEATURE_PROFAPI_ATTACH_DETACH
@@ -1192,55 +1193,6 @@ void ProfilingAPIAttachDetach::CreateAttachThread()
}
// ----------------------------------------------------------------------------
-// CLRProfilingClassFactoryImpl::CreateInstance
-//
-// Description:
-// A standard IClassFactory interface function to allow a profiling trigger
-// to query for IID_ICLRProfiling interface
-//
-HRESULT CLRProfilingClassFactoryImpl::CreateInstance(IUnknown * pUnkOuter, REFIID riid, void ** ppv)
-{
- CONTRACTL
- {
- NOTHROW;
- GC_NOTRIGGER;
- MODE_PREEMPTIVE;
- SO_NOT_MAINLINE;
- }
- CONTRACTL_END;
-
- if (ppv == NULL)
- return E_POINTER;
-
- *ppv = NULL;
-
- NewHolder<CLRProfilingImpl> pProfilingImpl = new (nothrow) CLRProfilingImpl();
- if (pProfilingImpl == NULL)
- return E_OUTOFMEMORY;
-
- HRESULT hr = pProfilingImpl->QueryInterface(riid, ppv);
- if (SUCCEEDED(hr))
- {
- pProfilingImpl.SuppressRelease();
- }
-
- return hr;
-}
-
-// ----------------------------------------------------------------------------
-// CLRProfilingClassFactoryImpl::LockServer
-//
-// Description:
-// A standard IClassFactory interface function that doesn't do anything interesting here
-//
-HRESULT CLRProfilingClassFactoryImpl::LockServer(BOOL fLock)
-{
- LIMITED_METHOD_CONTRACT;
-
- return S_OK;
-}
-
-// ----------------------------------------------------------------------------
// CLRProfilingImpl::AttachProfiler
//
// Description:
@@ -1279,41 +1231,38 @@ HRESULT CLRProfilingImpl::AttachProfiler(DWORD dwProfileeProcessID,
wszRuntimeVersion);
}
-// ----------------------------------------------------------------------------
-// ICLRProfilingGetClassObject
-//
-// Description:
-// A wrapper to create a CLRProfilingImpl object and to QueryInterface on the CLRProfilingImpl object
-//
-HRESULT ICLRProfilingGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
+
+// Contract for public APIs. These must be NOTHROW.
+EXTERN_C const IID IID_ICLRProfiling;
+
+HRESULT
+CreateCLRProfiling(
+ __out void ** ppCLRProfilingInstance)
{
CONTRACTL
{
NOTHROW;
- GC_NOTRIGGER;
- MODE_PREEMPTIVE;
- SO_NOT_MAINLINE;
- PRECONDITION(rclsid == CLSID_CLRProfiling);
}
CONTRACTL_END;
- if (ppv == NULL)
- return E_POINTER;
-
- *ppv = NULL;
+ HRESULT hrIgnore = S_OK; // ignored HResult
+ HRESULT hr = S_OK;
+ HMODULE hMod = NULL;
+ IUnknown * pCordb = NULL;
- NewHolder<CLRProfilingClassFactoryImpl> pCLRProfilingClassFactoryImpl = new (nothrow) CLRProfilingClassFactoryImpl();
- if (pCLRProfilingClassFactoryImpl == NULL)
+ LOG((LF_CORDB, LL_EVERYTHING, "Calling CreateCLRProfiling"));
+
+ NewHolder<CLRProfilingImpl> pProfilingImpl = new (nothrow) CLRProfilingImpl();
+ if (pProfilingImpl == NULL)
return E_OUTOFMEMORY;
- HRESULT hr = pCLRProfilingClassFactoryImpl->QueryInterface(riid, ppv);
+ hr = pProfilingImpl->QueryInterface(IID_ICLRProfiling, ppCLRProfilingInstance);
if (SUCCEEDED(hr))
{
- pCLRProfilingClassFactoryImpl.SuppressRelease();
+ pProfilingImpl.SuppressRelease();
+ return S_OK;
}
-
- return hr;
+ return E_FAIL;
}
-
#endif // FEATURE_PROFAPI_ATTACH_DETACH
diff --git a/src/vm/profattach.h b/src/vm/profattach.h
index 0a06fae73f..a660606837 100644
--- a/src/vm/profattach.h
+++ b/src/vm/profattach.h
@@ -18,6 +18,7 @@
#define __PROF_ATTACH_H__
#include "internalunknownimpl.h"
+#include "corprof.h"
//---------------------------------------------------------------------------------------
// Structure representing the runtime's version. Used to negotiate versions between the
@@ -420,6 +421,4 @@ public:
};
-HRESULT ICLRProfilingGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv);
-
#endif // __PROF_ATTACH_H__
diff --git a/src/vm/profdetach.cpp b/src/vm/profdetach.cpp
index 78381fd03d..0181e83d7b 100644
--- a/src/vm/profdetach.cpp
+++ b/src/vm/profdetach.cpp
@@ -16,6 +16,8 @@
#include "profdetach.h"
#include "profilinghelper.h"
+#include "profilinghelper.inl"
+#include "eetoprofinterfaceimpl.inl"
// Class static member variables
ProfilerDetachInfo ProfilingAPIDetach::s_profilerDetachInfo;