daily pastebin goal
76%
SHARE
TWEET

ncmContentMetaDatabaseList

rajkosto Jul 18th, 2018 (edited) 186 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Result ncmContentMetaDatabaseList(NcmContentMetaDatabase* db, u32 titleType, u64 titleIdExact, u64 titleIdLow, u64 titleIdHigh,
  2.                          NcmMetaRecord* metaRecordsOut, size_t metaRecordsBufSize, u32* numEntriesWritten, u32* numEntriesTotal)
  3. {
  4.     IpcCommand c;
  5.     ipcInitialize(&c);    
  6.     ipcAddRecvBuffer(&c, metaRecordsOut, metaRecordsBufSize, BufferType_Normal);
  7.    
  8.     struct {
  9.         u64 magic;
  10.         u64 cmd_id;
  11.         u32 titleType;
  12.         u64 TID;
  13.         u64 TID_LOW;
  14.         u64 TID_HIGH;
  15.     } *raw;
  16.    
  17.     raw = ipcPrepareHeader(&c, sizeof(*raw));
  18.    
  19.     raw->magic = SFCI_MAGIC;
  20.     raw->cmd_id = 5;
  21.     raw->titleType = titleType;
  22.     raw->TID = titleIdExact;
  23.     raw->TID_LOW = titleIdLow;
  24.     raw->TID_HIGH = titleIdHigh;
  25.    
  26.     Result rc = serviceIpcDispatch(&db->s);
  27.     if (R_SUCCEEDED(rc))
  28.     {
  29.         IpcParsedCommand r;
  30.         ipcParse(&r);
  31.  
  32.         struct {
  33.             u64 magic;
  34.             u64 result;
  35.             u32 numEntriesTotal;
  36.             u32 numEntriesWritten;
  37.         } *resp = r.Raw;
  38.  
  39.         rc = resp->result;
  40.  
  41.         if (R_SUCCEEDED(rc))
  42.         {
  43.             if (numEntriesTotal != NULL)
  44.                 *numEntriesTotal = resp->numEntriesTotal;
  45.             if (numEntriesWritten != NULL)
  46.                 *numEntriesWritten = resp->numEntriesWritten;
  47.         }
  48.     }
  49.    
  50.     return rc;
  51. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top