本文整理汇总了C++中CLR_RT_HeapBlock::TransparentProxyAppDomain方法的典型用法代码示例。如果您正苦于以下问题:C++ CLR_RT_HeapBlock::TransparentProxyAppDomain方法的具体用法?C++ CLR_RT_HeapBlock::TransparentProxyAppDomain怎么用?C++ CLR_RT_HeapBlock::TransparentProxyAppDomain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLR_RT_HeapBlock
的用法示例。
在下文中一共展示了CLR_RT_HeapBlock::TransparentProxyAppDomain方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PushAppDomainTransition
HRESULT CLR_RT_StackFrame::PushAppDomainTransition( CLR_RT_Thread* th, const CLR_RT_MethodDef_Instance& callInst, CLR_RT_HeapBlock* pThis, CLR_RT_HeapBlock* pArgs )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_StackFrame* frame = NULL;
int cArgs = callInst.m_target->numArgs;
CLR_RT_HeapBlock* proxy;
_ASSERTE(pThis->IsTransparentProxy());
proxy = pThis->Dereference();
TINYCLR_CHECK_HRESULT(proxy->TransparentProxyValidate());
TINYCLR_CHECK_HRESULT(Push( th, callInst, cArgs ));
frame = th->CurrentFrame();
frame->m_appDomain = proxy->TransparentProxyAppDomain();
frame->m_flags |= CLR_RT_StackFrame::c_AppDomainTransition;
frame->m_flags &= ~CLR_RT_StackFrame::c_CallerIsCompatibleForRet;
//Marshal the arguments from the caller (on the eval stack) to the callee, unitialized heapblocks that
//are set up by the extra blocks in CLR_RT_StackFrame::Push
TINYCLR_CHECK_HRESULT(frame->m_appDomain->MarshalObject ( *pThis, frame->m_arguments[ 0 ] ));
TINYCLR_CHECK_HRESULT(frame->m_appDomain->MarshalParameters( pArgs, &frame->m_arguments[ 1 ], cArgs-1, false ));
(void)g_CLR_RT_ExecutionEngine.SetCurrentAppDomain( frame->m_appDomain );
TINYCLR_NOCLEANUP();
}
示例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: GetValue___OBJECT__OBJECT
HRESULT Library_corlib_native_System_Reflection_RuntimeFieldInfo::GetValue___OBJECT__OBJECT( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_HeapBlock* argObj = &stack.Arg1();
CLR_RT_FieldDef_Instance instFD;
CLR_RT_TypeDef_Instance instTD;
const CLR_RECORD_FIELDDEF* fd;
CLR_RT_HeapBlock* obj;
CLR_RT_HeapBlock dst;
TINYCLR_CHECK_HRESULT(Library_corlib_native_System_Reflection_FieldInfo::Initialize( stack, instFD, instTD, obj ));
fd = instFD.m_target;
if(fd->flags & CLR_RECORD_FIELDDEF::FD_NoReflection) // don't allow reflection for fields with NoReflection attribute
{
TINYCLR_SET_AND_LEAVE(CLR_E_NOT_SUPPORTED);
}
{
dst.Assign( *obj );
#if defined(TINYCLR_APPDOMAINS)
//Marshal if necessary.
if(argObj->IsTransparentProxy())
{
_ASSERTE(argObj->DataType() == DATATYPE_OBJECT);
argObj = argObj->Dereference();
_ASSERTE(argObj != NULL && argObj->DataType() == DATATYPE_TRANSPARENT_PROXY);
TINYCLR_CHECK_HRESULT(argObj->TransparentProxyValidate());
TINYCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.GetCurrentAppDomain()->MarshalObject( *obj, dst, argObj->TransparentProxyAppDomain() ));
}
#endif
CLR_RT_HeapBlock& res = stack.PushValueAndAssign( dst );
TINYCLR_CHECK_HRESULT(res.PerformBoxingIfNeeded());
}
TINYCLR_NOCLEANUP();
}