本文整理汇总了C++中CLR_RT_HeapBlock::ObjectCls方法的典型用法代码示例。如果您正苦于以下问题:C++ CLR_RT_HeapBlock::ObjectCls方法的具体用法?C++ CLR_RT_HeapBlock::ObjectCls怎么用?C++ CLR_RT_HeapBlock::ObjectCls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLR_RT_HeapBlock
的用法示例。
在下文中一共展示了CLR_RT_HeapBlock::ObjectCls方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetValuePtr
CLR_INT64* Library_corlib_native_System_TimeSpan::GetValuePtr( CLR_RT_HeapBlock& ref )
{
NATIVE_PROFILE_CLR_CORE();
CLR_RT_HeapBlock* obj = &ref;
CLR_DataType dt = obj->DataType();
if(dt == DATATYPE_OBJECT || dt == DATATYPE_BYREF)
{
obj = obj->Dereference(); if(!obj) return NULL;
dt = obj->DataType();
}
if(dt == DATATYPE_TIMESPAN)
{
return (CLR_INT64*)&obj->NumericByRef().s8;
}
if(dt == DATATYPE_I8)
{
return (CLR_INT64*)&obj->NumericByRef().s8;
}
if(dt == DATATYPE_VALUETYPE && obj->ObjectCls().m_data == g_CLR_RT_WellKnownTypes.m_TimeSpan.m_data)
{
return (CLR_INT64*)&obj[ FIELD__m_ticks ].NumericByRef().s8;
}
return NULL;
}
示例2: GetAppDomain
HRESULT Library_corlib_native_System_AppDomain::GetAppDomain( CLR_RT_HeapBlock& ref, CLR_RT_AppDomain*& appDomain, CLR_RT_AppDomain*& appDomainSav, bool fCheckForUnloadingAppDomain )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_HeapBlock* obj;
CLR_RT_ObjectToEvent_Source* src;
//Setting up appDomainSav is guaranteed to be initialized correctly by this function
appDomainSav = g_CLR_RT_ExecutionEngine.GetCurrentAppDomain();
_ASSERTE(ref.DataType() == DATATYPE_OBJECT);
obj = ref.Dereference(); FAULT_ON_NULL(obj);
if(obj->DataType() == DATATYPE_TRANSPARENT_PROXY)
{
appDomain = obj->TransparentProxyAppDomain();
if(!appDomain) TINYCLR_SET_AND_LEAVE(CLR_E_APPDOMAIN_EXITED);
obj = obj->TransparentProxyDereference(); FAULT_ON_NULL(obj);
}
_ASSERTE(obj->DataType() == DATATYPE_CLASS );
_ASSERTE(obj->ObjectCls().m_data == g_CLR_RT_WellKnownTypes.m_AppDomain.m_data);
src = CLR_RT_ObjectToEvent_Source::ExtractInstance( obj[ FIELD__m_appDomain ] ); FAULT_ON_NULL(src);
appDomain = (CLR_RT_AppDomain*)src->m_eventPtr ; FAULT_ON_NULL(appDomain);
_ASSERTE(appDomain->DataType() == DATATYPE_APPDOMAIN_HEAD);
if(fCheckForUnloadingAppDomain)
{
if(!appDomain->IsLoaded()) TINYCLR_SET_AND_LEAVE(CLR_E_APPDOMAIN_EXITED);
}
(void)g_CLR_RT_ExecutionEngine.SetCurrentAppDomain( appDomain );
TINYCLR_NOCLEANUP();
}
示例3: EXCEPTION
void CLR_RT_DUMP::EXCEPTION( CLR_RT_StackFrame& stack, CLR_RT_HeapBlock& ref )
{
NATIVE_PROFILE_CLR_DIAGNOSTICS();
LPCSTR msg;
CLR_RT_HeapBlock* obj = Library_corlib_native_System_Exception::GetTarget( ref ); if(!obj) return;
CLR_Debug::Printf( " #### Exception " ); CLR_RT_DUMP::TYPE( obj->ObjectCls() ); CLR_Debug::Printf( " - %s (%d) ####\r\n", CLR_RT_DUMP::GETERRORMESSAGE( Library_corlib_native_System_Exception::GetHResult( obj ) ), stack.m_owningThread->m_pid );
msg = Library_corlib_native_System_Exception::GetMessage( obj );
CLR_Debug::Printf( " #### Message: %s\r\n", msg == NULL ? "" : msg );
CLR_UINT32 depth;
Library_corlib_native_System_Exception::StackTrace* stackTrace = Library_corlib_native_System_Exception::GetStackTrace( obj, depth ); if(!stackTrace) return;
while(depth-- > 0)
{
CLR_Debug::Printf( " #### " ); CLR_RT_DUMP::METHOD( stackTrace->m_md ); CLR_Debug::Printf( " [IP: %04x] ####\r\n", stackTrace->m_IP );
stackTrace++;
}
}