ANSC_STATUS
AnscLpccoImcCancel
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus = ANSC_STATUS_SUCCESS;
    PANSC_LPC_CONNECTOR_OBJECT      pMyObject    = (PANSC_LPC_CONNECTOR_OBJECT)hThisObject;

    returnStatus = pMyObject->Cancel((ANSC_HANDLE)pMyObject);

    return  returnStatus;
}
ANSC_STATUS
AnscLpccoRemove
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus  = ANSC_STATUS_SUCCESS;
    PANSC_LPC_CONNECTOR_OBJECT      pMyObject     = (PANSC_LPC_CONNECTOR_OBJECT   )hThisObject;
    PANSC_IMC_INTERFACE             pAnscImcIf    = (PANSC_IMC_INTERFACE          )pMyObject->hAnscImcIf;
    PANSC_CPC_INTERFACE             pAnscCpcIf    = (PANSC_CPC_INTERFACE          )pMyObject->hAnscCpcIf;
    PANSC_TIMER_DESCRIPTOR_OBJECT   pConnTimerObj = (PANSC_TIMER_DESCRIPTOR_OBJECT)pMyObject->hConnTimerObj;
    PANSC_TDO_CLIENT_OBJECT         pConnTimerIf  = (PANSC_TDO_CLIENT_OBJECT      )pMyObject->hConnTimerIf;

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

    if ( pAnscImcIf )
    {
        AnscFreeMemory(pAnscImcIf);

        pMyObject->hAnscImcIf = (ANSC_HANDLE)NULL;
    }

    if ( pAnscCpcIf )
    {
        AnscFreeMemory(pAnscCpcIf);

        pMyObject->hAnscCpcIf = (ANSC_HANDLE)NULL;
    }

    if ( pConnTimerObj )
    {
        pConnTimerObj->Remove((ANSC_HANDLE)pConnTimerObj);
    }

    if ( pConnTimerIf )
    {
        AnscFreeMemory(pConnTimerIf);
    }

    AnscFreeLock(&pMyObject->AccessLock    );
    AnscFreeLock(&pMyObject->PartyTableLock);
    AnscFreeLock(&pMyObject->PcallQueueLock);
    AnscCoRemove((ANSC_HANDLE)pMyObject    );

    return  ANSC_STATUS_SUCCESS;
}
ANSC_STATUS
SlapAmoCancel
    (
        ANSC_HANDLE                 hThisObject
    )
{
    ANSC_STATUS                     returnStatus       = ANSC_STATUS_SUCCESS;
    PSLAP_ACCESS_MANAGER_OBJECT     pMyObject          = (PSLAP_ACCESS_MANAGER_OBJECT  )hThisObject;
    PSLAP_ACCESS_MANAGER_PROPERTY   pProperty          = (PSLAP_ACCESS_MANAGER_PROPERTY)&pMyObject->Property;
    PSLAP_GOA_INTERFACE             pSlapGoaIf         = (PSLAP_GOA_INTERFACE          )pMyObject->hSlapGoaIf;
    PSLAP_ENV_CONTROLLER_OBJECT     pSlapEnvController = (PSLAP_ENV_CONTROLLER_OBJECT  )pMyObject->hSlapEnvController;
    PSLAP_LOAM_CLIENT_OBJECT        pSlapLoamClient    = (PSLAP_LOAM_CLIENT_OBJECT     )pMyObject->hSlapLoamClient;
    PSLAP_LOAM_SERVER_OBJECT        pSlapLoamServer    = (PSLAP_LOAM_SERVER_OBJECT     )pMyObject->hSlapLoamServer;
    PANSC_LPC_CONNECTOR_OBJECT      pAnscLpcConnector  = (PANSC_LPC_CONNECTOR_OBJECT   )pMyObject->hAnscLpcConnector;

    if ( !pMyObject->bActive )
    {
        return  ANSC_STATUS_SUCCESS;
    }
    else
    {
        pMyObject->bActive = FALSE;
    }


    #ifdef  _ANSC_SLAP_LPC_

    if ( pSlapLoamClient )
    {
        pSlapLoamClient->Cancel((ANSC_HANDLE)pSlapLoamClient);
        pSlapLoamClient->Remove((ANSC_HANDLE)pSlapLoamClient);

        pMyObject->hSlapLoamClient = (ANSC_HANDLE)NULL;
    }

    if ( pSlapLoamServer )
    {
        pSlapLoamServer->Cancel((ANSC_HANDLE)pSlapLoamServer);
        pSlapLoamServer->Remove((ANSC_HANDLE)pSlapLoamServer);

        pMyObject->hSlapLoamServer = (ANSC_HANDLE)NULL;
    }

    if ( pAnscLpcConnector )
    {
        pAnscLpcConnector->Cancel((ANSC_HANDLE)pAnscLpcConnector);
        pAnscLpcConnector->Remove((ANSC_HANDLE)pAnscLpcConnector);

        pMyObject->hAnscLpcConnector = (ANSC_HANDLE)NULL;
    }

    #endif

    if ( pSlapEnvController )
    {
        pSlapEnvController->Cancel((ANSC_HANDLE)pSlapEnvController);
    }


    return  ANSC_STATUS_SUCCESS;
}