]> Chaos Git - corbenik/ctrulib.git/commitdiff
Added APT_GetAppletProgramInfo.
authoryellows8 <yellows8@users.noreply.github.com>
Thu, 24 Sep 2015 08:26:48 +0000 (04:26 -0400)
committeryellows8 <yellows8@users.noreply.github.com>
Thu, 24 Sep 2015 08:26:48 +0000 (04:26 -0400)
libctru/include/3ds/services/apt.h
libctru/source/services/apt.c

index 33de846822b6bc10540ba7f0f6af52ec77238480..133abcb07f96f8355ed6a17ce484f6a80d17cff1 100644 (file)
@@ -97,6 +97,7 @@ Result APT_Finalize(Handle* handle, NS_APPID appId);
 Result APT_HardwareResetAsync(Handle* handle);
 Result APT_Enable(Handle* handle, u32 a);
 Result APT_GetAppletManInfo(Handle* handle, u8 inval, u8 *outval8, u32 *outval32, NS_APPID *menu_appid, NS_APPID *active_appid);
+Result APT_GetAppletProgramInfo(Handle* handle, u32 id, u32 flags, u16 *titleversion);
 Result APT_PrepareToJumpToHomeMenu(Handle* handle);
 Result APT_JumpToHomeMenu(Handle* handle, u32 a, u32 b, u32 c);
 Result APT_PrepareToJumpToApplication(Handle* handle, u32 a);
index 41a52284d5518037ca1bd4665e8b41f1c7bf2721..644f181b7f4a9f8d3b8ed5f79fad09c7bf8c5d70 100644 (file)
@@ -798,6 +798,22 @@ Result APT_GetAppletManInfo(Handle* handle, u8 inval, u8 *outval8, u32 *outval32
        return cmdbuf[1];
 }
 
+Result APT_GetAppletProgramInfo(Handle* handle, u32 id, u32 flags, u16 *titleversion)
+{
+       if(!handle)handle=&aptuHandle;
+       u32* cmdbuf=getThreadCommandBuffer();
+       cmdbuf[0]=0x004D0080; //request header code
+       cmdbuf[1]=id;
+       cmdbuf[2]=flags;
+
+       Result ret=0;
+       if((ret=svcSendSyncRequest(*handle)))return ret;
+
+       if(titleversion)*titleversion=cmdbuf[2];
+
+       return cmdbuf[1];
+}
+
 Result APT_IsRegistered(Handle* handle, NS_APPID appID, u8* out)
 {
        if(!handle)handle=&aptuHandle;