本文整理匯總了C++中AnscFreeMemory函數的典型用法代碼示例。如果您正苦於以下問題:C++ AnscFreeMemory函數的具體用法?C++ AnscFreeMemory怎麽用?C++ AnscFreeMemory使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AnscFreeMemory函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: AnscFreeMemory
ANSC_STATUS
HttpSmpoRemove
(
ANSC_HANDLE hThisObject
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PHTTP_SIMPLE_MSG_PARSER pMyObject = (PHTTP_SIMPLE_MSG_PARSER)hThisObject;
if (pMyObject->hHfpIf)
{
PHTTP_HFP_INTERFACE pHfpIf;
pHfpIf = (PHTTP_HFP_INTERFACE)(pMyObject->hHfpIf);
AnscFreeMemory(pHfpIf);
}
pMyObject->RemoveXTable((ANSC_HANDLE)pMyObject);
AnscCoRemove((ANSC_HANDLE)pMyObject);
return ANSC_STATUS_SUCCESS;
}
示例2: AnscFreeMemory
ANSC_STATUS
SysIroV2Remove
(
ANSC_HANDLE hThisObject
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PSYS_IROV2_OBJECT pMyObject = (PSYS_IROV2_OBJECT )hThisObject;
PSYS_IRA_INTERFACE pIraIf = (PSYS_IRA_INTERFACE )pMyObject->hIraIf;
pMyObject->Cancel((ANSC_HANDLE)pMyObject);
pMyObject->Reset ((ANSC_HANDLE)pMyObject);
if ( pIraIf )
{
AnscFreeMemory(pIraIf);
}
AnscFreeLock (&pMyObject->AccessLock );
AnscCoRemove ((ANSC_HANDLE)pMyObject );
return ANSC_STATUS_SUCCESS;
}
示例3: AnscAsn1FreeOid
void
AnscAsn1FreeOidArray
(
ANSC_ASN1_OID** asn1_oid_array,
ULONG array_size
)
{
ULONG i = 0;
for ( i = 0; i < array_size; i++ )
{
if ( asn1_oid_array[i] )
{
AnscAsn1FreeOid(asn1_oid_array[i]);
asn1_oid_array[i] = NULL;
}
}
AnscFreeMemory(asn1_oid_array);
return;
}
示例4: AnscSizeOfString
BOOL
DslhVarroIsValidBase64String
(
PCHAR pString
)
{
ULONG length = 0;
PUCHAR pNewBuf = NULL;
if( pString == NULL)
{
return TRUE; /* empty string is fine */
}
length = AnscSizeOfString(pString);
if( length == 0)
{
return TRUE; /* empty string is fine */
}
pNewBuf =
AnscBase64Decode
(
(PCHAR)pString,
&length
);
if( pNewBuf == NULL)
{
return FALSE;
}
AnscFreeMemory(pNewBuf);
return TRUE;
}
示例5: DslhCwmpFreeParamDescr
ANSC_STATUS
DslhVareoReset
(
ANSC_HANDLE hThisObject
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PDSLH_VAR_ENTITY_OBJECT pMyObject = (PDSLH_VAR_ENTITY_OBJECT)hThisObject;
PDSLH_VAREO_TOKEN_VALUE pTokenValue = (PDSLH_VAREO_TOKEN_VALUE)NULL;
PSINGLE_LINK_ENTRY pSLinkEntry = (PSINGLE_LINK_ENTRY )NULL;
ULONG i = 0;
if ( pMyObject->ParamDescr )
{
DslhCwmpFreeParamDescr(pMyObject->ParamDescr);
pMyObject->ParamDescr = NULL;
}
if ( pMyObject->TokenTable )
{
pSLinkEntry = AnscQueuePopEntry(pMyObject->TokenTable);
while ( pSLinkEntry )
{
pTokenValue = ACCESS_DSLH_VAREO_TOKEN_VALUE(pSLinkEntry);
pSLinkEntry = AnscQueuePopEntry(pMyObject->TokenTable);
DslhVareoFreeTokenValue(pTokenValue);
}
AnscFreeMemory(pMyObject->TokenTable);
pMyObject->TokenTable = NULL;
}
return ANSC_STATUS_SUCCESS;
}
示例6: AnscFreeMemory
ANSC_STATUS
AnscAsn1PKCS10BeforeDecodingChild
(
ANSC_HANDLE hThisObject,
int index,
PVOID* ppEncoding
)
{
PANSC_ASN1_CERTIFICATEREQUEST pThisObject = (PANSC_ASN1_CERTIFICATEREQUEST)hThisObject;
if( pThisObject != NULL && index == 0)
{
/* free the signed data part */
if( pThisObject->pSignedData != NULL && pThisObject->uSignedLength > 0)
{
AnscFreeMemory(pThisObject->pSignedData);
}
pThisObject->pSignedData = *ppEncoding;
pThisObject->uSignedLength = 0;
}
return ANSC_STATUS_SUCCESS;
}
示例7: AnscFreeMemory
ANSC_STATUS
AnscScuoShutdown
(
ANSC_HANDLE hThisObject
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PANSC_SIMPLE_CLIENT_UDP_OBJECT pMyObject = (PANSC_SIMPLE_CLIENT_UDP_OBJECT)hThisObject;
PANSC_SCUO_WORKER_OBJECT pWorker = (PANSC_SCUO_WORKER_OBJECT )pMyObject->hWorker;
pMyObject->Reset((ANSC_HANDLE)pMyObject);
if ( pWorker )
{
AnscFreeMemory(pWorker);
pMyObject->hWorker = (ANSC_HANDLE)NULL;
}
AnscFreeLock (&pMyObject->OpLock );
AnscCoVer3Shutdown((ANSC_HANDLE)pMyObject);
return ANSC_STATUS_SUCCESS;
}
示例8: AnscFreeMemory
ANSC_STATUS
AnscLpccoImcSetPartyName
(
ANSC_HANDLE hThisObject,
char* party_name
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PANSC_LPC_CONNECTOR_OBJECT pMyObject = (PANSC_LPC_CONNECTOR_OBJECT)hThisObject;
if ( pMyObject->PartyName )
{
AnscFreeMemory(pMyObject->PartyName);
pMyObject->PartyName = NULL;
}
if ( party_name )
{
pMyObject->PartyName = AnscCloneString(party_name);
}
return ANSC_STATUS_SUCCESS;
}
示例9: AnscFreeMemory
ANSC_STATUS
BwrmCpoSetPagePath
(
ANSC_HANDLE hThisObject,
char* page_path
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PBWRM_COOKED_PAGE_OBJECT pMyObject = (PBWRM_COOKED_PAGE_OBJECT)hThisObject;
if ( pMyObject->PagePath )
{
AnscFreeMemory(pMyObject->PagePath);
pMyObject->PagePath = NULL;
}
if ( page_path )
{
pMyObject->PagePath = AnscCloneString(page_path);
}
return ANSC_STATUS_SUCCESS;
}
示例10: AnscFreeMemory
ANSC_STATUS
SlapOwoSetLpcPartyName
(
ANSC_HANDLE hThisObject,
char* party_name
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PSLAP_OBJ_WRAPPER_OBJECT pMyObject = (PSLAP_OBJ_WRAPPER_OBJECT)hThisObject;
if ( pMyObject->LpcPartyName )
{
AnscFreeMemory(pMyObject->LpcPartyName);
pMyObject->LpcPartyName = NULL;
}
if ( party_name )
{
pMyObject->LpcPartyName = AnscCloneString(party_name);
}
return ANSC_STATUS_SUCCESS;
}
示例11: _ansc_sprintf
ANSC_STATUS
ssp_cancel_wifi
(
PCCSP_COMPONENT_CFG pStartCfg
)
{
int nRet = 0;
char CrName[256];
char CpName[256];
if( pDslhCpeController == NULL)
{
return ANSC_STATUS_SUCCESS;
}
if ( g_Subsystem[0] != 0 )
{
_ansc_sprintf(CrName, "%s%s", g_Subsystem, CCSP_DBUS_INTERFACE_CR);
_ansc_sprintf(CpName, "%s%s", g_Subsystem, pStartCfg->ComponentName);
}
else
{
_ansc_sprintf(CrName, "%s", CCSP_DBUS_INTERFACE_CR);
_ansc_sprintf(CpName, "%s", pStartCfg->ComponentName);
}
/* unregister component */
nRet = CcspBaseIf_unregisterComponent(bus_handle, CrName, CpName );
AnscTrace("unregisterComponent returns %d\n", nRet);
pDslhCpeController->Cancel((ANSC_HANDLE)pDslhCpeController);
AnscFreeMemory(pDslhCpeController);
pDslhCpeController = NULL;
return ANSC_STATUS_SUCCESS;
}
示例12: CcspTraceWarning
ANSC_STATUS
CosaNatRegGetNatInfo
(
ANSC_HANDLE hThisObject
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PCOSA_DATAMODEL_NAT pMyObject = ( PCOSA_DATAMODEL_NAT )hThisObject;
PPOAM_IREP_FOLDER_OBJECT pPoamIrepFoNat = (PPOAM_IREP_FOLDER_OBJECT )pMyObject->hIrepFolderNat;
PPOAM_IREP_FOLDER_OBJECT pPoamIrepFoNatPt = (PPOAM_IREP_FOLDER_OBJECT )pMyObject->hIrepFolderNatPt;
PPOAM_IREP_FOLDER_OBJECT pPoamIrepFoEnumNat = (PPOAM_IREP_FOLDER_OBJECT )NULL;
PCOSA_CONTEXT_PMAPPING_LINK_OBJECT pCosaNatContext = NULL;
PCOSA_CONTEXT_LINK_OBJECT pCosaNatPtContext = NULL;
PCOSA_DML_NAT_PMAPPING pCosaNat = NULL;
PCOSA_DML_NAT_PTRIGGER pCosaNatPt = NULL;
PSLAP_VARIABLE pSlapVariable = NULL;
ULONG ulEntryCount = 0;
ULONG ulIndex = 0;
ULONG uInstanceNumber = 0;
BOOL bNew = FALSE;
char* pAliasNat = NULL;
char* pFolderName = NULL;
CcspTraceWarning(("!!!!!! In CosaNatRegGetNatInfo !!!!!!\n"));
if ( !pPoamIrepFoNat || !pPoamIrepFoNatPt )
{
CcspTraceWarning(("!!!!!! pPoamIrepFoNat: %p, pPoamIrepFoNatPt: %p !!!!!!\n", pPoamIrepFoNat, pPoamIrepFoNatPt));
return ANSC_STATUS_FAILURE;
}
/* This is saved structure for nat
*****************************************
<Nat>
<1>
<alias>xxx</>
<bNew>false</>
</1>
<2>
<alias>xxx</>
<bNew>false</>
</2>
</Nat>
****************************************************
*/
/* enumerate Portmapping.{i} */
ulEntryCount = pPoamIrepFoNat->GetFolderCount((ANSC_HANDLE)pPoamIrepFoNat);
for ( ulIndex = 0; ulIndex < ulEntryCount; ulIndex++ )
{
/* Get i in Portmapping.{i} */
pFolderName =
pPoamIrepFoNat->EnumFolder
(
(ANSC_HANDLE)pPoamIrepFoNat,
ulIndex
);
if ( !pFolderName )
{
continue;
}
uInstanceNumber = _ansc_atol(pFolderName);
if ( uInstanceNumber == 0 )
{
AnscFreeMemory(pFolderName);
continue;
}
pPoamIrepFoEnumNat = pPoamIrepFoNat->GetFolder((ANSC_HANDLE)pPoamIrepFoNat, pFolderName);
AnscFreeMemory(pFolderName);
if ( !pPoamIrepFoEnumNat )
{
continue;
}
/* Get PortMapping.{i}.Alias value*/
if ( TRUE )
{
pSlapVariable =
(PSLAP_VARIABLE)pPoamIrepFoEnumNat->GetRecord
(
(ANSC_HANDLE)pPoamIrepFoEnumNat,
COSA_DML_RR_NAME_NATAlias,
NULL
);
if ( pSlapVariable )
{
pAliasNat = AnscCloneString(pSlapVariable->Variant.varString);
SlapFreeVariable(pSlapVariable);
}
}
//.........這裏部分代碼省略.........
示例13: AnscFreeMemory
ANSC_STATUS
StunScoRetryTimerInvoke
(
ANSC_HANDLE hThisObject
)
{
ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS;
PSTUN_SIMPLE_CLIENT_OBJECT pMyObject = (PSTUN_SIMPLE_CLIENT_OBJECT )hThisObject;
PSTUN_SIMPLE_CLIENT_PROPERTY pProperty = (PSTUN_SIMPLE_CLIENT_PROPERTY )&pMyObject->Property;
PANSC_TIMER_DESCRIPTOR_OBJECT pRetryTimerObj = (PANSC_TIMER_DESCRIPTOR_OBJECT )pMyObject->hRetryTimerObj;
PANSC_SIMPLE_CLIENT_UDP_OBJECT pSimpleClientUdp1 = (PANSC_SIMPLE_CLIENT_UDP_OBJECT)pMyObject->hSimpleClientUdp1;
PSTUN_BSM_INTERFACE pStunBsmIf = (PSTUN_BSM_INTERFACE )pMyObject->hStunBsmIf;
/*
* Reliability is accomplished through client retransmissions. Clients SHOULD retransmit the
* request starting with an interval of 100ms, doubling every retransmit until the interval
* reaches 1.6s. Retransmissions continue with intervals of 1.6s until a response is received,
* or a total of 9 requests have been sent. If no response is received by 1.6 seconds after the
* last request has been sent, the client SHOULD consider the transaction to have failed. In
* other words, requests would be sent at times 0ms, 100ms, 300ms, 700ms, 1500ms, 3100ms,
* 4700ms, 6300ms, and 7900ms. At 9500ms, the client considers the transaction to have failed
* if no response has been received.
*/
if ( pMyObject->SocketState1 == STUN_SCO_SOCKET_STATE_Requesting )
{
if ( pMyObject->RetransTime1 >= STUN_MIN_RETRANSMISSION_TIMES )
{
pMyObject->ClientState = STUN_SCO_CLIENT_STATE_Idle;
pMyObject->SocketState1 = STUN_SCO_SOCKET_STATE_Idle;
pMyObject->RetransInterval1 = STUN_MIN_RETRANSMISSION_INTERVAL;
pMyObject->RetransTime1 = 0;
pMyObject->bMsgIntegrity1 = FALSE;
if ( pMyObject->LastSendMsg1 )
{
AnscFreeMemory(pMyObject->LastSendMsg1);
pMyObject->LastSendMsg1 = NULL;
pMyObject->LastMsgSize1 = 0;
}
if ( pStunBsmIf )
{
returnStatus =
pStunBsmIf->Notify
(
pStunBsmIf->hOwnerContext,
STUN_BSM_EVENT_serverUnreachable,
(ANSC_HANDLE)NULL
);
}
return ANSC_STATUS_SUCCESS;
}
if ( pMyObject->LastSendMsg1 )
{
pMyObject->RetransInterval1 = AnscGetMin2(pMyObject->RetransInterval1 * 2, STUN_MAX_RETRANSMISSION_INTERVAL);
pMyObject->RetransTime1 += 1;
returnStatus =
pSimpleClientUdp1->Send2
(
(ANSC_HANDLE)pSimpleClientUdp1,
pProperty->ServerAddr.Value,
pProperty->ServerPort,
pMyObject->LastSendMsg1,
pMyObject->LastMsgSize1,
(ANSC_HANDLE)NULL
);
pRetryTimerObj->SetInterval((ANSC_HANDLE)pRetryTimerObj, pMyObject->RetransInterval1);
pRetryTimerObj->Start ((ANSC_HANDLE)pRetryTimerObj);
}
}
return returnStatus;
}
示例14: CosaDmlDdnsInit
//.........這裏部分代碼省略.........
/* Initialize middle layer */
ulServiceCount = CosaDmlDdnsGetNumberOfServices(NULL);
for ( ulIndex = 0; ulIndex < ulServiceCount; ulIndex++ )
{
pDdnsService = (PCOSA_DML_DDNS_SERVICE)AnscAllocateMemory(sizeof(COSA_DML_DDNS_SERVICE));
if ( !pDdnsService )
{
returnStatus = ANSC_STATUS_RESOURCES;
goto EXIT1;
}
returnStatus = CosaDmlDdnsGetService(NULL, ulIndex, pDdnsService);
if ( returnStatus == ANSC_STATUS_SUCCESS )
{
pCosaContext = (PCOSA_CONTEXT_LINK_OBJECT)AnscAllocateMemory(sizeof(COSA_CONTEXT_LINK_OBJECT));
if ( !pCosaContext )
{
returnStatus = ANSC_STATUS_RESOURCES;
goto EXIT2;
}
if ( pDdnsService->InstanceNumber != 0 )
{
pCosaContext->InstanceNumber = pDdnsService->InstanceNumber;
if ( pMyObject->ulNextInstance <= pDdnsService->InstanceNumber )
{
pMyObject->ulNextInstance = pDdnsService->InstanceNumber + 1;
if ( pMyObject->ulNextInstance == 0 )
{
pMyObject->ulNextInstance = 1;
}
}
}
else
{
pDdnsService->InstanceNumber = pCosaContext->InstanceNumber = pMyObject->ulNextInstance;
pMyObject->ulNextInstance++;
if ( pMyObject->ulNextInstance == 0 )
{
pMyObject->ulNextInstance = 1;
}
/* Generate Alias */
_ansc_sprintf(pDdnsService->Alias, "DdnsService%d", pCosaContext->InstanceNumber);
returnStatus =
CosaDmlDdnsServiceSetValues
(
NULL,
ulIndex,
pCosaContext->InstanceNumber,
pDdnsService->Alias
);
if ( returnStatus != ANSC_STATUS_SUCCESS )
{
CcspTraceWarning(("!!! CosaDmlDdnsServiceSetValues index: %d-- fail !!!\n", ulIndex));
AnscFreeMemory(pDdnsService);
AnscFreeMemory(pCosaContext);
continue;
}
}
pCosaContext->hContext = (ANSC_HANDLE)pDdnsService;
pCosaContext->hParentTable = NULL;
pCosaContext->bNew = FALSE;
CosaSListPushEntryByInsNum(pListHead, pCosaContext);
}
}
/* Load the newly added but not yet committed entries, if exist */
CosaDdnsRegGetDdnsInfo((ANSC_HANDLE)pMyObject);
goto EXIT1;
EXIT2:
AnscFreeMemory(pDdnsService);
EXIT1:
AnscFreeMemory(pDdnsCfg);
return returnStatus;
}
示例15: while
BOOL
DslhVarroIsValidMaskString
(
PCHAR pStringValue
)
{
PANSC_TOKEN_CHAIN pAddrListTokenChain = (PANSC_TOKEN_CHAIN )NULL;
PANSC_STRING_TOKEN pAddrStringToken = (PANSC_STRING_TOKEN )NULL;
ULONG ulMaskValue = 0;
ULONG i = 0;
BOOL bIsValid = FALSE;
if ( !pStringValue || (AnscSizeOfString(pStringValue) == 0) )
{
return TRUE;
}
if ( pAddrListTokenChain = AnscTcAllocate(pStringValue, ".") )
{
if (pAddrListTokenChain->TokensQueue.Depth != 0x4)
{
goto EXIT;
}
while ( pAddrStringToken = AnscTcUnlinkToken(pAddrListTokenChain) )
{
ulMaskValue = (ulMaskValue<<0x8) + AnscGetStringUlong(pAddrStringToken->Name);
AnscFreeMemory(pAddrStringToken);
}
if ( ! ulMaskValue )
{
bIsValid = TRUE;
goto EXIT;
}
for ( i = 0; !(ulMaskValue & 0x1); i++)
{
ulMaskValue >>= 0x1;
}
/* Subnet mask shorter than 8 bits is rejected */
if ( i > 24)
{
goto EXIT;
}
else if ( (!i && !(~(0x0 ^ ulMaskValue))) /* 255.255.255.255 */
||
! (~( ( (~0x0<<(32-i))) ^ ulMaskValue )) /* Other subnet masks */
)
{
bIsValid = TRUE;
goto EXIT;
}
}
EXIT:
if ( pAddrListTokenChain )
{
AnscTcFree((ANSC_HANDLE)pAddrListTokenChain);
}
return bIsValid;
}