本文整理汇总了C++中rpal_memory_isValid函数的典型用法代码示例。如果您正苦于以下问题:C++ rpal_memory_isValid函数的具体用法?C++ rpal_memory_isValid怎么用?C++ rpal_memory_isValid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rpal_memory_isValid函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: rpal_memory_isValid
RBOOL
hbs_markAsRelated
(
rSequence parent,
rSequence toMark
)
{
RBOOL isSuccess = FALSE;
RPCHAR invId = NULL;
if( rpal_memory_isValid( parent ) &&
rpal_memory_isValid( toMark ) )
{
isSuccess = TRUE;
if( rSequence_getSTRINGA( parent, RP_TAGS_HBS_INVESTIGATION_ID, &invId ) )
{
isSuccess = FALSE;
if( rSequence_addSTRINGA( toMark, RP_TAGS_HBS_INVESTIGATION_ID, invId ) )
{
isSuccess = TRUE;
}
}
}
return isSuccess;
}
开发者ID:bitamp,项目名称:limacharlie,代码行数:27,代码来源:collectors.c
示例2:
RPVOID
rpal_blob_arrElem
(
rBlob blob,
RU32 elemSize,
RU32 elemIndex
)
{
RPVOID pElem = NULL;
_prBlob b = (_prBlob)blob;
RU32 offset = 0;
if( rpal_memory_isValid( b ) )
{
offset = elemSize * elemIndex;
if( rpal_memory_isValid( b->pData ) &&
IS_WITHIN_BOUNDS( b->pData + ( offset ), elemSize, b->pData, b->sizeUsed ) )
{
pElem = b->pData + offset;
}
}
return pElem;
}
开发者ID:nextgens,项目名称:limacharlie,代码行数:25,代码来源:rpal_blob.c
示例3: rpal_memory_alloc
//=============================================================================
// rRefCount API
//=============================================================================
rRefCount
rRefCount_create
(
rRefCount_freeFunc freeFunc,
RPVOID pElem,
RU32 elemSize
)
{
_rRefCount* ref = NULL;
ref = rpal_memory_alloc( sizeof( *ref ) );
if( rpal_memory_isValid( ref ) )
{
ref->mutex = rMutex_create();
if( rpal_memory_isValid( ref->mutex ) )
{
ref->count = 1;
ref->freeFunc = freeFunc;
ref->pElem = pElem;
ref->elemSize = elemSize;
}
else
{
rpal_memory_free( ref );
ref = NULL;
}
}
return (rRefCount)ref;
}
开发者ID:sun123qiang123,项目名称:limacharlie,代码行数:35,代码来源:rpal_synchronization.c
示例4: IS_WITHIN_BOUNDS
RBOOL
rpal_blob_remove
(
rBlob blob,
RU32 startOffset,
RU32 size
)
{
RBOOL isSuccess = FALSE;
_prBlob pBlob = (_prBlob)blob;
if( NULL != pBlob &&
IS_WITHIN_BOUNDS( pBlob->pData + startOffset, size, pBlob->pData, pBlob->sizeUsed ) &&
rpal_memory_isValid( pBlob->pData ) )
{
rpal_memory_memcpy( pBlob->pData + startOffset, pBlob->pData + startOffset + size, pBlob->sizeUsed - size - startOffset );
pBlob->sizeUsed -= size;
if( rpal_memory_isValid( pBlob->pData ) )
{
pBlob->pData = rpal_memory_realloc_from( pBlob->pData, pBlob->sizeUsed + sizeof( RWCHAR ), pBlob->from );
pBlob->currentSize = pBlob->sizeUsed;
if( NULL != pBlob->pData )
{
// We allocate WCHAR more than we need always to ensure that if the buffer contains a wide string it will be terminated
rpal_memory_zero( pBlob->pData + pBlob->sizeUsed, sizeof( RWCHAR ) );
isSuccess = TRUE;
}
}
}
return isSuccess;
}
开发者ID:nextgens,项目名称:limacharlie,代码行数:34,代码来源:rpal_blob.c
示例5: rpal_memory_realloc_from
RBOOL
rpal_blob_insert
(
rBlob blob,
RPVOID pData,
RU32 size,
RU32 offset
)
{
RBOOL isAdded = FALSE;
_prBlob pBlob = (_prBlob)blob;
if( rpal_memory_isValid( blob ) &&
NULL != pData &&
0 != size )
{
if( pBlob->currentSize - pBlob->sizeUsed < size )
{
pBlob->currentSize += ( 0 != pBlob->growBy ? pBlob->growBy : size );
pBlob->pData = rpal_memory_realloc_from( pBlob->pData,
pBlob->currentSize + sizeof( RWCHAR ),
pBlob->from );
}
if( rpal_memory_isValid( pBlob->pData ) )
{
// Relocate existing data
rpal_memory_memmove( pBlob->pData + offset + size,
pBlob->pData + offset,
pBlob->sizeUsed - offset );
rpal_memory_memcpy( pBlob->pData + offset, pData, size );
pBlob->sizeUsed += size;
// We allocate WCHAR more than we need always to ensure that if the buffer contains a wide string it will be terminated
rpal_memory_zero( pBlob->pData + pBlob->sizeUsed, sizeof( RWCHAR ) );
isAdded = TRUE;
}
}
else if( NULL == pData ||
0 == size )
{
isAdded = TRUE;
}
if( isAdded )
{
if( !rpal_memory_isValid( pBlob->pData ) )
{
isAdded = FALSE;
rpal_debug_break();
}
}
return isAdded;
}
开发者ID:nextgens,项目名称:limacharlie,代码行数:59,代码来源:rpal_blob.c
示例6: rpal_memory_alloc_from
rBlob
rpal_blob_create_from
(
RU32 initialSize,
RU32 growBy,
RU32 from
)
{
rBlob blob = NULL;
blob = rpal_memory_alloc_from( sizeof( _rBlob ), from );
if( rpal_memory_isValid( blob ) )
{
if( 0 != initialSize )
{
((_prBlob)blob)->pData = rpal_memory_alloc_from( initialSize + sizeof( RWCHAR ), from );
if( !rpal_memory_isValid( ((_prBlob)blob)->pData ) )
{
rpal_memory_free( blob );
blob = NULL;
}
else
{
((_prBlob)blob)->currentSize = initialSize;
(((_prBlob)blob)->pData)[ initialSize ] = 0;
(((_prBlob)blob)->pData)[ initialSize + 1 ] = 0;
}
}
else
{
((_prBlob)blob)->currentSize = 0;
((_prBlob)blob)->pData = NULL;
}
if( NULL != blob )
{
((_prBlob)blob)->sizeUsed = 0;
((_prBlob)blob)->growBy = growBy;
((_prBlob)blob)->from = from;
}
}
else
{
blob = NULL;
}
return blob;
}
开发者ID:nextgens,项目名称:limacharlie,代码行数:50,代码来源:rpal_blob.c
示例7: UNREFERENCED_PARAMETER
static
RVOID
processGenericSnapshot
(
rpcm_tag notifType,
rSequence event
)
{
rList entityList = NULL;
rSequence entity = NULL;
UNREFERENCED_PARAMETER( notifType );
if( rpal_memory_isValid( event ) )
{
if( rSequence_getLIST( event, RP_TAGS_AUTORUNS, &entityList ) ||
rSequence_getLIST( event, RP_TAGS_SVCS, &entityList ) ||
rSequence_getLIST( event, RP_TAGS_PROCESSES, &entityList ) )
{
// Go through the elements, whatever tag
while( rList_getSEQUENCE( entityList, RPCM_INVALID_TAG, &entity ) )
{
processHashedEvent( notifType, entity );
}
}
}
}
开发者ID:certego,项目名称:limacharlie,代码行数:27,代码来源:collector_3_code_ident.c
示例8: UNREFERENCED_PARAMETER
static
RPVOID
lookForHiddenModules
(
rEvent isTimeToStop,
RPVOID ctx
)
{
processLibProcEntry* procs = NULL;
processLibProcEntry* proc = NULL;
UNREFERENCED_PARAMETER( ctx );
if( NULL != ( procs = processLib_getProcessEntries( TRUE ) ) )
{
proc = procs;
while( 0 != proc->pid &&
rpal_memory_isValid( isTimeToStop ) &&
!rEvent_wait( isTimeToStop, 0 ) )
{
lookForHiddenModulesIn( isTimeToStop, proc->pid );
proc++;
}
rpal_memory_free( procs );
}
return NULL;
}
开发者ID:bitamp,项目名称:limacharlie,代码行数:31,代码来源:collector_5_hidden_module.c
示例9:
static
RBOOL
findDoc
(
rSequence doc,
DocSearchContext* ctx
)
{
RBOOL isMatch = FALSE;
RPCHAR filePathA = NULL;
RPWCHAR filePathW = NULL;
CryptoLib_Hash* pHash = NULL;
RU32 hashSize = 0;
if( rpal_memory_isValid( doc ) &&
NULL != ctx )
{
rSequence_getSTRINGA( doc, RP_TAGS_FILE_PATH, &filePathA );
rSequence_getSTRINGW( doc, RP_TAGS_FILE_PATH, &filePathW );
rSequence_getBUFFER( doc, RP_TAGS_HASH, (RPU8*)&pHash, &hashSize );
if( ( NULL == filePathA || NULL == ctx->exprA || rpal_string_match( ctx->exprA, filePathA, FALSE ) ) &&
( NULL == filePathW || NULL == ctx->exprW || rpal_string_matchw( ctx->exprW, filePathW, FALSE ) ) &&
( NULL == pHash || NULL == ctx->pHash || 0 == rpal_memory_memcmp( pHash, ctx->pHash, hashSize ) ) )
{
isMatch = TRUE;
}
}
return isMatch;
}
开发者ID:certego,项目名称:limacharlie,代码行数:31,代码来源:collector_18_doc_cache.c
示例10:
RBOOL
rRwLock_read_unlock
(
rRwLock lock
)
{
RBOOL isSuccess = FALSE;
_rRwLock* lck = (_rRwLock*)lock;
if( rpal_memory_isValid( lock ) )
{
if( rMutex_lock( lck->stateLock ) )
{
lck->readCount--;
if( 0 == lck->readCount )
{
rEvent_set( lck->evtCanWrite );
}
rMutex_unlock( lck->stateLock );
isSuccess = TRUE;
}
}
return isSuccess;
}
开发者ID:sun123qiang123,项目名称:limacharlie,代码行数:28,代码来源:rpal_synchronization.c
示例11: rpal_memory_alloc
//=============================================================================
// Public API
//=============================================================================
HObs
obsLib_new
(
RU32 nMaxMem,
ObsType searchType
)
{
_PHObs obs = NULL;
obs = rpal_memory_alloc( sizeof( _HObs ) );
if( rpal_memory_isValid( obs ) )
{
obs->root = newNode();
if( NULL != obs->root )
{
obs->currentOffset = 0;
obs->maxDepth = 0;
obs->maxMem = nMaxMem;
obs->searchType = searchType;
obs->targetBuffer = NULL;
obs->currentState = NULL;
obs->curHits = NULL;
obs->curDepth = 0;
obs->nPatterns = 0;
}
else
{
rpal_memory_free( obs );
obs = NULL;
}
}
return (HObs)obs;
}
开发者ID:cutefone,项目名称:limacharlie,代码行数:38,代码来源:obsLib.c
示例12: ResetEvent
RBOOL
rEvent_unset
(
rEvent ev
)
{
RBOOL isSuccess = FALSE;
_rEvent* evt = (_rEvent*)ev;
if( rpal_memory_isValid( ev ) )
{
#ifdef RPAL_PLATFORM_WINDOWS
isSuccess = ResetEvent( evt->hEvent );
#elif defined( RPAL_PLATFORM_LINUX ) || defined( RPAL_PLATFORM_MACOSX )
if( 0 == pthread_mutex_lock( &evt->hMutex ) )
{
evt->isOn = FALSE;
pthread_mutex_unlock( &evt->hMutex );
isSuccess = TRUE;
}
#endif
}
return isSuccess;
}
开发者ID:sun123qiang123,项目名称:limacharlie,代码行数:27,代码来源:rpal_synchronization.c
示例13: SetEvent
RBOOL
rEvent_set
(
rEvent ev
)
{
RBOOL isSuccess = FALSE;
_rEvent* evt = (_rEvent*)ev;
if( rpal_memory_isValid( ev ) )
{
#ifdef RPAL_PLATFORM_WINDOWS
isSuccess = SetEvent( evt->hEvent );
#elif defined( RPAL_PLATFORM_LINUX ) || defined( RPAL_PLATFORM_MACOSX )
if( 0 == pthread_mutex_lock( &evt->hMutex ) )
{
evt->isOn = TRUE;
if( evt->isManualReset )
{
pthread_cond_broadcast( &evt->hCond );
}
else
{
pthread_cond_signal( &evt->hCond );
}
pthread_mutex_unlock( &evt->hMutex );
isSuccess = TRUE;
}
#endif
}
return isSuccess;
}
开发者ID:sun123qiang123,项目名称:limacharlie,代码行数:35,代码来源:rpal_synchronization.c
示例14: rpal_memory_isValid
RPVOID
rpal_blob_getBuffer
(
rBlob blob
)
{
RPVOID pData = NULL;
if( rpal_memory_isValid( blob ) &&
rpal_memory_isValid( ((_prBlob)blob)->pData ) )
{
pData = ((_prBlob)blob)->pData;
}
return pData;
}
开发者ID:nextgens,项目名称:limacharlie,代码行数:16,代码来源:rpal_blob.c
示例15: MSEC_FROM_SEC
static
RPVOID
lookForHiddenModulesConstantly
(
rEvent isTimeToStop,
RPVOID ctx
)
{
rSequence originalRequest = (rSequence)ctx;
processLibProcEntry* procs = NULL;
processLibProcEntry* proc = NULL;
LibOsPerformanceProfile perfProfile = { 0 };
perfProfile.enforceOnceIn = 4;
perfProfile.sanityCeiling = MSEC_FROM_SEC( 20 );
perfProfile.lastTimeoutValue = 200;
perfProfile.targetCpuPerformance = 0;
perfProfile.globalTargetCpuPerformance = GLOBAL_CPU_USAGE_TARGET;
perfProfile.timeoutIncrementPerSec = 50;
while( rpal_memory_isValid( isTimeToStop ) &&
!rEvent_wait( isTimeToStop, 0 ) )
{
if( NULL != ( procs = processLib_getProcessEntries( TRUE ) ) )
{
proc = procs;
while( 0 != proc->pid &&
rpal_memory_isValid( isTimeToStop ) &&
!rEvent_wait( isTimeToStop, _TIMEOUT_BETWEEN_CONSTANT_PROCESSS ) )
{
if( hbs_whenCpuBelow( _CPU_WATERMARK, _MAX_CPU_WAIT, isTimeToStop ) )
{
lookForHiddenModulesIn( isTimeToStop, proc->pid, originalRequest, &perfProfile );
}
proc++;
}
rpal_memory_free( procs );
}
}
return NULL;
}
开发者ID:certego,项目名称:limacharlie,代码行数:45,代码来源:collector_5_hidden_module.c
示例16: rpal_memory_isValid
RBOOL
addHitToNode
(
PObsNode node,
PObsSig sig
)
{
RBOOL isSuccess = FALSE;
PObsSig* tmp = NULL;
RU32 numHits = 0;
if( rpal_memory_isValid( node ) &&
rpal_memory_isValid( sig ) )
{
tmp = node->pSigsHit;
if( NULL != tmp )
{
while( NULL != *tmp )
{
numHits++;
tmp++;
}
}
node->pSigsHit = rpal_memory_realloc( node->pSigsHit, ( ( numHits + 2 ) * sizeof( PObsSig ) ) );
tmp = node->pSigsHit;
if( NULL != tmp )
{
rpal_memory_zero( (RPU8)tmp + ( numHits * sizeof( PObsSig ) ), 2 * sizeof( PObsSig ) );
while( NULL != *tmp )
{
tmp++;
}
*tmp = sig;
isSuccess = TRUE;
}
}
return isSuccess;
}
开发者ID:cutefone,项目名称:limacharlie,代码行数:45,代码来源:obsLib.c
示例17: test_CreateAndDestroy
void test_CreateAndDestroy(void)
{
HObs hObs = NULL;
hObs = obsLib_new( 0, 0 );
CU_ASSERT_TRUE_FATAL( rpal_memory_isValid( hObs ) );
obsLib_free( hObs );
}
开发者ID:certego,项目名称:limacharlie,代码行数:10,代码来源:main.c
示例18: processLib_getProcessInfo
static RBOOL
notifyOfProcess
(
RU32 pid,
RU32 ppid,
RBOOL isStarting
)
{
RBOOL isSuccess = FALSE;
rSequence info = NULL;
rSequence parentInfo = NULL;
if( !isStarting ||
NULL == ( info = processLib_getProcessInfo( pid ) ) )
{
info = rSequence_new();
}
if( rpal_memory_isValid( info ) )
{
rSequence_addRU32( info, RP_TAGS_PROCESS_ID, pid );
rSequence_addRU32( info, RP_TAGS_PARENT_PROCESS_ID, ppid );
rSequence_addTIMESTAMP( info, RP_TAGS_TIMESTAMP, rpal_time_getGlobal() );
if( isStarting )
{
if( NULL != ( parentInfo = processLib_getProcessInfo( ppid ) ) &&
!rSequence_addSEQUENCE( info, RP_TAGS_PARENT, parentInfo ) )
{
rSequence_free( parentInfo );
}
}
if( isStarting )
{
if( notifications_publish( RP_TAGS_NOTIFICATION_NEW_PROCESS, info ) )
{
isSuccess = TRUE;
rpal_debug_info( "new process starting: %d", pid );
}
}
else
{
if( notifications_publish( RP_TAGS_NOTIFICATION_TERMINATE_PROCESS, info ) )
{
isSuccess = TRUE;
rpal_debug_info( "new process terminating: %d", pid );
}
}
rSequence_free( info );
}
return isSuccess;
}
开发者ID:nextgens,项目名称:limacharlie,代码行数:55,代码来源:collector_1_process_tracker.c
示例19:
//=============================================================================
// Internal Routines
//=============================================================================
RVOID
freeSig
(
PObsSig sig
)
{
if( rpal_memory_isValid( sig ) )
{
rpal_memory_free( sig );
}
}
开发者ID:cutefone,项目名称:limacharlie,代码行数:14,代码来源:obsLib.c
示例20:
RVOID
rpal_stringbuffer_freeWrapper
(
rString pStringBuffer
)
{
if( rpal_memory_isValid( pStringBuffer ) )
{
rpal_blob_freeWrapperOnly( ( (_rString*)pStringBuffer )->blob );
rpal_memory_free( pStringBuffer );
}
}
开发者ID:refractionPOINT,项目名称:limacharlie,代码行数:12,代码来源:rpal_stringbuffer.c
注:本文中的rpal_memory_isValid函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论