diff options
| author | 2020-02-05 22:10:28 -0500 | |
|---|---|---|
| committer | 2020-02-05 22:52:35 -0500 | |
| commit | 2245c24e2153a54c2a5e1b802a685087129a1f54 (patch) | |
| tree | da6b142afa0dd0fc62e94a22344d4b97d7209b64 /src | |
| parent | hle_ipc: Add error checking to read/write buffer access. (diff) | |
| download | yuzu-2245c24e2153a54c2a5e1b802a685087129a1f54.tar.gz yuzu-2245c24e2153a54c2a5e1b802a685087129a1f54.tar.xz yuzu-2245c24e2153a54c2a5e1b802a685087129a1f54.zip | |
services: prepo: Fix IPC interface with SaveReport/SaveReportWithUser.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/prepo/prepo.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp index 5eb26caf8..8f1be0e48 100644 --- a/src/core/hle/service/prepo/prepo.cpp +++ b/src/core/hle/service/prepo/prepo.cpp | |||
| @@ -50,16 +50,16 @@ private: | |||
| 50 | IPC::RequestParser rp{ctx}; | 50 | IPC::RequestParser rp{ctx}; |
| 51 | const auto process_id = rp.PopRaw<u64>(); | 51 | const auto process_id = rp.PopRaw<u64>(); |
| 52 | 52 | ||
| 53 | const auto data1 = ctx.ReadBuffer(0); | 53 | std::vector<std::vector<u8>> data{ctx.ReadBuffer(0)}; |
| 54 | const auto data2 = ctx.ReadBuffer(1); | 54 | if (Type == Core::Reporter::PlayReportType::New) { |
| 55 | data.emplace_back(ctx.ReadBuffer(1)); | ||
| 56 | } | ||
| 55 | 57 | ||
| 56 | LOG_DEBUG(Service_PREPO, | 58 | LOG_DEBUG(Service_PREPO, "called, type={:02X}, process_id={:016X}, data1_size={:016X}", |
| 57 | "called, type={:02X}, process_id={:016X}, data1_size={:016X}, data2_size={:016X}", | 59 | static_cast<u8>(Type), process_id, data[0].size()); |
| 58 | static_cast<u8>(Type), process_id, data1.size(), data2.size()); | ||
| 59 | 60 | ||
| 60 | const auto& reporter{system.GetReporter()}; | 61 | const auto& reporter{system.GetReporter()}; |
| 61 | reporter.SavePlayReport(Type, system.CurrentProcess()->GetTitleID(), {data1, data2}, | 62 | reporter.SavePlayReport(Type, system.CurrentProcess()->GetTitleID(), data, process_id); |
| 62 | process_id); | ||
| 63 | 63 | ||
| 64 | IPC::ResponseBuilder rb{ctx, 2}; | 64 | IPC::ResponseBuilder rb{ctx, 2}; |
| 65 | rb.Push(RESULT_SUCCESS); | 65 | rb.Push(RESULT_SUCCESS); |
| @@ -70,19 +70,19 @@ private: | |||
| 70 | IPC::RequestParser rp{ctx}; | 70 | IPC::RequestParser rp{ctx}; |
| 71 | const auto user_id = rp.PopRaw<u128>(); | 71 | const auto user_id = rp.PopRaw<u128>(); |
| 72 | const auto process_id = rp.PopRaw<u64>(); | 72 | const auto process_id = rp.PopRaw<u64>(); |
| 73 | 73 | std::vector<std::vector<u8>> data{ctx.ReadBuffer(0)}; | |
| 74 | const auto data1 = ctx.ReadBuffer(0); | 74 | if (Type == Core::Reporter::PlayReportType::New) { |
| 75 | const auto data2 = ctx.ReadBuffer(1); | 75 | data.emplace_back(ctx.ReadBuffer(1)); |
| 76 | } | ||
| 76 | 77 | ||
| 77 | LOG_DEBUG( | 78 | LOG_DEBUG( |
| 78 | Service_PREPO, | 79 | Service_PREPO, |
| 79 | "called, type={:02X}, user_id={:016X}{:016X}, process_id={:016X}, data1_size={:016X}, " | 80 | "called, type={:02X}, user_id={:016X}{:016X}, process_id={:016X}, data1_size={:016X}", |
| 80 | "data2_size={:016X}", | 81 | static_cast<u8>(Type), user_id[1], user_id[0], process_id, data[0].size()); |
| 81 | static_cast<u8>(Type), user_id[1], user_id[0], process_id, data1.size(), data2.size()); | ||
| 82 | 82 | ||
| 83 | const auto& reporter{system.GetReporter()}; | 83 | const auto& reporter{system.GetReporter()}; |
| 84 | reporter.SavePlayReport(Type, system.CurrentProcess()->GetTitleID(), {data1, data2}, | 84 | reporter.SavePlayReport(Type, system.CurrentProcess()->GetTitleID(), data, process_id, |
| 85 | process_id, user_id); | 85 | user_id); |
| 86 | 86 | ||
| 87 | IPC::ResponseBuilder rb{ctx, 2}; | 87 | IPC::ResponseBuilder rb{ctx, 2}; |
| 88 | rb.Push(RESULT_SUCCESS); | 88 | rb.Push(RESULT_SUCCESS); |