From 21fa9ff17c37e1c854acd3629c6c59ada1cb8ea8 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 17 Apr 2018 18:05:19 -0600 Subject: [PATCH] Stratosphere: Fix removed add() in Launch Queue --- stratosphere/loader/source/ldr_launch_queue.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/stratosphere/loader/source/ldr_launch_queue.cpp b/stratosphere/loader/source/ldr_launch_queue.cpp index d3e038a54..a747edd5d 100644 --- a/stratosphere/loader/source/ldr_launch_queue.cpp +++ b/stratosphere/loader/source/ldr_launch_queue.cpp @@ -4,7 +4,20 @@ namespace LaunchQueue { static LaunchItem g_launch_queue[LAUNCH_QUEUE_SIZE]; + + Result add(LaunchItem *item) { + if(item->arg_size > LAUNCH_QUEUE_ARG_SIZE_MAX) { + return 0x209; + } + int idx = get_free_index(item->tid); + if(idx == LAUNCH_QUEUE_FULL) + return 0x409; + + g_launch_queue[idx] = *item; + return 0x0; + } + int get_index(u64 tid) { for(unsigned int i = 0; i < LAUNCH_QUEUE_SIZE; i++) { if(g_launch_queue[i].tid == tid) {