From 232c2006f077038796fe13da907112510c0ec7a4 Mon Sep 17 00:00:00 2001 From: Mrrraou Date: Sun, 18 Dec 2016 23:52:49 +0100 Subject: [PATCH] Add svcGetHandleInfo. --- 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 6dfb6fa..5c35f47 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. @@ -969,5 +977,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