diff --git a/samgr_endpoint/source/default_client_rpc.c b/samgr_endpoint/source/default_client_rpc.c index e1d72d06e0fb76a6422b3f4214e525837ac97f36..30281f8bb74946fe1e46bc41644da260c7dbed0f 100755 --- a/samgr_endpoint/source/default_client_rpc.c +++ b/samgr_endpoint/source/default_client_rpc.c @@ -182,11 +182,11 @@ static int ProxyInvoke(IClientProxy *proxy, int funcId, IpcIo *request, IOwner o ProxyInvokeArgInner(&requestWrapper, header); if (!IpcIoAppend(&requestWrapper, request)) { HILOG_ERROR(HILOG_MODULE_SAMGR, "ipc io append fail\n"); - FreeBuffer(data); + free(data); return EC_INVALID; } int ret = SendRequest(header->target, funcId, &requestWrapper, &reply, flag, (uintptr_t *)&replyBuf); - FreeBuffer(data); + free(data); if (notify != NULL) { notify(owner, ret, &reply); diff --git a/samgr_endpoint/source/samgr_small_ipc_adapter.c b/samgr_endpoint/source/samgr_small_ipc_adapter.c index 49ce0a636da4a958e2bc2c9b4f36676875c8fd3d..d5b5acefdd1c2b3f8e3826494215ef99a225097a 100644 --- a/samgr_endpoint/source/samgr_small_ipc_adapter.c +++ b/samgr_endpoint/source/samgr_small_ipc_adapter.c @@ -90,7 +90,7 @@ void Listen(Endpoint *endpoint, int token, const char *service, const char *feat endpoint->identity.cookie = objectStubOne; //handle must -1 endpoint->identity.handle = INVALID_INDEX; - endpoint->identity.token = 1; + endpoint->identity.token = SERVICE_TYPE_NORMAL; registerEpArg->endpoint = endpoint; registerEpArg->token = token; @@ -185,7 +185,7 @@ int RegisterIdentity(const SaName *saName, SvcIdentity *saInfo, ret = -ret; int32_t ipcRet = EC_FAILURE; if (ret == EC_SUCCESS) { - ret = ReadInt32(&reply, &ipcRet); + ReadInt32(&reply, &ipcRet); } if (ipcRet == EC_SUCCESS) { SvcIdentity target; @@ -195,7 +195,7 @@ int RegisterIdentity(const SaName *saName, SvcIdentity *saInfo, if (replyBuf != NULL) { FreeBuffer(replyBuf); } - return ret; + return ipcRet; } static int Dispatch(uint32_t code, IpcIo *data, IpcIo *reply, MessageOption option) { @@ -221,17 +221,7 @@ static int Dispatch(uint32_t code, IpcIo *data, IpcIo *reply, MessageOption opti request.msgId = token; request.data = data; request.msgValue = code; -#ifdef LITE_LINUX_BINDER_IPC HandleIpc(&request, &resp); -#else - uint32 *ref = NULL; - int ret = SAMGR_SendSharedDirectRequest(&router->identity, &request, &resp, &ref, HandleIpc); - if (ret != EC_SUCCESS) { - HILOG_ERROR(HILOG_MODULE_SAMGR, "Router[%u] Service<%d, %d> is busy", - token, router->identity.serviceId, router->identity.featureId); - goto ERROR; - } -#endif return EC_SUCCESS; ERROR: return EC_INVALID; diff --git a/samgr_server/source/samgr_server_rpc.c b/samgr_server/source/samgr_server_rpc.c index 75ab2bc837e6c6446b52e7b5b350a8d675134e36..cacde05f8387650ff431145ab276585e9513155b 100755 --- a/samgr_server/source/samgr_server_rpc.c +++ b/samgr_server/source/samgr_server_rpc.c @@ -575,7 +575,7 @@ void ProcGetAllSysCap(SamgrServer *server, IpcIo *req, IpcIo *reply) if (serviceImpl->isRegister == FALSE) { continue; } - WriteBool(reply, serviceImpl->name); + WriteString(reply, serviceImpl->name); cnt++; } MUTEX_Unlock(server->sysCapMtx);