, m_pProfilerInfo5(nullptr)
, m_pProfilerInfo6(nullptr)
, m_pProfilerInfo7(nullptr)
+ , m_pProfilerInfo8(nullptr)
+ , m_pProfilerInfo9(nullptr)
+ , m_pProfilerInfo10(nullptr)
, m_version(0)
{
}
HRESULT hr = S_OK; // for case when Initialize() called twice
+ if (m_pProfilerInfo10 == nullptr)
+ {
+ hr = pICorProfilerInfoUnk->QueryInterface(
+ IID_ICorProfilerInfo10,
+ (void**)&m_pProfilerInfo10);
+ if (SUCCEEDED(hr)) {
+ _ASSERTE(m_version == 0);
+ m_version = 10;
+
+ m_pProfilerInfo9 = static_cast<ICorProfilerInfo9*>(
+ m_pProfilerInfo10);
+ m_pProfilerInfo8 = static_cast<ICorProfilerInfo8*>(
+ m_pProfilerInfo10);
+ m_pProfilerInfo7 = static_cast<ICorProfilerInfo7*>(
+ m_pProfilerInfo10);
+ m_pProfilerInfo6 = static_cast<ICorProfilerInfo6*>(
+ m_pProfilerInfo10);
+ m_pProfilerInfo5 = static_cast<ICorProfilerInfo5*>(
+ m_pProfilerInfo10);
+ m_pProfilerInfo4 = static_cast<ICorProfilerInfo4*>(
+ m_pProfilerInfo10);
+ m_pProfilerInfo3 = static_cast<ICorProfilerInfo3*>(
+ m_pProfilerInfo10);
+ m_pProfilerInfo2 = static_cast<ICorProfilerInfo2*>(
+ m_pProfilerInfo10);
+ m_pProfilerInfo = static_cast<ICorProfilerInfo* >(
+ m_pProfilerInfo10);
+ }
+ }
+
+ if (m_pProfilerInfo9 == nullptr)
+ {
+ hr = pICorProfilerInfoUnk->QueryInterface(
+ IID_ICorProfilerInfo9,
+ (void**)&m_pProfilerInfo9);
+ if (SUCCEEDED(hr)) {
+ _ASSERTE(m_version == 0);
+ m_version = 9;
+
+ m_pProfilerInfo8 = static_cast<ICorProfilerInfo8*>(
+ m_pProfilerInfo9);
+ m_pProfilerInfo7 = static_cast<ICorProfilerInfo7*>(
+ m_pProfilerInfo9);
+ m_pProfilerInfo6 = static_cast<ICorProfilerInfo6*>(
+ m_pProfilerInfo9);
+ m_pProfilerInfo5 = static_cast<ICorProfilerInfo5*>(
+ m_pProfilerInfo9);
+ m_pProfilerInfo4 = static_cast<ICorProfilerInfo4*>(
+ m_pProfilerInfo9);
+ m_pProfilerInfo3 = static_cast<ICorProfilerInfo3*>(
+ m_pProfilerInfo9);
+ m_pProfilerInfo2 = static_cast<ICorProfilerInfo2*>(
+ m_pProfilerInfo9);
+ m_pProfilerInfo = static_cast<ICorProfilerInfo* >(
+ m_pProfilerInfo9);
+ }
+ }
+
+ if (m_pProfilerInfo8 == nullptr)
+ {
+ hr = pICorProfilerInfoUnk->QueryInterface(
+ IID_ICorProfilerInfo8,
+ (void**)&m_pProfilerInfo8);
+ if (SUCCEEDED(hr)) {
+ _ASSERTE(m_version == 0);
+ m_version = 8;
+
+ m_pProfilerInfo7 = static_cast<ICorProfilerInfo7*>(
+ m_pProfilerInfo8);
+ m_pProfilerInfo6 = static_cast<ICorProfilerInfo6*>(
+ m_pProfilerInfo8);
+ m_pProfilerInfo5 = static_cast<ICorProfilerInfo5*>(
+ m_pProfilerInfo8);
+ m_pProfilerInfo4 = static_cast<ICorProfilerInfo4*>(
+ m_pProfilerInfo8);
+ m_pProfilerInfo3 = static_cast<ICorProfilerInfo3*>(
+ m_pProfilerInfo8);
+ m_pProfilerInfo2 = static_cast<ICorProfilerInfo2*>(
+ m_pProfilerInfo8);
+ m_pProfilerInfo = static_cast<ICorProfilerInfo* >(
+ m_pProfilerInfo8);
+ }
+ }
+
if (m_pProfilerInfo7 == nullptr)
{
hr = pICorProfilerInfoUnk->QueryInterface(
}
}
+ _ASSERTE(m_version < 10 || m_pProfilerInfo10 != nullptr);
+ _ASSERTE(m_version < 9 || m_pProfilerInfo9 != nullptr);
+ _ASSERTE(m_version < 8 || m_pProfilerInfo8 != nullptr);
_ASSERTE(m_version < 7 || m_pProfilerInfo7 != nullptr);
_ASSERTE(m_version < 6 || m_pProfilerInfo6 != nullptr);
_ASSERTE(m_version < 5 || m_pProfilerInfo5 != nullptr);
m_pProfilerInfo5 = nullptr;
m_pProfilerInfo6 = nullptr;
m_pProfilerInfo7 = nullptr;
+ m_pProfilerInfo8 = nullptr;
+ m_pProfilerInfo9 = nullptr;
+ m_pProfilerInfo10 = nullptr;
m_version = 0;
}
}
return m_pProfilerInfo7;
}
+ ICorProfilerInfo8 *v8() const noexcept
+ {
+ _ASSERTE(m_version >= 8);
+ return m_pProfilerInfo8;
+ }
+
+ ICorProfilerInfo9 *v9() const noexcept
+ {
+ _ASSERTE(m_version >= 9);
+ return m_pProfilerInfo9;
+ }
+
+ ICorProfilerInfo10 *v10() const noexcept
+ {
+ _ASSERTE(m_version >= 10);
+ return m_pProfilerInfo10;
+ }
+
private:
// Pointers to the implementation of the ProfilerInfo interface(s).
ICorProfilerInfo *m_pProfilerInfo;
ICorProfilerInfo5 *m_pProfilerInfo5;
ICorProfilerInfo6 *m_pProfilerInfo6;
ICorProfilerInfo7 *m_pProfilerInfo7;
+ ICorProfilerInfo8 *m_pProfilerInfo8;
+ ICorProfilerInfo9 *m_pProfilerInfo9;
+ ICorProfilerInfo10 *m_pProfilerInfo10;
// Version of the Profiler Info API.
unsigned int m_version;