未验证 提交 2c2f947f 编写于 作者: O openharmony_ci 提交者: Gitee

!715 ipc 代码规范修改

Merge pull request !715 from dengyutao/master
...@@ -140,13 +140,15 @@ bool BinderInvoker::TranslateDBinderProxy(int handle, MessageParcel &parcel) ...@@ -140,13 +140,15 @@ bool BinderInvoker::TranslateDBinderProxy(int handle, MessageParcel &parcel)
#else #else
if (flat->hdr.type == BINDER_TYPE_HANDLE && flat->cookie == IRemoteObject::IF_PROT_DATABUS if (flat->hdr.type == BINDER_TYPE_HANDLE && flat->cookie == IRemoteObject::IF_PROT_DATABUS
&& flat->handle < IPCProcessSkeleton::DBINDER_HANDLE_BASE) { && flat->handle < IPCProcessSkeleton::DBINDER_HANDLE_BASE) {
MessageParcel data, reply; MessageParcel data;
MessageParcel reply;
MessageOption option; MessageOption option;
if (SendRequest(handle, GET_PID_UID, data, reply, option) != ERR_NONE) { if (SendRequest(handle, GET_PID_UID, data, reply, option) != ERR_NONE) {
ZLOGE(LABEL, "get pid and uid failed"); ZLOGE(LABEL, "get pid and uid failed");
return false; return false;
} }
MessageParcel data2, reply2; MessageParcel data2;
MessageParcel reply2;
MessageOption option2; MessageOption option2;
data2.WriteUint32(reply.ReadUint32()); // pid data2.WriteUint32(reply.ReadUint32()); // pid
data2.WriteUint32(reply.ReadUint32()); // uid data2.WriteUint32(reply.ReadUint32()); // uid
...@@ -822,7 +824,8 @@ void BinderInvoker::StopWorkThread() ...@@ -822,7 +824,8 @@ void BinderInvoker::StopWorkThread()
bool BinderInvoker::PingService(int32_t handle) bool BinderInvoker::PingService(int32_t handle)
{ {
MessageParcel data, reply; MessageParcel data;
MessageParcel reply;
MessageOption option; MessageOption option;
int result = SendRequest(handle, PING_TRANSACTION, data, reply, option); int result = SendRequest(handle, PING_TRANSACTION, data, reply, option);
return (result == ERR_NONE); return (result == ERR_NONE);
......
...@@ -89,7 +89,8 @@ std::shared_ptr<DBinderSessionObject> DBinderDatabusInvoker::NewSessionOfBinderP ...@@ -89,7 +89,8 @@ std::shared_ptr<DBinderSessionObject> DBinderDatabusInvoker::NewSessionOfBinderP
return nullptr; return nullptr;
} }
MessageParcel data, reply; MessageParcel data;
MessageParcel reply;
if (!data.WriteUint32(IRemoteObject::DATABUS_TYPE) || !data.WriteString(current->GetLocalDeviceID()) || if (!data.WriteUint32(IRemoteObject::DATABUS_TYPE) || !data.WriteString(current->GetLocalDeviceID()) ||
!data.WriteUint32(session->GetPeerPid()) || !data.WriteUint32(session->GetPeerUid()) || !data.WriteUint32(session->GetPeerPid()) || !data.WriteUint32(session->GetPeerUid()) ||
!data.WriteString(session->GetPeerDeviceId()) || !data.WriteString(sessionName) || !data.WriteString(session->GetPeerDeviceId()) || !data.WriteString(sessionName) ||
...@@ -136,7 +137,8 @@ bool DBinderDatabusInvoker::AuthSession2Proxy(uint32_t handle, ...@@ -136,7 +137,8 @@ bool DBinderDatabusInvoker::AuthSession2Proxy(uint32_t handle,
return false; return false;
} }
MessageParcel data, reply; MessageParcel data;
MessageParcel reply;
MessageOption option; MessageOption option;
if (!data.WriteUint32(session->GetPeerPid()) || !data.WriteUint32(session->GetPeerUid()) || if (!data.WriteUint32(session->GetPeerPid()) || !data.WriteUint32(session->GetPeerUid()) ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册