diff --git a/ipc/native/c/adapter/Liteos_m/rpc_os_adapter.c b/ipc/native/c/adapter/Liteos_m/rpc_os_adapter.c index faeb00c79813daf01b14ec76df797a1223e63f79..cb182fce2664d817d9cfc0f15ea2d2f0589bcf62 100644 --- a/ipc/native/c/adapter/Liteos_m/rpc_os_adapter.c +++ b/ipc/native/c/adapter/Liteos_m/rpc_os_adapter.c @@ -15,9 +15,11 @@ #include "rpc_os_adapter.h" +#include + int32_t RpcGetPid(void) { - return 0; + return (int32_t)pthread_self(); } int32_t RpcGetUid(void) diff --git a/ipc/native/c/manager/src/serializer.c b/ipc/native/c/manager/src/serializer.c index c4dcfa4a2c4b3818714e0e349cef916e0cccbac8..6f3ad1d82fca64faacde026f60c4b97ac5526038 100644 --- a/ipc/native/c/manager/src/serializer.c +++ b/ipc/native/c/manager/src/serializer.c @@ -247,9 +247,11 @@ int32_t ReadFileDescriptor(IpcIo *io) #else bool WriteRemoteObject(IpcIo *io, const SvcIdentity *svc) { - (void)io; - (void)svc; - return false; + if (io == NULL || svc == NULL) { + RPC_LOG_ERROR("push io or svc is NULL ..."); + return false; + } + return WriteBuffer(io, svc, sizeof(SvcIdentity)); } bool WriteFileDescriptor(IpcIo *io, uint32_t fd) @@ -261,11 +263,17 @@ bool WriteFileDescriptor(IpcIo *io, uint32_t fd) bool ReadRemoteObject(IpcIo *io, SvcIdentity *svc) { - (void)io; - if (svc == NULL) { + if (io == NULL || svc == NULL) { + return false; + } + SvcIdentity *svcId = ReadBuffer(io, sizeof(SvcIdentity)); + if (svcId == NULL) { return false; } - OnFirstStrongRef(svc->handle); + svc->handle = svcId->handle; + svc->token = svcId->token; + svc->cookie = svcId->cookie; + WaitForProxyInit(svcId->handle); return true; }