Changes

1,405 bytes added ,  21:34, 7 November 2019
Line 846: Line 846:  
| 2009 || [4.0.0+] EstimateRequiredSize
 
| 2009 || [4.0.0+] EstimateRequiredSize
 
|-
 
|-
| 2010 || [4.0.0+] RequestReceiveApplication
+
| 2010 || [4.0.0+] [[#RequestReceiveApplication]]
 
|-
 
|-
 
| 2011 || [4.0.0+] CommitReceiveApplication
 
| 2011 || [4.0.0+] CommitReceiveApplication
Line 1,011: Line 1,011:     
An error is thrown if any bit is set in ApplicationDeliveryAttributeTag besides bit1. The output array-count must be at least 1: only 1 entry will be written to this array (hence on success total_out will also only be 1 on success).
 
An error is thrown if any bit is set in ApplicationDeliveryAttributeTag besides bit1. The output array-count must be at least 1: only 1 entry will be written to this array (hence on success total_out will also only be 1 on success).
 +
 +
==== RequestReceiveApplication ====
 +
Takes a type-0x5 input buffer containing an array of [[NCM_services#ContentMetaKey|ContentMetaKey]], an u8 [[Filesystem_services#StorageId|StorageId]], an u16 port, an u32 Ipv4Address, an u64 <code>nn::ncm::ApplicationId</code>, returns an output Event handle and an [[#IAsyncResult]].
 +
 +
An error is thrown if [[NIM_services|nim]] ListApplicationApplyDeltaTask returns a task.
 +
 +
This loops through the input [[NCM_services#ContentMetaKey|ContentMetaKey]] array, throwing an error if the [[NCM_services#ContentMetaType|ContentMetaType]] doesn't match Patch. The input array is copied into state which is used later by the thread for [[NIM_services|nim]] cmd53, max entries is 0x12.
 +
 +
This does various setup then creates the [[#IAsyncResult]] + the async thread which handles the [[#IAsyncResult]] operation. Then the thread does:
 +
 +
* Calls a func which does:
 +
** Throws an error if a state flag is set.
 +
** Uses [[NIM_services|nim]] cmd53, returning the Result on failure.
 +
** Uses [[NIM_services|nim]] cmd56, returning the Result on failure. Waits for the IAsyncResult operation from this to finish, then uses the Get cmd to get the output Result.
 +
** Handles cleanup and returns.
 +
* On success, this loads various data which is then used for saving a SystemPlayReport when a state flag is set.
 +
** The EventId is "receive_app_contents" with ApplicationId <NS ProgramId>.
    
==== RequestSendApplication ====
 
==== RequestSendApplication ====