From a14e3981579c968c5e554f8ca013bbc572ea0cd5 Mon Sep 17 00:00:00 2001 From: PTRCoder Date: Fri, 23 Aug 2024 13:50:17 +0200 Subject: [PATCH] Added correct transition from INF to UDS --- src/core/hle/service/nwm/nwm_inf.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/core/hle/service/nwm/nwm_inf.cpp b/src/core/hle/service/nwm/nwm_inf.cpp index 69ffd7d64..32ae85162 100644 --- a/src/core/hle/service/nwm/nwm_inf.cpp +++ b/src/core/hle/service/nwm/nwm_inf.cpp @@ -13,8 +13,25 @@ namespace Service::NWM { void NWM_INF::RecvBeaconBroadcastData(Kernel::HLERequestContext& ctx) { // TODO(PTR) Update implementation to cover differences between NWM_INF and NWM_UDS + + // adding in extra context value for transition from INF to UDS + u32* ctx_data = ctx.CommandBuffer(); + std::array cmd_buf; + int i; + for (i = 0; i < 15; i++) { + cmd_buf[i] = ctx_data[i]; + } + cmd_buf[15] = 0; // dummy wlan_comm_id + cmd_buf[16] = 0; // dummy id + for (i = 17; i <= 20; i++) { + cmd_buf[i] = ctx_data[i - 1]; + } + auto context = + std::make_shared(kernel, SharedFrom(this), thread); + context->PopulateFromIncomingCommandBuffer(cmd_buf.data(), current_process); + auto nwm_uds = Core::System::GetInstance().ServiceManager().GetService("nwm::UDS"); - nwm_uds->HandleSyncRequest(ctx); + nwm_uds->HandleSyncRequest(context); } NWM_INF::NWM_INF() : ServiceFramework("nwm::INF") {