From 1c85d92b4402a10d0f9555777027640547fe8f5d Mon Sep 17 00:00:00 2001 From: spacemeowx2 Date: Sat, 28 Dec 2019 19:45:34 +0800 Subject: [PATCH] fix crash when Initialize is called --- docker-compose.yml | 2 +- ldn_mitm/source/ldn_icommunication.cpp | 9 +++++---- ldn_mitm/source/ldn_icommunication.hpp | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 97e42ad..522a07c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,4 +5,4 @@ services: build: . volumes: - ".:/code" - command: make + command: make -j8 diff --git a/ldn_mitm/source/ldn_icommunication.cpp b/ldn_mitm/source/ldn_icommunication.cpp index 51dd810..de60a2f 100644 --- a/ldn_mitm/source/ldn_icommunication.cpp +++ b/ldn_mitm/source/ldn_icommunication.cpp @@ -7,8 +7,8 @@ namespace ams::mitm::ldn { // https://reswitched.github.io/SwIPC/ifaces.html#nn::ldn::detail::IUserLocalCommunicationService - Result ICommunicationInterface::Initialize(u64 unk, sf::ClientProcessId pid) { - LogFormat("ICommunicationInterface::Initialize unk: %" PRIu64 " pid: %" PRIu64, unk, pid); + Result ICommunicationInterface::Initialize(const sf::ClientProcessId &client_process_id) { + LogFormat("ICommunicationInterface::Initialize pid: %" PRIu64, client_process_id); if (this->state_event == nullptr) { this->state_event = new os::SystemEvent(true); @@ -21,8 +21,9 @@ namespace ams::mitm::ldn { return ResultSuccess(); } - Result ICommunicationInterface::InitializeSystem2(u64 unk, sf::ClientProcessId pid) { - return this->Initialize(unk, pid); + Result ICommunicationInterface::InitializeSystem2(u64 unk, const sf::ClientProcessId &client_process_id) { + LogFormat("ICommunicationInterface::InitializeSystem2 unk: %" PRIu64, unk); + return this->Initialize(client_process_id); } Result ICommunicationInterface::Finalize() { diff --git a/ldn_mitm/source/ldn_icommunication.hpp b/ldn_mitm/source/ldn_icommunication.hpp index e237f8a..46036e0 100644 --- a/ldn_mitm/source/ldn_icommunication.hpp +++ b/ldn_mitm/source/ldn_icommunication.hpp @@ -75,8 +75,8 @@ namespace ams::mitm::ldn { private: void onEventFired(); private: - Result Initialize(u64 unk, sf::ClientProcessId pid); - Result InitializeSystem2(u64 unk, sf::ClientProcessId pid); + Result Initialize(const sf::ClientProcessId &client_process_id); + Result InitializeSystem2(u64 unk, const sf::ClientProcessId &client_process_id); Result Finalize(); Result GetState(sf::Out state); Result GetNetworkInfo(sf::Out buffer);