From f9dae990066cb0fa3730a811353781e9e7bffa19 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 23 Jan 2018 19:43:59 -0500 Subject: service: Fix all incorrect IPC response headers. --- src/core/hle/service/acc/acc_u0.cpp | 4 ++-- src/core/hle/service/am/applet_oe.cpp | 22 +++++++++--------- src/core/hle/service/apm/apm.cpp | 2 +- src/core/hle/service/audio/audout_u.cpp | 2 +- src/core/hle/service/filesystem/fsp_srv.cpp | 4 ++-- src/core/hle/service/hid/hid.cpp | 13 ++--------- src/core/hle/service/lm/lm.cpp | 18 ++++----------- src/core/hle/service/pctl/pctl_a.cpp | 2 +- src/core/hle/service/service.cpp | 2 +- src/core/hle/service/sm/controller.cpp | 3 +-- src/core/hle/service/sm/sm.cpp | 6 ++--- src/core/hle/service/time/time.cpp | 35 ++++++----------------------- src/core/hle/service/vi/vi.cpp | 8 +++---- src/core/hle/service/vi/vi_m.cpp | 3 ++- 14 files changed, 42 insertions(+), 82 deletions(-) (limited to 'src/core') diff --git a/src/core/hle/service/acc/acc_u0.cpp b/src/core/hle/service/acc/acc_u0.cpp index 7f0192fd3..5b0c3bcb5 100644 --- a/src/core/hle/service/acc/acc_u0.cpp +++ b/src/core/hle/service/acc/acc_u0.cpp @@ -54,7 +54,7 @@ void ACC_U0::GetUserExistence(Kernel::HLERequestContext& ctx) { } void ACC_U0::GetProfile(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); @@ -67,7 +67,7 @@ void ACC_U0::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { } void ACC_U0::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp index 7d16b45f3..3e15e4970 100644 --- a/src/core/hle/service/am/applet_oe.cpp +++ b/src/core/hle/service/am/applet_oe.cpp @@ -291,7 +291,7 @@ private: std::vector buffer; void Open(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(buffer); @@ -328,7 +328,7 @@ private: std::vector buffer(data, data + sizeof(data)); - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(buffer); @@ -402,56 +402,56 @@ public: private: void GetAudioController(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); } void GetDisplayController(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); } void GetDebugFunctions(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); } void GetWindowController(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); } void GetSelfController(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(nvflinger); LOG_DEBUG(Service, "called"); } void GetCommonStateGetter(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); } void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); } void GetApplicationFunctions(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); @@ -461,7 +461,7 @@ private: }; void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(nvflinger); LOG_DEBUG(Service, "called"); diff --git a/src/core/hle/service/apm/apm.cpp b/src/core/hle/service/apm/apm.cpp index bf7e12288..a005db8a4 100644 --- a/src/core/hle/service/apm/apm.cpp +++ b/src/core/hle/service/apm/apm.cpp @@ -58,7 +58,7 @@ APM::APM() : ServiceFramework("apm") { } void APM::OpenSession(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); } diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index df04d636e..265c8e03c 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp @@ -166,7 +166,7 @@ void AudOutU::ListAudioOuts(Kernel::HLERequestContext& ctx) { Memory::WriteBlock(buffer.Address(), &audio_interface[0], audio_interface.size()); - IPC::RequestBuilder rb = rp.MakeBuilder(3, 0, 0, 0); + IPC::RequestBuilder rb = rp.MakeBuilder(3, 0, 0); rb.Push(RESULT_SUCCESS); // TODO(st4rk): we're currently returning only one audio interface diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index ef1915e5a..c6b20199b 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp @@ -98,7 +98,7 @@ void FSP_SRV::Initalize(Kernel::HLERequestContext& ctx) { void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_FS, "(STUBBED) called"); - IPC::RequestBuilder rb{ctx, 4}; + IPC::RequestBuilder rb{ctx, 3}; rb.Push(RESULT_SUCCESS); rb.Push(5); } @@ -124,7 +124,7 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { return; } - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(std::move(storage.Unwrap())); } diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index ae60cc7b4..4949fa1c9 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -169,19 +169,10 @@ private: applet_resource = std::make_shared(); } - // TODO(Subv): Verify if this should return the interface as a domain object when called - // from within a domain. - - auto sessions = Kernel::ServerSession::CreateSessionPair(applet_resource->GetServiceName()); - auto server = std::get>(sessions); - auto client = std::get>(sessions); - applet_resource->ClientConnected(server); - - LOG_DEBUG(Service, "called, initialized IAppletResource -> session=%u", - client->GetObjectId()); IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushMoveObjects(std::move(client)); + rb.PushIpcInterface(applet_resource); + LOG_DEBUG(Service, "called"); } }; diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp index b505cdcaf..d5dcc8eaf 100644 --- a/src/core/hle/service/lm/lm.cpp +++ b/src/core/hle/service/lm/lm.cpp @@ -65,7 +65,7 @@ private: */ void Log(Kernel::HLERequestContext& ctx) { // This function only succeeds - Get that out of the way - IPC::RequestBuilder rb{ctx, 1}; + IPC::RequestBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); // Read MessageHeader, despite not doing anything with it right now @@ -130,7 +130,7 @@ private: } output += message; - LOG_DEBUG(Debug_Emulated, "%s", output.c_str()); + LOG_INFO(Debug_Emulated, "%s", output.c_str()); } }; @@ -146,21 +146,11 @@ void InstallInterfaces(SM::ServiceManager& service_manager) { * 0: ResultCode */ void LM::Initialize(Kernel::HLERequestContext& ctx) { - // TODO(Subv): Verify if this should return the interface as a domain object when called from - // within a domain. - - auto logger = std::make_shared(); - auto sessions = Kernel::ServerSession::CreateSessionPair(logger->GetServiceName()); - auto server = std::get>(sessions); - auto client = std::get>(sessions); - logger->ClientConnected(server); - - LOG_DEBUG(Service_SM, "called, initialized logger -> session=%u", client->GetObjectId()); IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushMoveObjects(std::move(client)); + rb.PushIpcInterface(); - LOG_INFO(Service_SM, "called"); + LOG_DEBUG(Service, "called"); } LM::LM() : ServiceFramework("lm") { diff --git a/src/core/hle/service/pctl/pctl_a.cpp b/src/core/hle/service/pctl/pctl_a.cpp index 7978aecb8..61e2e19bd 100644 --- a/src/core/hle/service/pctl/pctl_a.cpp +++ b/src/core/hle/service/pctl/pctl_a.cpp @@ -15,7 +15,7 @@ public: }; void PCTL_A::GetService(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 1b8565351..5fd2f1181 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -132,7 +132,7 @@ void ServiceFrameworkBase::InvokeRequest(Kernel::HLERequestContext& ctx) { ResultCode ServiceFrameworkBase::HandleSyncRequest(Kernel::HLERequestContext& context) { switch (context.GetCommandType()) { case IPC::CommandType::Close: { - IPC::RequestBuilder rb{context, 1}; + IPC::RequestBuilder rb{context, 2}; rb.Push(RESULT_SUCCESS); return ResultCode(ErrorModule::HIPC, ErrorDescription::RemoteProcessDead); } diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index 3eead315a..1c1da9bbc 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp @@ -21,9 +21,8 @@ void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) { } void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1, true}; rb.Push(RESULT_SUCCESS); - // TODO(Subv): Check if this is correct rb.PushMoveObjects(ctx.Session()); LOG_DEBUG(Service, "called"); diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index c4078f02f..34ed93a80 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -83,7 +83,7 @@ std::shared_ptr g_service_manager; * 0: ResultCode */ void SM::Initialize(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 1}; + IPC::RequestBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); LOG_DEBUG(Service_SM, "called"); } @@ -99,7 +99,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) { auto client_port = service_manager->GetServicePort(name); if (client_port.Failed()) { - IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 0, 0); + IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 0); rb.Push(client_port.Code()); LOG_ERROR(Service_SM, "called service=%s -> error 0x%08X", name.c_str(), client_port.Code().raw); @@ -112,7 +112,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) { if (session.Succeeded()) { LOG_DEBUG(Service_SM, "called service=%s -> session=%u", name.c_str(), (*session)->GetObjectId()); - IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 1, 0); + IPC::RequestBuilder rb = rp.MakeBuilder(2, 0, 1, true); rb.Push(session.Code()); rb.PushMoveObjects(std::move(session).Unwrap()); } diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index 448ef8544..9816a33d0 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp @@ -83,49 +83,28 @@ private: }; void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) { - // TODO(Subv): Verify if this should return the interface as a domain object when called from - // within a domain. - auto system_clock = std::make_shared(); - auto sessions = Kernel::ServerSession::CreateSessionPair(system_clock->GetServiceName()); - auto server = std::get>(sessions); - auto client = std::get>(sessions); - system_clock->ClientConnected(server); - LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u", client->GetObjectId()); IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushMoveObjects(std::move(client)); + rb.PushIpcInterface(); + LOG_DEBUG(Service, "called"); } void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) { - // TODO(Subv): Verify if this should return the interface as a domain object when called from - // within a domain. - auto system_clock = std::make_shared(); - auto sessions = Kernel::ServerSession::CreateSessionPair(system_clock->GetServiceName()); - auto server = std::get>(sessions); - auto client = std::get>(sessions); - system_clock->ClientConnected(server); - LOG_DEBUG(Service, "called, initialized ISystemClock -> session=%u", client->GetObjectId()); IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushMoveObjects(std::move(client)); + rb.PushIpcInterface(); + LOG_DEBUG(Service, "called"); } void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) { - // TODO(Subv): Verify if this should return the interface as a domain object when called from - // within a domain. - auto steady_clock = std::make_shared(); - auto sessions = Kernel::ServerSession::CreateSessionPair(steady_clock->GetServiceName()); - auto server = std::get>(sessions); - auto client = std::get>(sessions); - steady_clock->ClientConnected(server); - LOG_DEBUG(Service, "called, initialized ISteadyClock -> session=%u", client->GetObjectId()); IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushMoveObjects(std::move(client)); + rb.PushIpcInterface(); + LOG_DEBUG(Service, "called"); } void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) { - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); LOG_DEBUG(Service, "called"); diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 6576f81db..3fcfa1013 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp @@ -597,7 +597,7 @@ private: void IApplicationDisplayService::GetRelayService(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service, "(STUBBED) called"); - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(nv_flinger); } @@ -605,7 +605,7 @@ void IApplicationDisplayService::GetRelayService(Kernel::HLERequestContext& ctx) void IApplicationDisplayService::GetSystemDisplayService(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service, "(STUBBED) called"); - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(); } @@ -613,7 +613,7 @@ void IApplicationDisplayService::GetSystemDisplayService(Kernel::HLERequestConte void IApplicationDisplayService::GetManagerDisplayService(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service, "(STUBBED) called"); - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(nv_flinger); } @@ -622,7 +622,7 @@ void IApplicationDisplayService::GetIndirectDisplayTransactionService( Kernel::HLERequestContext& ctx) { LOG_WARNING(Service, "(STUBBED) called"); - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(nv_flinger); } diff --git a/src/core/hle/service/vi/vi_m.cpp b/src/core/hle/service/vi/vi_m.cpp index 20b24658e..cba7cde1c 100644 --- a/src/core/hle/service/vi/vi_m.cpp +++ b/src/core/hle/service/vi/vi_m.cpp @@ -13,7 +13,8 @@ namespace VI { void VI_M::GetDisplayService(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service, "(STUBBED) called"); - IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; + IPC::RequestBuilder rb{ctx, 2, 0, 1}; + rb.Push(RESULT_SUCCESS); rb.PushIpcInterface(nv_flinger); } -- cgit v1.2.3