From cc5b884d7d28a463430dba0020d6e8965e91b1b8 Mon Sep 17 00:00:00 2001 From: Rambo6Glaz <39063367+EpicUsername12@users.noreply.github.com> Date: Sun, 15 Sep 2024 18:13:27 +0200 Subject: [PATCH] Fix NDMU_QueryStatus (#543) --- libctru/include/3ds/services/ndm.h | 7 ++++--- libctru/source/services/ndm.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libctru/include/3ds/services/ndm.h b/libctru/include/3ds/services/ndm.h index eb4c80dfb..30f168549 100644 --- a/libctru/include/3ds/services/ndm.h +++ b/libctru/include/3ds/services/ndm.h @@ -111,10 +111,11 @@ Result NDMU_ResumeScheduler(void); Result NDMU_GetCurrentState(ndmState *state); /** - * @brief Returns the daemon state. - * @param state Pointer to write the daemons state to. + * @brief Returns a daemon state. + * @param daemon The specified daemon. + * @param state Pointer to write the daemon state to. */ -Result NDMU_QueryStatus(ndmDaemonStatus *status); +Result NDMU_QueryStatus(ndmDaemon daemon, ndmDaemonStatus *status); /** * @brief Sets the scan interval. diff --git a/libctru/source/services/ndm.c b/libctru/source/services/ndm.c index 40ae658d5..4d8d5dc93 100644 --- a/libctru/source/services/ndm.c +++ b/libctru/source/services/ndm.c @@ -165,11 +165,12 @@ Result NDMU_GetCurrentState(ndmState *state) return (Result)cmdbuf[1]; } -Result NDMU_QueryStatus(ndmDaemonStatus *status) +Result NDMU_QueryStatus(ndmDaemon daemon, ndmDaemonStatus *status) { u32* cmdbuf=getThreadCommandBuffer(); - cmdbuf[0]=IPC_MakeHeader(0xD,1,0); // 0xD0000 + cmdbuf[0]=IPC_MakeHeader(0xD,1,0); // 0xD0040 + cmdbuf[1]=daemon; Result ret=0; if(R_FAILED(ret=svcSendSyncRequest(ndmuHandle)))return ret;