当前位置: 首页>>代码示例>>C++>>正文


C++ AnscAllocateMemory函数代码示例

本文整理汇总了C++中AnscAllocateMemory函数的典型用法代码示例。如果您正苦于以下问题:C++ AnscAllocateMemory函数的具体用法?C++ AnscAllocateMemory怎么用?C++ AnscAllocateMemory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了AnscAllocateMemory函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TlsRcoEnrollObjects

ANSC_STATUS
TlsHsoEnrollObjects
    (
        ANSC_HANDLE                 hThisObject
    )
{
    PTLS_HAND_SHAKER_OBJECT         pMyObject      = (PTLS_HAND_SHAKER_OBJECT      )hThisObject;
    PANSC_TIMER_DESCRIPTOR_OBJECT   pStateTimerObj = (PANSC_TIMER_DESCRIPTOR_OBJECT)pMyObject->hStateTimerObj;
    PANSC_TDO_CLIENT_OBJECT         pStateTimerIf  = (PANSC_TDO_CLIENT_OBJECT      )pMyObject->hStateTimerIf;

    if ( !pStateTimerObj )
    {
        pStateTimerObj =
            (PANSC_TIMER_DESCRIPTOR_OBJECT)AnscCreateTimerDescriptor
                (
                    pMyObject->hContainerContext,
                    (ANSC_HANDLE)pMyObject,
                    (ANSC_HANDLE)NULL
                );

        if ( !pStateTimerObj )
        {
            return  ANSC_STATUS_RESOURCES;
        }
        else
        {
            pMyObject->hStateTimerObj = (ANSC_HANDLE)pStateTimerObj;
        }

        pStateTimerObj->SetTimerType((ANSC_HANDLE)pStateTimerObj, ANSC_TIMER_TYPE_SPORADIC );
        pStateTimerObj->SetInterval ((ANSC_HANDLE)pStateTimerObj, TLS_HSO_DEF_STATE_TIMEOUT);
    }

    if ( !pStateTimerIf )
    {
        pStateTimerIf = (PANSC_TDO_CLIENT_OBJECT)AnscAllocateMemory(sizeof(ANSC_TDO_CLIENT_OBJECT));

        if ( !pStateTimerIf )
        {
            return  ANSC_STATUS_RESOURCES;
        }
        else
        {
            pMyObject->hStateTimerIf = (ANSC_HANDLE)pStateTimerIf;
        }

        pStateTimerIf->hClientContext = (ANSC_HANDLE)pMyObject;
        pStateTimerIf->Invoke         = TlsHsoStateTimerInvoke;

        pStateTimerObj->SetClient((ANSC_HANDLE)pStateTimerObj, (ANSC_HANDLE)pStateTimerIf);
    }

    TlsRcoEnrollObjects((ANSC_HANDLE)pMyObject);

    return  ANSC_STATUS_SUCCESS;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspCommonLibrary,代码行数:56,代码来源:tls_hso_base.c

示例2: CosaProcStatusCreate

ANSC_HANDLE CosaProcStatusCreate()
{
    PCOSA_DATAMODEL_PROCSTATUS p_info = NULL;

    p_info = AnscAllocateMemory(sizeof(COSA_DATAMODEL_PROCSTATUS));
    AnscZeroMemory(p_info, sizeof(COSA_DATAMODEL_PROCSTATUS));
    p_info->pProcTable = NULL;

    return p_info;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspPandM,代码行数:10,代码来源:cosa_deviceinfo_apis.c

示例3: return

ANSC_HANDLE
DslhVareoCreate
    (
        ANSC_HANDLE                 hContainerContext,
        ANSC_HANDLE                 hOwnerContext,
        ANSC_HANDLE                 hAnscReserved
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PDSLH_VAR_ENTITY_OBJECT         pMyObject    = NULL;

    /*
     * We create object by first allocating memory for holding the variables and member functions.
     */
    pMyObject = (PDSLH_VAR_ENTITY_OBJECT)AnscAllocateMemory(sizeof(DSLH_VAR_ENTITY_OBJECT));

    if ( !pMyObject )
    {
        return  (ANSC_HANDLE)NULL;
    }

    /*
     * Initialize the common variables and functions for a container object.
     */
    pMyObject->hParentObjEntity      = (ANSC_HANDLE)NULL;
    pMyObject->ParamDescr            = NULL;
    pMyObject->DataType              = DSLH_CWMP_DATA_TYPE_unspecified;
    pMyObject->Syntax                = SLAP_VAR_SYNTAX_string;
    pMyObject->FormatValue1          = 0;
    pMyObject->FormatValue2          = 0;
    pMyObject->Notification          = DSLH_CWMP_NOTIFICATION_off;

    pMyObject->TokenTable            = NULL;

#if 0
    pMyObject->CallEntry_GetValue    = 0;
    pMyObject->CallEntry_TstValue    = 0;
    pMyObject->CallEntry_SetValue    = 0;

    pMyObject->Reset                 = DslhVareoReset;
    pMyObject->Remove                = DslhVareoRemove;

    pMyObject->CfgTokenTable         = DslhVareoCfgTokenTable;
    pMyObject->GetTokenValueByString = DslhVareoGetTokenValueByString;
    pMyObject->GetTokenValueByCode   = DslhVareoGetTokenValueByCode;
    pMyObject->AddTokenValue         = DslhVareoAddTokenValue;
#endif

#ifdef _DEBUG
	g_VarEntity ++;
#endif

    return  (ANSC_HANDLE)pMyObject;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:54,代码来源:dslh_vareo_base.c

示例4: anscFreeCertHandle

ANSC_X501_NAME*
AnscX509CertGetSubject
    (
        void*                       raw_cert_data,
        ULONG                       raw_cert_size
    )
{
    ANSC_X501_NAME*                 pSubjectName    = NULL;
    PANSC_ASN1_CERTIFICATE          pAsnCert        = NULL;
    PANSC_ASN1_NAME                 pAsnName        = NULL;
    PUCHAR                          pBack           = (PUCHAR)raw_cert_data;
    ULONG                           length;

    /* decode the asn.1 certificate handle */
    pAsnCert = (PANSC_ASN1_CERTIFICATE)
        anscGetCertHandle
            (
                raw_cert_data,
                raw_cert_size
            );

    if( pAsnCert == NULL)
    {
        goto EXIT;
    }

    /* get the asn1 subject name object */
    pAsnName = (PANSC_ASN1_NAME)pAsnCert->GetSubjectHandle(pAsnCert);

    if( pAsnName == NULL || pAsnName->bOptional)
    {
        goto EXIT;
    }

    length = pAsnName->GetSizeOfEncoded(pAsnName);

    /* create the X501Name object */
    pSubjectName = (PANSC_X501_NAME)AnscAllocateMemory(sizeof(ULONG) + length);

    if( pSubjectName == NULL)
    {
        goto EXIT;
    }

    pSubjectName->Length = length;
    pBack = pSubjectName->Data;
    pAsnName->EncodingData(pAsnName, (PVOID*)&pBack);

EXIT:

    anscFreeCertHandle((ANSC_HANDLE)pAsnCert);

    return  pSubjectName;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspCommonLibrary,代码行数:54,代码来源:ansc_x509_cert.c

示例5:

void
AnscPtrArraySetSize
    (
        ANSC_HANDLE                 hThisObject,
        ULONG                       ulNewSize,
        ULONG                       ulGrowBy
    )
{
    PANSC_PTR_ARRAY_OBJECT          pPtrArray  = (PANSC_PTR_ARRAY_OBJECT)hThisObject;

    /* enlarge the storage if neccessary */

    if (!pPtrArray)
        return;

    /* change the growth if it's not "-1" (0xFFFFFFFF) */
    if (ulGrowBy != (ULONG)-1)
    {
        pPtrArray->SetGrowth(hThisObject, ulGrowBy);
    }

    if (pPtrArray->ulMaxItemCount != ulNewSize)
    {
        PANSC_PTR_ARRAY_OBJECT      pBuf;
        ULONG                       ulBufSize;

        ulBufSize   = ANSC_PTR_ARRAY_ITEM_SIZE * ulNewSize;

        /* resize the storage to the given size */
        if (!pPtrArray->hStorage)
        {
            pBuf    = (PANSC_PTR_ARRAY_OBJECT)AnscAllocateMemory(ulBufSize);
        }
        else
        {
/*
            pBuf    = (PANSC_PTR_ARRAY_OBJECT)AnscReAllocMemory(pPtrArray->hStorage, ulBufSize);
*/

            pBuf    = 
                (PANSC_PTR_ARRAY_OBJECT)AnscMemUtilRealloc
                    (
                        pPtrArray->hStorage, 
                        pPtrArray->ulMaxItemCount * ANSC_PTR_ARRAY_ITEM_SIZE, 
                        ulBufSize
                    );
        }

        pPtrArray->hStorage        = (ANSC_HANDLE)pBuf;
        pPtrArray->ulMaxItemCount  = ulNewSize;
        pPtrArray->ulItemCount     = ulNewSize;
    }
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:53,代码来源:ansc_ptr_array_co_process.c

示例6: return

ANSC_HANDLE
AnscOmoCreate
    (
        ANSC_HANDLE                 hOwnerContext
    )
{
    ANSC_STATUS                     returnStatus  = ANSC_STATUS_SUCCESS;
    PANSC_OBJECT_MAPPER_OBJECT      pObjectMapper = NULL;
    ULONG                           i             = 0;

    pObjectMapper = (PANSC_OBJECT_MAPPER_OBJECT)AnscAllocateMemory(sizeof(ANSC_OBJECT_MAPPER_OBJECT));

    if ( !pObjectMapper )
    {
        return  (ANSC_HANDLE)NULL;
    }

    pObjectMapper->hContainerContext   = (ANSC_HANDLE)NULL;
    pObjectMapper->hOwnerContext       = hOwnerContext;

    pObjectMapper->Create              = AnscOmoCreate;
    pObjectMapper->Remove              = AnscOmoRemove;
    pObjectMapper->Reset               = AnscOmoReset;

    pObjectMapper->GetContainerContext = AnscOmoGetContainerContext;
    pObjectMapper->SetContainerContext = AnscOmoSetContainerContext;

    pObjectMapper->RegisterObject      = AnscOmoRegisterObject;
    pObjectMapper->CreateObjectByName  = AnscOmoCreateObjectByName;
    pObjectMapper->CreateObjectByOid   = AnscOmoCreateObjectByOid;
    pObjectMapper->CreateObjectByType  = AnscOmoCreateObjectByType;
    pObjectMapper->GetObjectByRid      = AnscOmoGetObjectByRid;

    pObjectMapper->GetObjectsCount     = AnscOmoGetObjectsCount;
    pObjectMapper->Serialize           = AnscOmoSerialize;
    pObjectMapper->Interpret           = AnscOmoInterpret;

    pObjectMapper->AddDescriptor       = AnscOmoAddDescriptor;
    pObjectMapper->DelDescriptor       = AnscOmoDelDescriptor;
    pObjectMapper->DelAllDescriptors   = AnscOmoDelAllDescriptors;

    pObjectMapper->GetDescriptorByName = AnscOmoGetDescriptorByName;
    pObjectMapper->GetDescriptorByOid  = AnscOmoGetDescriptorByOid;
    pObjectMapper->GetDescriptorByType = AnscOmoGetDescriptorByType;

    for ( i = 0; i < DEFAULT_OD_TABLE_SIZE; i++ )
    {
        AnscSListInitializeHeader(&pObjectMapper->DescriptorTable[i]);
    }
    AnscInitializeLock(&pObjectMapper->DescriptorTableLock);

    return  (ANSC_HANDLE)pObjectMapper;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:53,代码来源:ansc_object_mapper_base.c

示例7: UserAllocateMemory

PVOID
UserAllocateMemory(ULONG  ulMemorySize)
{
    PVOID p =  AnscAllocateMemory(ulMemorySize);
    if ( !p )
    {
        return  p;
    }
    memset(p, 0, ulMemorySize);
/*    printf("Alloc: %x\n", p); */
    return p;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:12,代码来源:user_memory.c

示例8: AnscCloneString

char*
SlapBmc2InoRead2
    (
        ANSC_HANDLE                 hThisObject,
        char*                       pDefaultValue,
        SLAP_BOOL                   bSizeFixed,
        SLAP_BOOL                   bMaskInput,
        SLAP_UINT32                 ulWidth
    )
{
    ANSC_STATUS                     returnStatus        = ANSC_STATUS_SUCCESS;
    PSLAP_BMC2_INPUT_OBJECT         pMyObject           = (PSLAP_BMC2_INPUT_OBJECT    )hThisObject;
    PBMC2_REQ_CONTROLLER_OBJECT     pBmc2ReqController  = (PBMC2_REQ_CONTROLLER_OBJECT)pMyObject->hInsContext;
    PBMC2_COM_DOMAIN_OBJECT         pBmc2ComDomain      = (PBMC2_COM_DOMAIN_OBJECT    )pBmc2ReqController->hBmc2ComDomain;
    PBMC2_COM_TERMINAL_OBJECT       pBmc2ComTerminal    = (PBMC2_COM_TERMINAL_OBJECT  )pBmc2ComDomain->hBmc2ComTerminal;
    PBMC2_ICE_INTERFACE             pBmc2IceIf          = (PBMC2_ICE_INTERFACE        )pBmc2ComTerminal->GetBmc2IceIf((ANSC_HANDLE)pBmc2ComTerminal);
    PBMC2_ICE_TEXTBOX_INFO          pBmc2IceTextboxInfo = (PBMC2_ICE_TEXTBOX_INFO     )NULL;
    char*                           pUserInput          = NULL;

    if ( !pBmc2IceIf )
    {
        return  NULL;
    }
    else
    {
        pBmc2IceTextboxInfo = (PBMC2_ICE_TEXTBOX_INFO)AnscAllocateMemory(sizeof(BMC2_ICE_TEXTBOX_INFO));
    }

    if ( !pBmc2IceTextboxInfo )
    {
        return  NULL;
    }
    else
    {
        pBmc2IceTextboxInfo->Name         = NULL;
        pBmc2IceTextboxInfo->DefaultValue = AnscCloneString(pDefaultValue);
        pBmc2IceTextboxInfo->bSizeFixed   = bSizeFixed;
        pBmc2IceTextboxInfo->bMaskInput   = bMaskInput;
        pBmc2IceTextboxInfo->Width        = ulWidth;
    }

    returnStatus =
        pBmc2IceIf->ReadInput2
            (
                pBmc2IceIf->hOwnerContext,
                (ANSC_HANDLE)pBmc2IceTextboxInfo,
                &pUserInput
            );

    AnscFreeMemory(pBmc2IceTextboxInfo);

    return  pUserInput;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:53,代码来源:slap_bmc2ino_access.c

示例9: AnscSizeOfString

void
AnscStringArrayInsertAt
    (
        ANSC_HANDLE                 hThisObject,
        ULONG                       ulIndex,
        ANSC_OBJECT_ARRAY_DATA      Data,
        ULONG                       ulCount
    )
{
    PANSC_STRING_ARRAY_OBJECT       pStringArray  = (PANSC_STRING_ARRAY_OBJECT)hThisObject;

    if (!pStringArray || ulIndex >= pStringArray->ulItemCount || Data == 0)
        return;
    else
    {
        ULONG                       i;
        PUCHAR                      *pStorage;
        PUCHAR                      pData, pStr;
        ULONG                       ulStrLen;
  
        if (ulCount + pStringArray->ulItemCount > pStringArray->ulMaxItemCount)
        {
            /* resize the storage */
            pStringArray->EnlargeStorage(hThisObject, pStringArray->ulItemCount + ulCount);
        }

        if (ulCount + pStringArray->ulItemCount > pStringArray->ulMaxItemCount)
        {
            /* failed to enlarge the storage */
            return;
        }

        /* move items after the given index (inclusive) */
        pStorage    = (PUCHAR *)pStringArray->hStorage;
        for (i = pStringArray->ulItemCount - 1; i >= ulIndex; i --)
        {
            pStorage[i + ulCount] = pStorage[i];
        }

        pStringArray->ulItemCount += ulCount;

        for (i = 0; i < ulCount; i ++)
        {
            pData       = (PUCHAR)Data;
            ulStrLen    = AnscSizeOfString(pData);
            pStr        = (PUCHAR)AnscAllocateMemory(ulStrLen + 1);
            AnscCopyString(pStr, pData);

            pStorage[i + ulIndex]   = pStr;
        }
    }
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:52,代码来源:ansc_string_array_co_process.c

示例10: return

ANSC_HANDLE
SlapOmoGetObjProxy1
    (
        ANSC_HANDLE                 hThisObject,
        char*                       path
    )
{
    ANSC_STATUS                     returnStatus    = ANSC_STATUS_SUCCESS;
    PSLAP_OBJ_MAPPER_OBJECT         pMyObject       = (PSLAP_OBJ_MAPPER_OBJECT  )hThisObject;
    PSLAP_OBJ_MAPPER_PROPERTY       pProperty       = (PSLAP_OBJ_MAPPER_PROPERTY)&pMyObject->Property;
    PSLAP_OBJ_BROKER_OBJECT         pRootObjBroker  = (PSLAP_OBJ_BROKER_OBJECT  )pMyObject->hRootObjBroker;
    PSLAP_OBJ_PROXY_OBJECT          pObjProxy       = NULL;
    PANSC_TOKEN_CHAIN               pPathTokenChain = NULL;
    PANSC_STRING_TOKEN              pPathToken      = NULL;

    pPathTokenChain = (PANSC_TOKEN_CHAIN)AnscAllocateMemory(sizeof(ANSC_TOKEN_CHAIN));

    if ( !pPathTokenChain )
    {
        return  (ANSC_HANDLE)NULL;
    }
    else
    {
        returnStatus =
            AnscSetTokenChain
                (
                    (ANSC_HANDLE)pPathTokenChain,
                    path,
                    SLAP_OBJ_PATH_SEPARATORS
                );
    }

    if ( returnStatus == ANSC_STATUS_SUCCESS )
    {
        pObjProxy =
            pMyObject->GetObjProxy2
                (
                    (ANSC_HANDLE)pMyObject,
                    (ANSC_HANDLE)pPathTokenChain
                );
    }
    else
    {
        pObjProxy = (ANSC_HANDLE)NULL;
    }

    AnscDelTokenChain((ANSC_HANDLE)pPathTokenChain);
    AnscFreeMemory   ((ANSC_HANDLE)pPathTokenChain);

    return  (ANSC_HANDLE)pObjProxy;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:51,代码来源:slap_omo_management.c

示例11: sizeof

ANSC_STATUS
AnscLpccoTcpSendHello
    (
        ANSC_HANDLE                 hThisObject,
        ANSC_HANDLE                 hSocket
    )
{
    ANSC_STATUS                     returnStatus      = ANSC_STATUS_SUCCESS;
    PANSC_LPCCO_TCP_OBJECT          pMyObject         = (PANSC_LPCCO_TCP_OBJECT        )hThisObject;
    PANSC_DAEMON_SERVER_TCP_OBJECT  pDaemonServer     = (PANSC_DAEMON_SERVER_TCP_OBJECT)pMyObject->hDaemonServer;
    PANSC_BROKER_SERVER_TCP_OBJECT  pBrokerServer     = (PANSC_BROKER_SERVER_TCP_OBJECT)pMyObject->hBrokerServer;
    PANSC_BROKER_SOCKET_TCP_OBJECT  pBrokerSocket     = (PANSC_BROKER_SOCKET_TCP_OBJECT)hSocket;
    PIMCP_HEADER                    pImcpHeader       = (PIMCP_HEADER                  )NULL;
    PIMCP_HELLO_MESSAGE             pImcpHelloMessage = (PIMCP_HELLO_MESSAGE           )NULL;
    ULONG                           ulImcpMsgSize     = (ULONG                         )0;

    if ( TRUE )
    {
        ulImcpMsgSize = sizeof(IMCP_HEADER) + sizeof(IMCP_HELLO_MESSAGE) + AnscSizeOfString(pMyObject->PartyName);
        pImcpHeader   = (PIMCP_HEADER)AnscAllocateMemory(ulImcpMsgSize);

        if ( !pImcpHeader )
        {
            return  ANSC_STATUS_RESOURCES;
        }
        else
        {
            ImcpSetMsgType  (pImcpHeader, IMCP_MESSAGE_TYPE_HELLO            );
            ImcpSetMsgLength(pImcpHeader, ulImcpMsgSize - sizeof(IMCP_HEADER));

            pImcpHelloMessage = (PIMCP_HELLO_MESSAGE)ImcpGetMsgData(pImcpHeader);
        }

        ImcpHelloSetPartyAddrValue(pImcpHelloMessage, pMyObject->MyAddress.Value);
        ImcpHelloSetPartyPort     (pImcpHelloMessage, pMyObject->MyPort         );
        ImcpHelloSetPartyName     (pImcpHelloMessage, pMyObject->PartyName      );
    }

    returnStatus =
        pBrokerSocket->Send
            (
                (ANSC_HANDLE)pBrokerSocket,
                pImcpHeader,
                ulImcpMsgSize,
                (ANSC_HANDLE)NULL
            );

    AnscFreeMemory(pImcpHeader);

    return  returnStatus;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:51,代码来源:ansc_lpccotcp_send.c

示例12: AnscAllocateMemory

/**********************************************************************

    prototype:

        ANSC_HANDLE
        CcspCreateNamespaceMgr
            (
                char*                       pContainerName
            );

    description:

        This function is called to create a NamespaceComponent object

    argument:   char*                       pContainerName

    return:     The NamespaceComponent handle;

**********************************************************************/
ANSC_HANDLE
CcspCreateNamespaceMgr
    (
        char*                       pContainerName
    )
{
    PCCSP_NAMESPACE_MGR_OBJECT      pThisObject  = (PCCSP_NAMESPACE_MGR_OBJECT)NULL;

    pThisObject = (PCCSP_NAMESPACE_MGR_OBJECT)
        AnscAllocateMemory(sizeof(CCSP_NAMESPACE_MGR_OBJECT));

    if( pThisObject == NULL)
    {
        return NULL;
    }
    /*
     * Initialize the common variables and functions.
     */

    AnscCopyString(pThisObject->pContainerName, pContainerName);

    pThisObject->uTotalNamespace                    = 0;

    AnscQueueInitializeHeader(&pThisObject->ComponentQueue);

    pThisObject->GetCountOfRegNamespace             = CcspNsMgrGetCountOfRegNamespace;
    pThisObject->LookforComponent                   = CcspNsMgrLookforComponent;
    pThisObject->RegisterNamespaces                 = CcspNsMgrRegisterNamespaces;
    pThisObject->BuildNamespaces                    = CcspNsMgrBuildNamespaces;
    pThisObject->UnregisterNamespace                = CcspNsMgrUnregisterNamespace;
    pThisObject->UnregisterComponent                = CcspNsMgrUnregisterComponent;
    pThisObject->DiscoverNamespace                  = CcspNsMgrDiscoverNamespace;
    pThisObject->CheckNamespaceDataType             = CcspNsMgrCheckNamespaceDataType;
    pThisObject->GetRegisteredComponents            = CcspNsMgrGetRegisteredComponents;
    pThisObject->GetNamespaceByComponent            = CcspNsMgrGetNamespaceByComponent;
    pThisObject->DumpObject                         = CcspNsMgrDumpObject;
    pThisObject->CleanAll                           = CcspNsMgrCleanAll;

    /* create the hash table */
    pThisObject->hAtomNamespace =
        AnscCreateAtomTable
            (
                (ANSC_HANDLE)pThisObject,
                (ANSC_HANDLE)pThisObject,
                NULL
            );


    return (ANSC_HANDLE)pThisObject;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:69,代码来源:ccsp_ns_mgr_base.c

示例13:

ANSC_STATUS
WebRooDoConnect
    (
        ANSC_HANDLE                 hThisObject,
        ANSC_HANDLE                 hBmoReq,
        ANSC_HANDLE                 hBmoRep
    )
{
    ANSC_STATUS                     returnStatus    = ANSC_STATUS_SUCCESS;
    PWEB_RESOURCE_OWNER_OBJECT      pMyObject       = (PWEB_RESOURCE_OWNER_OBJECT  )hThisObject;
    PWEB_RESOURCE_OWNER_PROPERTY    pProperty       = (PWEB_RESOURCE_OWNER_PROPERTY)&pMyObject->Property;
    PHTTP_RCP_INTERFACE             pRcpIf          = (PHTTP_RCP_INTERFACE         )pMyObject->hRcpIf;
    PHTTP_BMO_REQ_OBJECT            pBmoReq         = (PHTTP_BMO_REQ_OBJECT        )hBmoReq;
    PHTTP_BMO_REP_OBJECT            pBmoRep         = (PHTTP_BMO_REP_OBJECT        )hBmoRep;
    PHTTP_REQUEST_INFO              pReqInfo        = (PHTTP_REQUEST_INFO          )pBmoReq->GetReqInfo    ((ANSC_HANDLE)pBmoReq);
    PANSC_TOKEN_CHAIN               pPathTokenChain = (PANSC_TOKEN_CHAIN           )pBmoReq->GetRecvContext((ANSC_HANDLE)pBmoReq);
    PWEB_GENERAL_SESSION_OBJECT     pSession        = (PWEB_GENERAL_SESSION_OBJECT )pBmoRep->GetRecvContext((ANSC_HANDLE)pBmoRep);
    PHTTP_HFO_ALLOW                 pHttpHfoAllow   = NULL;

    pHttpHfoAllow = (PHTTP_HFO_ALLOW)AnscAllocateMemory(sizeof(HTTP_HFO_ALLOW));

    if ( !pHttpHfoAllow )
    {
        return  ANSC_STATUS_RESOURCES;
    }
    else
    {
        pHttpHfoAllow->HashIndex      = 0;
        pHttpHfoAllow->Flags          = 0;
        pHttpHfoAllow->HeaderId       = HTTP_HEADER_ID_ALLOW;

        pHttpHfoAllow->MethodCount    = 4;
        pHttpHfoAllow->MethodArray[0] = HTTP_METHOD_CODE_OPTIONS;
        pHttpHfoAllow->MethodArray[1] = HTTP_METHOD_CODE_GET;
        pHttpHfoAllow->MethodArray[2] = HTTP_METHOD_CODE_HEAD;
        pHttpHfoAllow->MethodArray[3] = HTTP_METHOD_CODE_POST;
    }

    returnStatus =
        pMyObject->ReplyReq
            (
                (ANSC_HANDLE)pMyObject,
                (ANSC_HANDLE)pBmoReq,
                (ANSC_HANDLE)pBmoRep,
                HTTP_STATUS_METHOD_NOT_ALLOWED,
                (ANSC_HANDLE)pHttpHfoAllow
            );

    return  returnStatus;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:50,代码来源:web_roo_do_stuff.c

示例14: AnscCopyMemory

/* This is to get all 
 */
ANSC_STATUS
CosaDmlDhcpv6cGetReceivedOptionCfg
    (
        ANSC_HANDLE                 hContext,
        ULONG                       ulClientInstanceNumber,
        PCOSA_DML_DHCPCV6_RECV     *ppEntry,
        PULONG                      pSize
    )
{   
    *ppEntry = (PCOSA_DML_DHCPCV6_RECV)AnscAllocateMemory( sizeof(g_dhcpv6_client_recv) );
    AnscCopyMemory( *ppEntry, &g_dhcpv6_client_recv[0], sizeof(g_dhcpv6_client_recv) );
    *pSize = sizeof(g_dhcpv6_client_recv) / sizeof(COSA_DML_DHCPCV6_RECV);
        
    return ANSC_STATUS_SUCCESS;
}
开发者ID:rdkcmf,项目名称:rdkb-CcspPandM,代码行数:17,代码来源:cosa_dhcpv6_apis.c

示例15: sizeof

void
SlapVhoCloneParamList
    (
        ANSC_HANDLE                 hThisObject,
        ANSC_HANDLE                 src_param_list,
        ANSC_HANDLE*                dst_param_list
    )
{
    PSLAP_PARAMETER_LIST            src_list = (PSLAP_PARAMETER_LIST)src_param_list;
    PSLAP_PARAMETER_LIST            dst_list = (PSLAP_PARAMETER_LIST)*dst_param_list;
    ULONG                           ii       = 0;

    if ( !dst_list )
    {
        dst_list =
            (PSLAP_PARAMETER_LIST)AnscAllocateMemory
                (
                    sizeof(SLAP_PARAMETER_LIST)
                );

        if ( dst_list )
        {
            dst_list->ParamCount = 0;
        }
    }
    else
    {
        SlapCleanParamList(dst_list);
    }

    if ( dst_list )
    {
        dst_list->ParamCount = src_list->ParamCount;

        for ( ii = 0; ii < src_list->ParamCount; ii++ )
        {
            SlapCloneVariable
                (
                    (&src_list->ParamArray[ii]),
                    (&dst_list->ParamArray[ii])
                );
        }
    }

    *dst_param_list = dst_list;

    return;
}
开发者ID:davekimble,项目名称:CcspCommonLibrary,代码行数:48,代码来源:slap_vho_plist.c


注:本文中的AnscAllocateMemory函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。