本文整理汇总了C++中CLR_RT_HeapBlock类的典型用法代码示例。如果您正苦于以下问题:C++ CLR_RT_HeapBlock类的具体用法?C++ CLR_RT_HeapBlock怎么用?C++ CLR_RT_HeapBlock使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CLR_RT_HeapBlock类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NATIVE_PROFILE_CLR_CORE
HRESULT Library_corlib_native_System_Reflection_RuntimeMethodInfo::get_ReturnType___SystemType( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_MethodDef_Instance md;
CLR_RT_SignatureParser parser;
CLR_RT_TypeDescriptor desc;
CLR_RT_HeapBlock* hbMeth = stack.Arg0().Dereference();
TINYCLR_CHECK_HRESULT(Library_corlib_native_System_Reflection_MethodBase::GetMethodDescriptor( stack, *hbMeth, md ));
parser.Initialize_MethodSignature( md.m_assm, md.m_target );
TINYCLR_CHECK_HRESULT(desc.InitializeFromSignatureParser( parser ));
{
CLR_RT_HeapBlock& top = stack.PushValue();
CLR_RT_HeapBlock* hbObj;
TINYCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.NewObjectFromIndex(top, g_CLR_RT_WellKnownTypes.m_TypeStatic));
hbObj = top.Dereference();
hbObj->SetReflection( desc.m_reflex );
}
TINYCLR_NOCLEANUP();
}
开发者ID:EddieGarmon,项目名称:netduino-netmf,代码行数:27,代码来源:corlib_native_System_Reflection_RuntimeMethodInfo.cpp
示例2: NATIVE_PROFILE_CLR_CORE
HRESULT Library_spot_native_Microsoft_SPOT_Hardware_Utility::CombineArrays( CLR_RT_StackFrame& stack, CLR_RT_HeapBlock& ref1, int offset1, int count1, CLR_RT_HeapBlock& ref2, int offset2, int count2 )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_HeapBlock_Array* array1;
CLR_RT_HeapBlock_Array* array2;
array1 = ref1.DereferenceArray(); FAULT_ON_NULL(array1);
array2 = ref2.DereferenceArray(); FAULT_ON_NULL(array2);
if(array1->SameHeader( *array2 ) == false)
{
TINYCLR_SET_AND_LEAVE(CLR_E_WRONG_TYPE);
}
if(count1 < 0) count1 = array1->m_numOfElements;
if(count2 < 0) count2 = array2->m_numOfElements;
{
CLR_RT_HeapBlock& ref = stack.PushValue();
TINYCLR_CHECK_HRESULT(CLR_RT_HeapBlock_Array::CreateInstance( ref, count1 + count2, array1->ReflectionDataConst() ));
TINYCLR_CHECK_HRESULT(Library_corlib_native_System_Array::Copy( stack, ref1, offset1, ref, 0, count1 ));
TINYCLR_CHECK_HRESULT(Library_corlib_native_System_Array::Copy( stack, ref2, offset2, ref, count1, count2 ));
}
TINYCLR_NOCLEANUP();
}
示例3: NATIVE_PROFILE_CLR_CORE
HRESULT Library_corlib_native_System_Reflection_ConstructorInfo::Invoke___OBJECT__SZARRAY_OBJECT( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_HeapBlock* thisRef = stack.ThisRef().Dereference();
CLR_RT_MethodDef_Instance md;
CLR_RT_HeapBlock_Array* pArray = stack.Arg1().DereferenceArray();
CLR_RT_HeapBlock* args = NULL;
int numArgs = 0;
if(md.InitializeFromIndex( thisRef->ReflectionDataConst().m_data.m_method ) == false) TINYCLR_SET_AND_LEAVE(CLR_E_NULL_REFERENCE);
if(stack.m_customState == 0)
{
stack.m_customState = 1;
if(pArray)
{
args = (CLR_RT_HeapBlock*)pArray->GetFirstElement();
numArgs = pArray->m_numOfElements;
}
TINYCLR_CHECK_HRESULT(stack.MakeCall( md, NULL, args, numArgs ));
}
TINYCLR_NOCLEANUP();
}
开发者ID:AustinWise,项目名称:Netduino-Micro-Framework,代码行数:28,代码来源:corlib_native_System_Reflection_ConstructorInfo.cpp
示例4: NATIVE_PROFILE_CLR_NETWORK
HRESULT Library_spot_net_security_native_Microsoft_SPOT_Net_Security_SslNative::SecureConnect___STATIC__VOID__I4__STRING__OBJECT( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_NETWORK();
TINYCLR_HEADER();
CLR_INT32 sslContext = stack.Arg0().NumericByRef().s4;
CLR_RT_HeapBlock* hb = stack.Arg1().DereferenceString();
CLR_RT_HeapBlock* socket = stack.Arg2().Dereference();
CLR_INT32 timeout_ms = -1; // wait forever
CLR_RT_HeapBlock hbTimeout;
int result;
LPCSTR szName;
CLR_INT32 handle;
bool fRes = true;
CLR_INT64 *timeout;
FAULT_ON_NULL(socket);
handle = socket[ Library_spot_net_native_Microsoft_SPOT_Net_SocketNative::FIELD__m_Handle ].NumericByRef().s4;
/* Because we could have been a rescheduled call due to a prior call that would have blocked, we need to see
* if our handle has been shutdown before continuing. */
if (handle == Library_spot_net_native_Microsoft_SPOT_Net_SocketNative::DISPOSED_HANDLE)
{
ThrowError( stack, CLR_E_OBJECT_DISPOSED );
TINYCLR_SET_AND_LEAVE(CLR_E_PROCESS_EXCEPTION);
}
FAULT_ON_NULL_ARG(hb);
szName = hb->StringText();
hbTimeout.SetInteger( timeout_ms );
TINYCLR_CHECK_HRESULT(stack.SetupTimeout( hbTimeout, timeout ));
while(true)
{
result = SSL_Connect( handle, szName, sslContext );
if(result == SOCK_EWOULDBLOCK || result == SOCK_TRY_AGAIN)
{
// non-blocking - allow other threads to run while we wait for socket activity
TINYCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.WaitEvents( stack.m_owningThread, *timeout, CLR_RT_ExecutionEngine::c_Event_Socket, fRes ));
if(result < 0) break;
}
else
{
break;
}
}
stack.PopValue(); // Timeout
TINYCLR_CHECK_HRESULT(ThrowOnError( stack, result ));
TINYCLR_NOCLEANUP();
}
开发者ID:EddieGarmon,项目名称:netduino-netmf,代码行数:60,代码来源:spot_net_security_native_Microsoft_SPOT_Net_Security_SslNative.cpp
示例5: TINYCLR_HEADER
HRESULT Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_FindObjectEnum::FindObjectsInit___VOID__SZARRAY_MicrosoftSPOTCryptokiCryptokiAttribute( CLR_RT_StackFrame& stack )
{
TINYCLR_HEADER();
CLR_RT_HeapBlock* pThis = stack.This();
CLR_RT_HeapBlock_Array* pAttribs = stack.Arg1().DereferenceArray();
CLR_RT_HeapBlock* pAttrib;
CLR_RT_HeapBlock* pSession = pThis[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_FindObjectEnum::FIELD__m_session].Dereference();
CK_SESSION_HANDLE hSession;
CK_ATTRIBUTE attribs[20];
CLR_UINT32 i;
FAULT_ON_NULL_ARG(pAttribs);
FAULT_ON_NULL(pSession);
if(pAttribs->m_numOfElements > ARRAYSIZE(attribs)) TINYCLR_SET_AND_LEAVE(CLR_E_OUT_OF_RANGE);
hSession = pSession[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_Session::FIELD__m_handle].NumericByRef().u4;
pAttrib = (CLR_RT_HeapBlock*)pAttribs->GetFirstElement();
for(i=0; i<pAttribs->m_numOfElements; i++)
{
CLR_RT_HeapBlock* pElement = pAttrib->Dereference(); FAULT_ON_NULL(pElement);
CLR_RT_HeapBlock_Array* pValueArray = pElement[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_CryptokiAttribute::FIELD__Value].DereferenceArray(); FAULT_ON_NULL(pValueArray);
attribs[i].type = pElement[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_CryptokiAttribute::FIELD__Type].NumericByRef().u4;
attribs[i].pValue = pValueArray->GetFirstElement();
attribs[i].ulValueLen = pValueArray->m_numOfElements;
pAttrib++;
}
CRYPTOKI_CHECK_RESULT(stack, C_FindObjectsInit(hSession, attribs, pAttribs->m_numOfElements));
TINYCLR_NOCLEANUP();
}
开发者ID:AustinWise,项目名称:Netduino-Micro-Framework,代码行数:35,代码来源:security_pkcs11_native_Microsoft_SPOT_Cryptoki_FindObjectEnum.cpp
示例6: NATIVE_PROFILE_CLR_CORE
HRESULT Library_corlib_native_System_Reflection_MethodBase::get_DeclaringType___SystemType( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_MethodDef_Instance md;
CLR_RT_TypeDef_Instance cls;
CLR_RT_HeapBlock* hbMeth = stack.Arg0().Dereference();
TINYCLR_CHECK_HRESULT(GetMethodDescriptor( stack, *hbMeth, md ));
if(cls.InitializeFromMethod( md ) == false) TINYCLR_SET_AND_LEAVE(CLR_E_WRONG_TYPE);
{
CLR_RT_HeapBlock& top = stack.PushValue();
CLR_RT_HeapBlock* hbObj;
TINYCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.NewObjectFromIndex(top, g_CLR_RT_WellKnownTypes.m_TypeStatic));
hbObj = top.Dereference();
hbObj->SetReflection( cls );
}
TINYCLR_NOCLEANUP();
}
示例7: NATIVE_PROFILE_CLR_CORE
HRESULT CLR_RT_HeapBlock_Array::CreateInstance( CLR_RT_HeapBlock& reference, CLR_UINT32 length, CLR_RT_Assembly* assm, CLR_UINT32 tk )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_HeapBlock ref;
CLR_RT_TypeDef_Instance cls;
CLR_RT_TypeSpec_Instance def;
if(cls.ResolveToken( tk, assm ))
{
ref.SetReflection( cls );
}
else if(def.ResolveToken( tk, assm ))
{
TINYCLR_CHECK_HRESULT(ref.SetReflection( def ));
}
else
{
TINYCLR_SET_AND_LEAVE(CLR_E_WRONG_TYPE);
}
ref.ReflectionData().m_levels++;
TINYCLR_SET_AND_LEAVE(CreateInstance( reference, length, ref.ReflectionData() ));
TINYCLR_NOCLEANUP();
}
示例8: TINYCLR_HEADER
HRESULT CLR_RT_XmlState_InValue::ProcessEndWhitespace( CLR_RT_XmlState* st, CLR_UINT8*& buffer, bool& isDone )
{
TINYCLR_HEADER();
_ASSERTE(isDone == true);
CLR_RT_XmlState_InValue* state = &st->InValue;
CLR_RT_HeapBlock* xmlSpace;
CLR_RT_XmlSpace xmlSpaceValue;
TINYCLR_CHECK_HRESULT(state->reader->GetXmlSpaces()->Peek( xmlSpace ));
// note that xmlSpace is boxed
_ASSERTE( xmlSpace->DataType() == DATATYPE_VALUETYPE );
xmlSpaceValue = (CLR_RT_XmlSpace)xmlSpace[ 1 ].NumericByRef().s4;
if(xmlSpaceValue == XmlSpace_Preserve || !(state->settings & XmlSettings_IgnoreWhitespace))
{
TINYCLR_SET_AND_LEAVE(PrepReturn( st, buffer, 0, (xmlSpaceValue == XmlSpace_Preserve) ? XmlNodeType_SignificantWhitespace : XmlNodeType_Whitespace ));
}
TINYCLR_CLEANUP();
// regardless of result, we'll set up the next state. note that it's not possible to get XML_E_NEED_MORE_DATA here
CLR_RT_XmlState_NewTag::Setup( st );
TINYCLR_CLEANUP_END();
}
示例9: NATIVE_PROFILE_CLR_CORE
HRESULT Library_corlib_native_System_Resources_ResourceManager::GetObject___STATIC__OBJECT__SystemResourcesResourceManager__SystemEnum( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_HeapBlock& blkResourceManager = stack.Arg0();
CLR_RT_HeapBlock& blkEnumObj = stack.Arg1();
CLR_RT_HeapBlock* blkVT = blkEnumObj.Dereference();
CLR_RT_HeapBlock* blkEnum = blkVT + 1;
CLR_RT_MethodDef_Instance md;
if(stack.m_customState == 0)
{
stack.m_customState = 1;
FAULT_ON_NULL(blkVT);
if(blkEnum->DataType() != DATATYPE_I2 && blkEnum->DataType() != DATATYPE_U2) TINYCLR_SET_AND_LEAVE( CLR_E_INVALID_PARAMETER );
//call back into ResourceManager.GetObjectFromId(short id);
_SIDE_ASSERTE(md.InitializeFromIndex( g_CLR_RT_WellKnownMethods.m_ResourceManager_GetObjectFromId ));
TINYCLR_CHECK_HRESULT( stack.MakeCall( md, &blkResourceManager, blkEnum, 1 ));
}
TINYCLR_NOCLEANUP();
}
开发者ID:EddieGarmon,项目名称:netduino-netmf,代码行数:28,代码来源:corlib_native_System_Resources_ResourceManager.cpp
示例10: NATIVE_PROFILE_CLR_CORE
HRESULT Library_corlib_native_System_RuntimeType::GetInterfaces___SZARRAY_SystemType( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_TypeDef_Instance td;
CLR_RT_HeapBlock& top = stack.PushValueAndClear();
CLR_RT_HeapBlock* ptr;
TINYCLR_CHECK_HRESULT(GetTypeDescriptor( stack.Arg0(), td ));
//
// Scan the list of interfaces.
//
CLR_RT_SignatureParser parser; parser.Initialize_Interfaces( td.m_assm, td.m_target );
CLR_RT_SignatureParser::Element res;
TINYCLR_CHECK_HRESULT(CLR_RT_HeapBlock_Array::CreateInstance( top, parser.Available(), g_CLR_RT_WellKnownTypes.m_Type ));
ptr = (CLR_RT_HeapBlock*)top.DereferenceArray()->GetFirstElement();
while(parser.Available() > 0)
{
TINYCLR_CHECK_HRESULT(parser.Advance( res ));
ptr->SetReflection( res.m_cls );
ptr++;
}
TINYCLR_NOCLEANUP();
}
示例11: NATIVE_PROFILE_CLR_CORE
HRESULT Library_corlib_native_System_Reflection_Assembly::GetTypes___SZARRAY_SystemType( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_Assembly_Instance assm;
TINYCLR_CHECK_HRESULT(GetTypeDescriptor( stack.Arg0(), assm ));
{
CLR_RT_Assembly* pASSM = assm.m_assm;
CLR_UINT32 num = pASSM->m_pTablesSize[ TBL_TypeDef ];
CLR_RT_HeapBlock& top = stack.PushValue();
TINYCLR_CHECK_HRESULT(CLR_RT_HeapBlock_Array::CreateInstance( top, num, g_CLR_RT_WellKnownTypes.m_Type ));
if(num)
{
CLR_RT_HeapBlock* pArray = (CLR_RT_HeapBlock*)top.DereferenceArray()->GetFirstElement();
for(CLR_UINT32 i=0; i<num; i++, pArray++)
{
CLR_RT_TypeDef_Index idx; idx.Set( pASSM->m_idx, i );
pArray->SetReflection( idx );
}
}
}
TINYCLR_NOCLEANUP();
}
示例12: NATIVE_PROFILE_CLR_CORE
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();
}
示例13: NATIVE_PROFILE_CLR_CORE
HRESULT Library_corlib_native_System_Reflection_Assembly::GetType___SystemType__STRING( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_Assembly_Instance assm;
CLR_RT_TypeDef_Index td;
CLR_RT_HeapBlock* hbRef;
CLR_RT_HeapBlock* hbObj;
LPCSTR szClass = stack.Arg1().RecoverString();
CLR_RT_HeapBlock* hbAsm = stack.Arg0().Dereference();
FAULT_ON_NULL(szClass);
FAULT_ON_NULL(hbAsm);
TINYCLR_CHECK_HRESULT(GetTypeDescriptor( *hbAsm, assm ));
hbRef = &stack.PushValueAndClear();
if(g_CLR_RT_TypeSystem.FindTypeDef( szClass, assm.m_assm, td ))
{
TINYCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.NewObjectFromIndex(*hbRef, g_CLR_RT_WellKnownTypes.m_TypeStatic));
hbObj = hbRef->Dereference();
hbObj->SetReflection( td );
}
TINYCLR_NOCLEANUP();
}
开发者ID:AustinWise,项目名称:Netduino-Micro-Framework,代码行数:29,代码来源:corlib_native_System_Reflection_Assembly.cpp
示例14: NATIVE_PROFILE_CLR_CORE
HRESULT Library_spot_native_Microsoft_SPOT_Reflection::GetAssemblyFromHash___STATIC__mscorlibSystemReflectionAssembly__U4( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_HeapBlock& top = stack.PushValueAndClear();
CLR_UINT32 hash = stack.Arg0().NumericByRefConst().u4;
TINYCLR_FOREACH_ASSEMBLY_IN_CURRENT_APPDOMAIN(g_CLR_RT_TypeSystem)
{
if(pASSM->ComputeAssemblyHash() == hash)
{
CLR_RT_HeapBlock* hbObj;
CLR_RT_Assembly_Index idx; idx.Set( pASSM->m_idx );
TINYCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.NewObjectFromIndex(top, g_CLR_RT_WellKnownTypes.m_Assembly));
hbObj = top.Dereference();
hbObj->SetReflection( idx );
TINYCLR_SET_AND_LEAVE(S_OK);
}
}
TINYCLR_FOREACH_ASSEMBLY_IN_CURRENT_APPDOMAIN_END();
TINYCLR_NOCLEANUP();
}
示例15: Interop_Marshal_StoreRef
HRESULT Interop_Marshal_StoreRef( CLR_RT_StackFrame &stackFrame, void *pVoidHeapBlock, UINT32 paramIndex )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_HeapBlock *pHeapBlock = (CLR_RT_HeapBlock *)pVoidHeapBlock;
TINYCLR_CHECK_HRESULT(pHeapBlock->StoreToReference( stackFrame.ArgN(paramIndex), 0 ));
TINYCLR_NOCLEANUP();
}