本文整理汇总了C++中BAIL_ON_VMDNS_ERROR函数的典型用法代码示例。如果您正苦于以下问题:C++ BAIL_ON_VMDNS_ERROR函数的具体用法?C++ BAIL_ON_VMDNS_ERROR怎么用?C++ BAIL_ON_VMDNS_ERROR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BAIL_ON_VMDNS_ERROR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VmDnsCacheGetZoneName
DWORD
VmDnsCacheGetZoneName(
PVMDNS_ZONE_OBJECT pZoneObject,
PSTR *ppszZoneName
)
{
DWORD dwError = 0;
PSTR pszZoneName = NULL;
if (!pZoneObject)
{
dwError = ERROR_INVALID_PARAMETER;
BAIL_ON_VMDNS_ERROR(dwError);
}
dwError = VmDnsZoneGetName(pZoneObject, &pszZoneName);
BAIL_ON_VMDNS_ERROR(dwError);
*ppszZoneName = pszZoneName;
cleanup:
return dwError;
error:
goto cleanup;
}
示例2: VmDnsAllocateCondition
DWORD
VmDnsAllocateCondition(
PVMDNS_COND* ppCondition
)
{
DWORD dwError = ERROR_SUCCESS;
PVMDNS_COND pVmDnsCond = NULL;
if ( ppCondition == NULL )
{
dwError = ERROR_INVALID_PARAMETER;
BAIL_ON_VMDNS_ERROR(dwError);
}
dwError = VmDnsAllocateMemory( sizeof(VMDNS_COND), ((PVOID*)&pVmDnsCond));
BAIL_ON_VMDNS_ERROR(dwError);
dwError = VmDnsInitializeConditionContent( pVmDnsCond );
BAIL_ON_VMDNS_ERROR(dwError);
*ppCondition = pVmDnsCond;
pVmDnsCond = NULL;
error:
VMDNS_SAFE_FREE_CONDITION( pVmDnsCond );
return dwError;
}
示例3: VmDnsGetLockKey
static
int*
VmDnsGetLockKey(
pthread_key_t* pLockKey
)
{
DWORD dwError = ERROR_SUCCESS;
int* pCounter = NULL;
int* pCount = (int*)pthread_getspecific(*pLockKey);
if (!pCount)
{
dwError = VmDnsAllocateMemory(sizeof(int), (void**)&(pCounter));
BAIL_ON_VMDNS_ERROR(dwError);
dwError = pthread_setspecific(*pLockKey, pCounter);
dwError = POSIX_TO_WIN32_ERROR(dwError);
BAIL_ON_VMDNS_ERROR(dwError);
pCounter = NULL;
pCount = (int*)pthread_getspecific(*pLockKey);
}
cleanup:
return pCount;
error:
VMDNS_SAFE_FREE_MEMORY(pCounter);
goto cleanup;
}
示例4: VmDnsRpcCopySrvRecord
DWORD VmDnsRpcCopySrvRecord(
PVMDNS_RECORD pSrc,
PVMDNS_RECORD pDest
)
{
DWORD dwError = 0;
PVMDNS_SRV_DATAA pData = NULL;
pData = &pDest->Data.SRV;
VmDnsRpcAllocateStringA(pSrc->pszName, &pDest->pszName);
BAIL_ON_VMDNS_ERROR(dwError);
pDest->iClass = pSrc->iClass;
pDest->dwTtl = pSrc->dwTtl;
pDest->dwType = pSrc->dwType;
pData->wPort = pSrc->Data.SRV.wPort;
pData->wPriority = pSrc->Data.SRV.wPriority;
pData->wWeight = pSrc->Data.SRV.wWeight;
VmDnsRpcAllocateStringA(pSrc->Data.SRV.pNameTarget, &pData->pNameTarget);
BAIL_ON_VMDNS_ERROR(dwError);
cleanup:
return dwError;
error:
VmDnsClearRecord(pDest);
goto cleanup;
}
示例5: VmDnsAllocateRWLock
DWORD
VmDnsAllocateRWLock(
PVMDNS_RWLOCK* ppLock
)
{
DWORD dwError = 0;
PVMDNS_RWLOCK pLock = NULL;
BAIL_ON_VMDNS_INVALID_POINTER(ppLock, dwError);
dwError = VmDnsAllocateMemory(sizeof(VMDNS_RWLOCK), (void**)&pLock);
BAIL_ON_VMDNS_ERROR(dwError);
dwError = pthread_rwlock_init(&pLock->rwLock, NULL);
dwError = POSIX_TO_WIN32_ERROR(dwError);
BAIL_ON_VMDNS_ERROR(dwError);
dwError = pthread_key_create(&pLock->readKey, VmDnsFreeLockCount);
dwError = POSIX_TO_WIN32_ERROR(dwError);
BAIL_ON_VMDNS_ERROR(dwError);
dwError = pthread_key_create(&pLock->writeKey, VmDnsFreeLockCount);
dwError = POSIX_TO_WIN32_ERROR(dwError);
BAIL_ON_VMDNS_ERROR(dwError);
*ppLock = pLock;
cleanup:
return dwError;
error:
VMDNS_SAFE_FREE_MEMORY(pLock);
goto cleanup;
}
示例6: VmDnsThreadJoin
DWORD
VmDnsThreadJoin(
PVMDNS_THREAD pThread,
PDWORD pRetVal
)
{
DWORD dwError = ERROR_SUCCESS;
union
{
DWORD dwError;
PVOID pvRet;
} retVal = { 0 };
if(pThread == NULL)
{
dwError = ERROR_INVALID_PARAMETER;
BAIL_ON_VMDNS_ERROR(dwError);
}
dwError = pthread_join(
(*pThread),
((pRetVal != NULL) ? &(retVal.pvRet) : NULL)
);
BAIL_ON_VMDNS_ERROR(dwError);
if( pRetVal != NULL )
{
// our ThreadFunction returns error code
*pRetVal = retVal.dwError;
}
error:
return dwError;
}
示例7: VmDnsAllocateMutex
DWORD
VmDnsAllocateMutex(
PVMDNS_MUTEX* ppMutex
)
{
DWORD dwError = ERROR_SUCCESS;
PVMDNS_MUTEX pVmDnsMutex = NULL;
if ( ppMutex == NULL )
{
dwError = ERROR_INVALID_PARAMETER;
BAIL_ON_VMDNS_ERROR(dwError);
}
dwError = VmDnsAllocateMemory( sizeof(VMDNS_MUTEX), ((PVOID*)&pVmDnsMutex));
BAIL_ON_VMDNS_ERROR(dwError);
dwError = VmDnsInitializeMutexContent( pVmDnsMutex );
BAIL_ON_VMDNS_ERROR(dwError);
*ppMutex = pVmDnsMutex;
pVmDnsMutex = NULL;
error:
VMDNS_SAFE_FREE_MUTEX( pVmDnsMutex );
return dwError;
}
示例8: VmDnsDuplicateNSRecord
DWORD
VmDnsDuplicateNSRecord(
PVMDNS_RECORD pSrc,
PVMDNS_RECORD *ppDest
)
{
DWORD dwError = 0;
PVMDNS_RECORD pRecord = NULL;
BAIL_ON_VMDNS_INVALID_POINTER(pSrc, dwError);
BAIL_ON_VMDNS_INVALID_POINTER(ppDest, dwError);
dwError = VmDnsAllocateMemory(sizeof(VMDNS_RECORD), (void**)&pRecord);
BAIL_ON_VMDNS_ERROR(dwError);
dwError = VmDnsCopyNSRecord(pSrc, pRecord);
BAIL_ON_VMDNS_ERROR(dwError);
*ppDest = pRecord;
pRecord = NULL;
cleanup:
return dwError;
error:
VMDNS_FREE_RECORD(pRecord);
if (ppDest)
{
*ppDest = NULL;
}
goto cleanup;
}
示例9: VmDnsCacheRemoveZone
DWORD
VmDnsCacheRemoveZone(
PVMDNS_CACHE_CONTEXT pContext,
PVMDNS_ZONE_OBJECT pZoneObject
)
{
DWORD dwError = 0;
BOOL bLocked = FALSE;
if (!pZoneObject)
{
dwError = ERROR_INVALID_PARAMETER;
BAIL_ON_VMDNS_ERROR(dwError);
}
VmDnsLockWrite(pContext->pLock);
bLocked = TRUE;
dwError = VmDnsZoneListRemoveZone(pContext->pZoneList, pZoneObject);
BAIL_ON_VMDNS_ERROR(dwError);
cleanup:
if (bLocked)
{
VmDnsUnlockWrite(pContext->pLock);
}
return dwError;
error:
goto cleanup;
}
示例10: VmDnsCliCreateZone
static
DWORD
VmDnsCliCreateZone(
PVM_DNS_CLI_CONTEXT pContext
)
{
DWORD dwError = 0;
if (pContext->dwZoneType == VMDNS_ZONE_TYPE_FORWARDER)
{
dwError = VmDnsCliCreateForwarderZone(pContext);
BAIL_ON_VMDNS_ERROR(dwError);
}
else
{
dwError = VmDnsCliCreatePrimaryZone(pContext);
BAIL_ON_VMDNS_ERROR(dwError);
}
cleanup:
return dwError;
error:
goto cleanup;
}
示例11: VmDnsCachePurgeRecordProc
DWORD
VmDnsCachePurgeRecordProc(
PVOID pData,
PCSTR pszZone,
PCSTR pszNode
)
{
PVMDNS_CACHE_CONTEXT pCacheContext = (PVMDNS_CACHE_CONTEXT) pData;
PVMDNS_ZONE_OBJECT pZoneObject = NULL;
DWORD dwError = 0;
dwError = VmDnsCacheFindZone(
pCacheContext,
pszZone,
&pZoneObject
);
BAIL_ON_VMDNS_ERROR(dwError);
dwError = VmDnsCachePurgeRecord(pZoneObject, pszNode, CACHE_PURGE_REPLICATION);
BAIL_ON_VMDNS_ERROR(dwError);
cleanup:
VmDnsZoneObjectRelease(pZoneObject);
return dwError;
error:
goto cleanup;
}
示例12: VmDnsRpcCopyPtrRecord
DWORD
VmDnsRpcCopyPtrRecord(
PVMDNS_RECORD pSrc,
PVMDNS_RECORD pDest
)
{
DWORD dwError = 0;
PVMDNS_PTR_DATAA pData = NULL;
pData = &pDest->Data.PTR;
VmDnsRpcAllocateStringA(pSrc->pszName, &pDest->pszName);
BAIL_ON_VMDNS_ERROR(dwError);
pDest->iClass = pSrc->iClass;
pDest->dwTtl = pSrc->dwTtl;
pDest->dwType = pSrc->dwType;
VmDnsRpcAllocateStringA(pSrc->Data.PTR.pNameHost, &pData->pNameHost);
BAIL_ON_VMDNS_ERROR(dwError);
cleanup:
return dwError;
error:
VmDnsRpcClearPtrRecord(pDest);
goto cleanup;
}
示例13: VmDnsRpcDuplicatePtrRecord
DWORD
VmDnsRpcDuplicatePtrRecord(
PVMDNS_RECORD pSrc,
PVMDNS_RECORD *ppDest
)
{
DWORD dwError = 0;
PVMDNS_RECORD pRecord = NULL;
BAIL_ON_VMDNS_INVALID_POINTER(pSrc, dwError);
BAIL_ON_VMDNS_INVALID_POINTER(ppDest, dwError);
dwError = VmDnsRpcAllocateMemory(sizeof(VMDNS_RECORD), (PVOID*)&pRecord);
BAIL_ON_VMDNS_ERROR(dwError);
dwError = VmDnsRpcCopyPtrRecord(pSrc, pRecord);
BAIL_ON_VMDNS_ERROR(dwError);
*ppDest = pRecord;
pRecord = NULL;
cleanup:
return dwError;
error:
VmDnsRpcClearPtrRecord(pRecord);
VmDnsRpcFreeMemory(pRecord);
if (ppDest)
{
*ppDest = NULL;
}
goto cleanup;
}
示例14: VmDnsCacheSyncZones
DWORD
VmDnsCacheSyncZones(
DWORD dwLastChangedUSN,
PVMDNS_CACHE_CONTEXT pCacheContext
)
{
DWORD dwError = 0;
dwError = VmDnsStoreSyncDeleted(
dwLastChangedUSN,
VmDnsCacheRemoveZoneProc,
(PVOID) pCacheContext
);
BAIL_ON_VMDNS_ERROR(dwError);
dwError = VmDnsStoreSyncNewObjects(
dwLastChangedUSN,
VmDnsCacheSyncZoneProc,
VmDnsCachePurgeRecordProc,
(PVOID) pCacheContext
);
BAIL_ON_VMDNS_ERROR(dwError);
cleanup:
return dwError;
error:
goto cleanup;
}
示例15: VmDnsCacheStopRefreshThread
static
DWORD
VmDnsCacheStopRefreshThread(
PVMDNS_CACHE_CONTEXT pContext
)
{
DWORD dwError = 0;
if (!pContext->pRefreshEvent ||
!pContext->pRefreshThread)
{
dwError = ERROR_INVALID_STATE;
BAIL_ON_VMDNS_ERROR(dwError);
}
pContext->bShutdown = TRUE;
dwError = VmDnsConditionSignal(pContext->pRefreshEvent);
BAIL_ON_VMDNS_ERROR(dwError);
dwError = VmDnsThreadJoin(pContext->pRefreshThread, &dwError);
BAIL_ON_VMDNS_ERROR(dwError);
dwError = VmDnsCacheCleanupRefreshThread(pContext);
BAIL_ON_VMDNS_ERROR(dwError);
cleanup:
return dwError;
error:
goto cleanup;
}