ANSC_STATUS
HttpBmoSaveAsBody
    (
        ANSC_HANDLE                 hThisObject,
        PVOID                       buffer,
        ULONG                       ulSize
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PHTTP_BASIC_MESSAGE_OBJECT      pMyObject    = (PHTTP_BASIC_MESSAGE_OBJECT)hThisObject;
    PHTTP_HFP_INTERFACE             pHfpIf       = (PHTTP_HFP_INTERFACE       )pMyObject->hHfpIf;
    PHTTP_TMH_INTERFACE             pTmhIf       = (PHTTP_TMH_INTERFACE       )pMyObject->hTmhIf;
    PHTTP_BCC_INTERFACE             pBccIf       = (PHTTP_BCC_INTERFACE       )pMyObject->hBccIf;
    PHTTP_MESSAGE_BODY_OBJECT       pMessageBody = (PHTTP_MESSAGE_BODY_OBJECT )pMyObject->hMessageBody;

    if ( !pMessageBody )
    {
        pMessageBody = (PHTTP_MESSAGE_BODY_OBJECT)pMyObject->CreateMessageBody((ANSC_HANDLE)pMyObject);

        if ( !pMessageBody )
        {
            return  ANSC_STATUS_RESOURCES;
        }
        else
        {
            pMyObject->hMessageBody = (ANSC_HANDLE)pMessageBody;

            pMessageBody->SetMode ((ANSC_HANDLE)pMessageBody, pMyObject->MboMode );
            pMessageBody->SetHfpIf((ANSC_HANDLE)pMessageBody, (ANSC_HANDLE)pHfpIf);
            pMessageBody->SetBccIf((ANSC_HANDLE)pMessageBody, (ANSC_HANDLE)pBccIf);
        }
    }

    if ( pMessageBody )
    {
        returnStatus =
            pMessageBody->SaveAsBody
                (
                    (ANSC_HANDLE)pMessageBody,
                    buffer,
                    ulSize
                );
    }

    return  returnStatus;
}
ANSC_STATUS
HttpBmoAppendBodyBdo
    (
        ANSC_HANDLE                 hThisObject,
        ANSC_HANDLE                 hBdo
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PHTTP_BASIC_MESSAGE_OBJECT      pMyObject    = (PHTTP_BASIC_MESSAGE_OBJECT)hThisObject;
    PHTTP_HFP_INTERFACE             pHfpIf       = (PHTTP_HFP_INTERFACE       )pMyObject->hHfpIf;
    PHTTP_TMH_INTERFACE             pTmhIf       = (PHTTP_TMH_INTERFACE       )pMyObject->hTmhIf;
    PHTTP_BCC_INTERFACE             pBccIf       = (PHTTP_BCC_INTERFACE       )pMyObject->hBccIf;
    PHTTP_MESSAGE_BODY_OBJECT       pMessageBody = (PHTTP_MESSAGE_BODY_OBJECT )pMyObject->hMessageBody;
    PANSC_BUFFER_DESCRIPTOR         pBodyBdo     = (PANSC_BUFFER_DESCRIPTOR   )hBdo;

    if ( !pMessageBody )
    {
        pMessageBody = (PHTTP_MESSAGE_BODY_OBJECT)pMyObject->CreateMessageBody((ANSC_HANDLE)pMyObject);

        if ( !pMessageBody )
        {
            return  ANSC_STATUS_RESOURCES;
        }
        else
        {
            pMyObject->hMessageBody = (ANSC_HANDLE)pMessageBody;

            pMessageBody->SetMode ((ANSC_HANDLE)pMessageBody, pMyObject->MboMode );
            pMessageBody->SetHfpIf((ANSC_HANDLE)pMessageBody, (ANSC_HANDLE)pHfpIf);
            pMessageBody->SetBccIf((ANSC_HANDLE)pMessageBody, (ANSC_HANDLE)pBccIf);
        }
    }

    if ( pMessageBody )
    {
        returnStatus =
            pMessageBody->AppendBodyBdo
                (
                    (ANSC_HANDLE)pMessageBody,
                    (ANSC_HANDLE)pBodyBdo
                );
    }

    return  returnStatus;
}
ANSC_STATUS
HttpBmoAppendBody
    (
        ANSC_HANDLE                 hThisObject,
        PVOID                       buffer,
        ULONG                       ulSize
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PHTTP_BASIC_MESSAGE_OBJECT      pMyObject    = (PHTTP_BASIC_MESSAGE_OBJECT)hThisObject;
    PHTTP_HFP_INTERFACE             pHfpIf       = (PHTTP_HFP_INTERFACE       )pMyObject->hHfpIf;
    PHTTP_TMH_INTERFACE             pTmhIf       = (PHTTP_TMH_INTERFACE       )pMyObject->hTmhIf;
    PHTTP_BCC_INTERFACE             pBccIf       = (PHTTP_BCC_INTERFACE       )pMyObject->hBccIf;
    PHTTP_MESSAGE_BODY_OBJECT       pMessageBody = (PHTTP_MESSAGE_BODY_OBJECT )pMyObject->hMessageBody;
    PANSC_BUFFER_DESCRIPTOR         pBodyBdo     = (PANSC_BUFFER_DESCRIPTOR   )NULL;

    if ( !pMessageBody )
    {
        pMessageBody = (PHTTP_MESSAGE_BODY_OBJECT)pMyObject->CreateMessageBody((ANSC_HANDLE)pMyObject);

        if ( !pMessageBody )
        {
            return  ANSC_STATUS_RESOURCES;
        }
        else
        {
            pMyObject->hMessageBody = (ANSC_HANDLE)pMessageBody;

            pMessageBody->SetMode ((ANSC_HANDLE)pMessageBody, pMyObject->MboMode );
            pMessageBody->SetHfpIf((ANSC_HANDLE)pMessageBody, (ANSC_HANDLE)pHfpIf);
            pMessageBody->SetBccIf((ANSC_HANDLE)pMessageBody, (ANSC_HANDLE)pBccIf);
        }
    }

    if ( TRUE )
    {
        pBodyBdo =
            (PANSC_BUFFER_DESCRIPTOR)AnscAllocateBdo
                (
                    ulSize,
                    0,
                    ulSize
                );

        if ( !pBodyBdo )
        {
            return  ANSC_STATUS_RESOURCES;
        }
        else
        {
            AnscCopyMemory
                (
                    AnscBdoGetBlock(pBodyBdo),
                    buffer,
                    ulSize
                );
        }
    }

    if ( pMessageBody )
    {
        returnStatus =
            pMessageBody->AppendBodyBdo
                (
                    (ANSC_HANDLE)pMessageBody,
                    (ANSC_HANDLE)pBodyBdo
                );
    }

    return  returnStatus;
}