本文整理汇总了C++中TINYCLR_SET_AND_LEAVE函数的典型用法代码示例。如果您正苦于以下问题:C++ TINYCLR_SET_AND_LEAVE函数的具体用法?C++ TINYCLR_SET_AND_LEAVE怎么用?C++ TINYCLR_SET_AND_LEAVE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TINYCLR_SET_AND_LEAVE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NATIVE_PROFILE_CLR_HARDWARE
HRESULT Library_spot_hardware_native_Microsoft_SPOT_Hardware_SPI::InternalWriteRead___VOID__SZARRAY_U2__I4__I4__SZARRAY_U2__I4__I4__I4( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_HARDWARE();
TINYCLR_HEADER();
TINYCLR_SET_AND_LEAVE(stack.NotImplementedStub());
TINYCLR_NOCLEANUP();
}
示例2: NATIVE_PROFILE_CLR_CORE
HRESULT Library_spot_native_Microsoft_SPOT_Math::Sin___STATIC__I4__I4( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
TINYCLR_SET_AND_LEAVE(ComputeSinCos( stack, true ));
TINYCLR_NOCLEANUP();
}
示例3: NATIVE_PROFILE_CLR_HARDWARE
HRESULT Library_spot_hardware_serial_native_System_IO_Ports_SerialPort::Read___I4__SZARRAY_U1__I4__I4( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_HARDWARE();
TINYCLR_HEADER();
TINYCLR_SET_AND_LEAVE(stack.NotImplementedStub());
TINYCLR_NOCLEANUP();
}
示例4: TINYCLR_HEADER
HRESULT Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_CryptokiSign::SignInternal___SZARRAY_U1__SZARRAY_U1__I4__I4( CLR_RT_StackFrame& stack )
{
TINYCLR_HEADER();
CLR_RT_HeapBlock* pThis = stack.This();
CLR_RT_HeapBlock_Array* pData = stack.Arg1().DereferenceArray();
CLR_RT_HeapBlock_Array* pRes;
CLR_INT32 offset = stack.Arg2().NumericByRef().s4;
CLR_INT32 len = stack.Arg3().NumericByRef().s4;
CLR_RT_HeapBlock* pSession = pThis[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_SessionContainer::FIELD__m_session].Dereference();
CK_SESSION_HANDLE hSession;
CK_ULONG sigLen = 0;
CLR_RT_HeapBlock hbRef;
FAULT_ON_NULL(pSession);
FAULT_ON_NULL_ARG(pData);
if((offset + len) > (CLR_INT32)pData->m_numOfElements) TINYCLR_SET_AND_LEAVE(CLR_E_OUT_OF_RANGE);
hSession = (CK_SESSION_HANDLE)pSession[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_Session::FIELD__m_handle].NumericByRef().s4;
if(hSession == CK_SESSION_HANDLE_INVALID) TINYCLR_SET_AND_LEAVE(CLR_E_OBJECT_DISPOSED);
CRYPTOKI_CHECK_RESULT(stack, C_Sign(hSession, pData->GetElement(offset), len, NULL, (CK_ULONG_PTR)&sigLen));
TINYCLR_CHECK_HRESULT(CLR_RT_HeapBlock_Array::CreateInstance(hbRef, sigLen, g_CLR_RT_WellKnownTypes.m_UInt8));
pRes = hbRef.DereferenceArray();
CRYPTOKI_CHECK_RESULT(stack, C_Sign(hSession, pData->GetElement(offset), len, pRes->GetFirstElement(), (CK_ULONG_PTR)&sigLen));
if(sigLen < pRes->m_numOfElements)
{
TINYCLR_CHECK_HRESULT(CLR_RT_HeapBlock_Array::CreateInstance(stack.PushValue(), sigLen, g_CLR_RT_WellKnownTypes.m_UInt8));
memcpy(stack.TopValue().DereferenceArray()->GetFirstElement(), pRes->GetFirstElement(), sigLen);
}
else
{
stack.SetResult_Object(pRes);
}
TINYCLR_NOCLEANUP();
}
开发者ID:koson,项目名称:.NETMF_for_LPC17xx,代码行数:44,代码来源:security_pkcs11_native_Microsoft_SPOT_Cryptoki_CryptokiSign.cpp
示例5: TINYCLR_HEADER
HRESULT Library_spot_hardware_native_Microsoft_SPOT_Hardware_NativeEventDispatcher::_ctor___VOID__STRING__U8( CLR_RT_StackFrame& stack )
{
TINYCLR_HEADER();
CLR_RT_DriverInterruptMethods* pDriverMethods;
const CLR_RT_NativeAssemblyData* pNativeDriverData;
CLR_RT_HeapBlock_NativeEventDispatcher* pNativeDisp = NULL;
LPCSTR lpszDriverName;
UINT64 driverData;
CLR_RT_HeapBlock* pThis = stack.This(); FAULT_ON_NULL(pThis);
// Retrieve paramenters;
if (stack.Arg1().DataType() != DATATYPE_OBJECT)
{ TINYCLR_SET_AND_LEAVE(CLR_E_WRONG_TYPE);
}
lpszDriverName = stack.Arg1().RecoverString(); FAULT_ON_NULL(lpszDriverName);
driverData = stack.Arg2().NumericByRef().u8;
// Throw NULL exception if string is empty.
if(hal_strlen_s( lpszDriverName ) == 0)
{
TINYCLR_CHECK_HRESULT(CLR_E_ARGUMENT_NULL);
}
// Retrives pointers to driver implemented functions.
pNativeDriverData = GetAssemblyNativeData( lpszDriverName );
// Validates check sum and presence of the structure.
if(pNativeDriverData == NULL || pNativeDriverData->m_checkSum != DRIVER_INTERRUPT_METHODS_CHECKSUM)
{
TINYCLR_CHECK_HRESULT(CLR_E_DRIVER_NOT_REGISTERED);
}
// Get pointer to CLR_RT_DriverInterruptMethods
pDriverMethods = (CLR_RT_DriverInterruptMethods *)pNativeDriverData->m_pNativeMethods;
// Check that all methods are present:
if(pDriverMethods->m_InitProc == NULL || pDriverMethods->m_EnableProc == NULL || pDriverMethods->m_CleanupProc == NULL)
{
TINYCLR_CHECK_HRESULT(CLR_E_DRIVER_NOT_REGISTERED);
}
// So we found driver by name and now we create instance of CLR_RT_HeapBlock_NativeEventDispatcher
TINYCLR_CHECK_HRESULT(CLR_RT_HeapBlock_NativeEventDispatcher::CreateInstance( *pThis, pThis[ FIELD__m_NativeEventDispatcher ] ));
// Initialize the driver with and provide the instance of CLR_RT_HeapBlock_NativeEventDispatcher
TINYCLR_CHECK_HRESULT(GetEventDispatcher( stack, pNativeDisp ));
// Now call the driver. First save pointer to driver data.
pNativeDisp->m_DriverMethods = pDriverMethods;
TINYCLR_CHECK_HRESULT(pDriverMethods->m_InitProc( pNativeDisp, driverData ));
TINYCLR_NOCLEANUP();
}
开发者ID:prabby,项目名称:miniclr,代码行数:56,代码来源:spot_hardware_native_Microsoft_SPOT_Hardware_NativeEventDispatcher_mshl.cpp
示例6: NATIVE_PROFILE_CLR_HARDWARE
HRESULT CLR_HW_Hardware::TransferAllInterruptsToApplicationQueue()
{
NATIVE_PROFILE_CLR_HARDWARE();
TINYCLR_HEADER();
while(true)
{
HalInterruptRecord* rec;
{
GLOBAL_LOCK(irq1);
rec = m_interruptData.m_HalQueue.Peek();
}
if(rec == NULL) break;
CLR_RT_ApplicationInterrupt* queueRec = (CLR_RT_ApplicationInterrupt*)CLR_RT_Memory::Allocate_And_Erase( sizeof(CLR_RT_ApplicationInterrupt), CLR_RT_HeapBlock::HB_CompactOnFailure ); CHECK_ALLOCATION(queueRec);
queueRec->m_interruptPortInterrupt.m_data1 = rec->m_data1;
queueRec->m_interruptPortInterrupt.m_data2 = rec->m_data2;
queueRec->m_interruptPortInterrupt.m_data3 = rec->m_data3;
queueRec->m_interruptPortInterrupt.m_time = rec->m_time;
queueRec->m_interruptPortInterrupt.m_context = (CLR_RT_HeapBlock_NativeEventDispatcher*)rec->m_context;
m_interruptData.m_applicationQueue.LinkAtBack( queueRec ); ++m_interruptData.m_queuedInterrupts;
{
GLOBAL_LOCK(irq2);
m_interruptData.m_HalQueue.Pop();
}
}
if(m_interruptData.m_queuedInterrupts == 0)
{
TINYCLR_SET_AND_LEAVE(CLR_E_NO_INTERRUPT);
}
TINYCLR_CLEANUP();
if(CLR_E_OUT_OF_MEMORY == hr)
{
// if there is no memory left discard all interrupts to avoid getting into a death spiral of OOM exceptions
{
GLOBAL_LOCK(irq3);
while(!m_interruptData.m_HalQueue.IsEmpty())
{
m_interruptData.m_HalQueue.Pop();
}
}
}
TINYCLR_CLEANUP_END();
}
示例7: NATIVE_PROFILE_CLR_CORE
HRESULT Library_corlib_native_System_BitConverter::ToUInt64___STATIC__U8__SZARRAY_U1__I4( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_HeapBlock_Array* pArray = stack.Arg0().DereferenceArray();
FAULT_ON_NULL_ARG(pArray);
int index;
index = stack.Arg1().NumericByRefConst().s4;
if (index < 0 || (unsigned int)index >= pArray->m_numOfElements) TINYCLR_SET_AND_LEAVE(CLR_E_OUT_OF_RANGE);
if ((unsigned int)index + 8 > pArray->m_numOfElements) TINYCLR_SET_AND_LEAVE(CLR_E_INVALID_PARAMETER);
BYTE* p;
p = pArray->GetFirstElement();
stack.SetResult_U8(*reinterpret_cast<unsigned __int64*>(p + index));
TINYCLR_NOCLEANUP();
}
示例8: NATIVE_PROFILE_CLR_HARDWARE
//--// SPI
HRESULT Library_spot_hardware_native_Microsoft_SPOT_Hardware_HardwareProvider::NativeGetSpiPins___VOID__MicrosoftSPOTHardwareSPISPImodule__BYREF_MicrosoftSPOTHardwareCpuPin__BYREF_MicrosoftSPOTHardwareCpuPin__BYREF_MicrosoftSPOTHardwareCpuPin( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_HARDWARE();
TINYCLR_HEADER();
TINYCLR_SET_AND_LEAVE(stack.NotImplementedStub());
TINYCLR_NOCLEANUP();
}
示例9: NATIVE_PROFILE_CLR_CORE
HRESULT Library_corlib_native_System_Threading_Monitor::Exit___STATIC__VOID__OBJECT( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_StackFrame* caller = NULL;
if(stack.Arg0().Dereference() == NULL)
{
TINYCLR_SET_AND_LEAVE(CLR_E_ARGUMENT_NULL);
}
caller = stack.Caller();
FAULT_ON_NULL(caller); // We need to set the constraint on the caller, not on us...
TINYCLR_SET_AND_LEAVE(g_CLR_RT_ExecutionEngine.UnlockObject( stack.Arg0(), caller->m_owningSubThread ));
TINYCLR_NOCLEANUP();
}
示例10: TINYCLR_HEADER
HRESULT Library_spot_hardware_native_Microsoft_SPOT_Hardware_InterruptPort::EnableInterrupt___VOID( CLR_RT_StackFrame& stack )
{
TINYCLR_HEADER();
CLR_RT_HeapBlock_NativeEventDispatcher* port;
CLR_RT_HeapBlock* pThis = stack.This(); FAULT_ON_NULL(pThis);
if(pThis[ Library_spot_hardware_native_Microsoft_SPOT_Hardware_NativeEventDispatcher::FIELD__m_disposed ].NumericByRef().s1 != 0)
{
TINYCLR_SET_AND_LEAVE(CLR_E_OBJECT_DISPOSED);
}
TINYCLR_CHECK_HRESULT(Library_spot_hardware_native_Microsoft_SPOT_Hardware_NativeEventDispatcher::GetEventDispatcher( stack, port ));
TINYCLR_SET_AND_LEAVE(Microsoft_SPOT_Hardware_InterruptPort_EnableInterrupt( pThis, port ));
TINYCLR_NOCLEANUP();
}
开发者ID:AustinWise,项目名称:Netduino-Micro-Framework,代码行数:19,代码来源:spot_hardware_native_Microsoft_SPOT_Hardware_InterruptPort.cpp
示例11: TINYCLR_HEADER
HRESULT Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_CryptokiVerify::VerifyFinalInternal___BOOLEAN__SZARRAY_U1__I4__I4( CLR_RT_StackFrame& stack )
{
TINYCLR_HEADER();
CLR_RT_HeapBlock* pThis = stack.This();
CLR_RT_HeapBlock_Array* pSig = stack.Arg1().DereferenceArray();
CLR_INT32 sigOff = stack.Arg2().NumericByRef().s4;
CLR_INT32 sigLen = stack.Arg3().NumericByRef().s4;
CLR_RT_HeapBlock* pSession = pThis[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_SessionContainer::FIELD__m_session].Dereference();
CK_SESSION_HANDLE hSession;
bool retVal = false;
CK_RV result;
FAULT_ON_NULL_ARG(pSig);
if((sigOff + sigLen) > (CLR_INT32)pSig->m_numOfElements ) TINYCLR_SET_AND_LEAVE(CLR_E_OUT_OF_RANGE);
hSession = pSession[Library_security_pkcs11_native_Microsoft_SPOT_Cryptoki_Session::FIELD__m_handle].NumericByRef().s4;
if(hSession == CK_SESSION_HANDLE_INVALID) TINYCLR_SET_AND_LEAVE(CLR_E_OBJECT_DISPOSED);
result = C_VerifyFinal(hSession, pSig->GetElement(sigOff), sigLen);
switch(result)
{
case CKR_SIGNATURE_INVALID:
retVal = false;
break;
case CKR_OK:
retVal = true;
break;
case CKR_SIGNATURE_LEN_RANGE:
TINYCLR_SET_AND_LEAVE(CLR_E_INVALID_PARAMETER);
default:
CRYPTOKI_CHECK_RESULT(stack, result);
break;
}
stack.SetResult_Boolean(retVal);
TINYCLR_NOCLEANUP();
}
开发者ID:AustinWise,项目名称:Netduino-Micro-Framework,代码行数:43,代码来源:security_pkcs11_native_Microsoft_SPOT_Cryptoki_CryptokiVerify.cpp
示例12: NATIVE_PROFILE_CLR_NETWORK
HRESULT Library_spot_net_security_native_Microsoft_SPOT_Net_Security_SslNative::SecureAccept___STATIC__VOID__I4__OBJECT( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_NETWORK();
TINYCLR_HEADER();
CLR_INT32 sslContext = stack.Arg0().NumericByRef().s4;
CLR_RT_HeapBlock* socket = stack.Arg1().Dereference();
CLR_INT32 timeout_ms = -1; // wait forever
CLR_RT_HeapBlock hbTimeout;
int result = 0;
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);
}
hbTimeout.SetInteger( timeout_ms );
TINYCLR_CHECK_HRESULT(stack.SetupTimeout( hbTimeout, timeout ));
// first make sure we have data to read or ability to write
while(true)
{
result = SSL_Accept( handle, 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 ));
}
else
{
break;
}
}
stack.PopValue(); // Timeout
TINYCLR_CHECK_HRESULT(ThrowOnError( stack, result ));
TINYCLR_NOCLEANUP();
}
开发者ID:EddieGarmon,项目名称:netduino-netmf,代码行数:55,代码来源:spot_net_security_native_Microsoft_SPOT_Net_Security_SslNative.cpp
示例13: NATIVE_PROFILE_CLR_HARDWARE
HRESULT Library_spot_hardware_serial_native_System_IO_Ports_SerialPort::InternalOpen___VOID( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_HARDWARE();
TINYCLR_HEADER();
CLR_RT_HeapBlock* pThis;
CLR_RT_HeapBlock* config;
CLR_UINT32 portId;
CLR_UINT32 speed;
CLR_UINT32 parity;
CLR_UINT32 dataBits;
CLR_UINT32 stopBits;
CLR_UINT32 flowValue;
pThis = stack.This(); FAULT_ON_NULL(pThis);
// check if the object was disposed
if(pThis[ FIELD__m_fDisposed ].NumericByRef().s1 != 0)
{
TINYCLR_SET_AND_LEAVE(CLR_E_OBJECT_DISPOSED);
}
config = pThis[ FIELD__m_config ].Dereference(); FAULT_ON_NULL(config);
portId = config[ Library_spot_hardware_serial_native_System_IO_Ports_SerialPort__Configuration::FIELD__PortIndex ].NumericByRef().u4;
speed = config[ Library_spot_hardware_serial_native_System_IO_Ports_SerialPort__Configuration::FIELD__Speed ] .NumericByRef().u4;
parity = config[ Library_spot_hardware_serial_native_System_IO_Ports_SerialPort__Configuration::FIELD__Parity ] .NumericByRef().u4;
dataBits = config[ Library_spot_hardware_serial_native_System_IO_Ports_SerialPort__Configuration::FIELD__DataBits ] .NumericByRef().u4;
stopBits = config[ Library_spot_hardware_serial_native_System_IO_Ports_SerialPort__Configuration::FIELD__StopBits ] .NumericByRef().u4;
flowValue = config[ Library_spot_hardware_serial_native_System_IO_Ports_SerialPort__Configuration::FIELD__Handshake ].NumericByRef().u4;
::USART_Flush( portId );
::USART_Uninitialize( portId );
if(FALSE == ::USART_Initialize( portId, speed, parity, dataBits, stopBits, flowValue ))
{
TINYCLR_SET_AND_LEAVE(CLR_E_INVALID_PARAMETER);
}
TINYCLR_NOCLEANUP();
}
开发者ID:Wampamba-Nooh,项目名称:MicroFrameworkSDK-Mono,代码行数:42,代码来源:spot_hardware_serial_native_System_IO_Ports_SerialPort.cpp
示例14: NATIVE_PROFILE_CLR_CORE
HRESULT Library_spot_native_Microsoft_SPOT_Hardware_Utility::ComputeCRC___STATIC__U4__SZARRAY_U1__I4__I4__U4( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_HeapBlock* pArgs;
CLR_RT_HeapBlock_Array* array;
int offset;
int length;
CLR_UINT32 crc;
int totLength;
pArgs = &(stack.Arg0());
array = pArgs[ 0 ].DereferenceArray(); FAULT_ON_NULL(array);
offset = pArgs[ 1 ].NumericByRef().s4;
length = pArgs[ 2 ].NumericByRef().s4;
crc = pArgs[ 3 ].NumericByRef().u4;
totLength = array->m_numOfElements;
if(offset < 0 || offset > totLength)
{
TINYCLR_SET_AND_LEAVE(CLR_E_OUT_OF_RANGE);
}
if(length == -1)
{
length = totLength - offset;
}
else
{
if(length < 0 || (offset+length) > totLength)
{
TINYCLR_SET_AND_LEAVE(CLR_E_OUT_OF_RANGE);
}
}
crc = SUPPORT_ComputeCRC( array->GetElement( offset ), length, crc );
stack.SetResult( crc, DATATYPE_U4 );
TINYCLR_NOCLEANUP();
}
示例15: NATIVE_PROFILE_CLR_CORE
HRESULT Library_corlib_native_System_WeakReference::_ctor___VOID__OBJECT( CLR_RT_StackFrame& stack )
{
NATIVE_PROFILE_CLR_CORE();
TINYCLR_HEADER();
CLR_RT_HeapBlock_WeakReference* weak = (CLR_RT_HeapBlock_WeakReference*)stack.This(); FAULT_ON_NULL(weak);
TINYCLR_SET_AND_LEAVE(weak->SetTarget( stack.Arg1() ));
TINYCLR_NOCLEANUP();
}