diff --git a/services/devicemanagerservice/src/ipc/standard/ipc_cmd_parser.cpp b/services/devicemanagerservice/src/ipc/standard/ipc_cmd_parser.cpp index 6c01ffbf369847647d00985a290b0eddbc5d961a..0c29b78735af8fedfc66c70042e0a5602bdc2f70 100644 --- a/services/devicemanagerservice/src/ipc/standard/ipc_cmd_parser.cpp +++ b/services/devicemanagerservice/src/ipc/standard/ipc_cmd_parser.cpp @@ -140,9 +140,9 @@ ON_IPC_SET_REQUEST(SERVER_AUTH_RESULT, std::shared_ptr pBaseReq, Message if (pBaseReq == nullptr) { return DM_FAILED; } - std::shared_ptr pReq = std::make_shared(); + std::shared_ptr pReq = std::static_pointer_cast(pBaseReq); - std::string pkgName = pBaseReq->GetPkgName(); + std::string pkgName = pReq->GetPkgName(); std::string deviceId = pReq->GetDeviceId(); std::string token = pReq->GetPinToken(); int32_t status = pReq->GetStatus(); @@ -185,9 +185,10 @@ ON_IPC_SET_REQUEST(SERVER_VERIFY_AUTH_RESULT, std::shared_ptr pBaseReq, if (pBaseReq == nullptr) { return DM_FAILED; } - std::shared_ptr pReq = std::make_shared(); + std::shared_ptr pReq = + std::static_pointer_cast(pBaseReq); - std::string pkgName = pBaseReq->GetPkgName(); + std::string pkgName = pReq->GetPkgName(); std::string deviceId = pReq->GetDeviceId(); int32_t result = pReq->GetResult(); int32_t flag = pReq->GetFlag(); @@ -226,9 +227,9 @@ ON_IPC_SET_REQUEST(SERVER_DEVICE_FA_NOTIFY, std::shared_ptr pBaseReq, Me return DM_FAILED; } - std::shared_ptr pReq = std::make_shared(); + std::shared_ptr pReq = std::static_pointer_cast(pBaseReq); - std::string packagname = pBaseReq->GetPkgName(); + std::string packagname = pReq->GetPkgName(); std::string paramJson = pReq->GetJsonParam(); if (!data.WriteString(packagname)) { LOGE("write pkgName failed");