From b5a8183dbdd45c6de900937ac9032bc951dfd404 Mon Sep 17 00:00:00 2001 From: Mrrraou Date: Mon, 19 Dec 2016 00:02:43 +0100 Subject: [PATCH] Add svcGetHandleInfo. (#324) --- libctru/include/3ds/svc.h | 10 ++++++++-- libctru/source/svc.s | 8 ++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/libctru/include/3ds/svc.h b/libctru/include/3ds/svc.h index 32a8513..7b2a524 100644 --- a/libctru/include/3ds/svc.h +++ b/libctru/include/3ds/svc.h @@ -897,6 +897,14 @@ Result svcCloseHandle(Handle handle); */ Result svcDuplicateHandle(Handle* out, Handle original); +/** + * @brief Gets a handle info. + * @param[out] out Pointer to output the handle info to. + * @param handle Handle to get the info for. + * @param param Parameter clarifying the handle info type. + */ +Result svcGetHandleInfo(s64* out, Handle handle, u32 param); + /** * @brief Gets the system info. * @param[out] out Pointer to output the system info to. @@ -966,5 +974,3 @@ Result svcContinueDebugEvent(Handle debug, u32 flags); * @param callback Function to execute. */ Result svcBackdoor(s32 (*callback)(void)); - - diff --git a/libctru/source/svc.s b/libctru/source/svc.s index 4edb4d6..5447e5e 100644 --- a/libctru/source/svc.s +++ b/libctru/source/svc.s @@ -233,6 +233,14 @@ SVC_BEGIN svcGetSystemTick svc 0x28 bx lr +SVC_BEGIN svcGetHandleInfo + str r0, [sp, #-0x4]! + svc 0x29 + ldr r3, [sp], #4 + str r1, [r3] + str r2, [r3,#4] + bx lr + SVC_BEGIN svcGetSystemInfo str r0, [sp, #-0x4]! svc 0x2A