ANSC_STATUS
SlapOboRemove
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus   = ANSC_STATUS_SUCCESS;
    PSLAP_OBJ_BROKER_OBJECT         pMyObject      = (PSLAP_OBJ_BROKER_OBJECT)hThisObject;
    PSLAP_OBJ_ENTITY_OBJECT         pSlapObjEntity = (PSLAP_OBJ_ENTITY_OBJECT)pMyObject->hSlapObjEntity;
    PSLAP_OBJ_PROXY_OBJECT          pSlapObjProxy  = (PSLAP_OBJ_PROXY_OBJECT )pMyObject->hSlapObjProxy;

    if ( pMyObject->PathName )
    {
        AnscFreeMemory(pMyObject->PathName);

        pMyObject->PathName = NULL;
    }

    pMyObject->DelAllObjBrokers((ANSC_HANDLE)pMyObject);

    if ( pSlapObjEntity )
    {
        pSlapObjEntity->Remove((ANSC_HANDLE)pSlapObjEntity);

        pMyObject->hSlapObjEntity = (ANSC_HANDLE)NULL;
    }

    if ( pSlapObjProxy )
    {
        pSlapObjProxy->Remove((ANSC_HANDLE)pSlapObjProxy);

        pMyObject->hSlapObjProxy = (ANSC_HANDLE)NULL;
    }

    AnscFreeLock (&pMyObject->OboTableLock);
    AnscLcoRemove((ANSC_HANDLE)pMyObject  );

    return  ANSC_STATUS_SUCCESS;
}
ANSC_STATUS
SlapSpoRemove
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PSLAP_SRV_PROXY_OBJECT          pMyObject    = (PSLAP_SRV_PROXY_OBJECT)hThisObject;
    PSLAP_GOA_INTERFACE             pSlapGoaIf   = (PSLAP_GOA_INTERFACE   )pMyObject->hSlapGoaIf;

    pMyObject->Cancel((ANSC_HANDLE)pMyObject);
    pMyObject->Reset ((ANSC_HANDLE)pMyObject);

    switch ( pMyObject->ObjMode )
    {
        case    SLAP_SPO_OBJ_MODE_acquired :

                if ( pMyObject->hSlapGoaObj )
                {
                    returnStatus =
                        pSlapGoaIf->RelObjectAccess
                            (
                                pSlapGoaIf->hOwnerContext,
                                pMyObject->hSlapGoaObj
                            );
                }

                break;

        case    SLAP_SPO_OBJ_MODE_referenced :

                break;

        case    SLAP_SPO_OBJ_MODE_created :

                if ( pMyObject->hSlapGoaObj )
                {
                    returnStatus =
                        pSlapGoaIf->DeleteObject
                            (
                                pSlapGoaIf->hOwnerContext,
                                pMyObject->hSlapGoaObj
                            );
                }

                break;

        default :

                break;
    }

    if ( pMyObject->ObjName )
    {
        AnscFreeMemory(pMyObject->ObjName);

        pMyObject->ObjName = NULL;
    }

    AnscLcoRemove((ANSC_HANDLE)pMyObject);

    return  ANSC_STATUS_SUCCESS;
}