nn::cfg::CTR::GetSimpleAddress Function

Syntax

#include <nn/cfg.h>

nn::Result GetSimpleAddress(
     SimpleAddress * pSimpleAddress,
     SimpleAddressId simpleAddressId,
     uptr pWorkMemory,
     u32 workMemorySize
);

Arguments

Name Description
out pSimpleAddress Stores the obtained simple address information.
in simpleAddressId Specifies the ID of the simple address information to be obtained.
in pWorkMemory Specifies the working memory used internally.
in workMemorySize Specifies the size of the working memory used internally.

Return Values

The following Result values are returned as the execution result.

Value Description
Result::IsSuccess The simple address information has been obtained successfully.
ResultNotFound Could not find simple address information corresponding to the specified ID.
This return value must always be handled.
ResultMountContentFailed Failed to mount content.
Check whether nn::fs::Initialize has been called prior to calling this function.
ResultOutOfMemory Execution failed due to insufficient working memory.
This error never occurs if memory equal to or greater than nn::cfg::CTR::CFG_SIMPLE_ADDRESS_WORKMEMORY_SIZE is allocated.

Description

Gets the simple address information (such as the country and region name) having the specified ID.

Before calling this function, you must initialize the FS library by calling the nn::fs::Initialize function.
Do not call this function simultaneously from multiple threads.

This function uses the memory buffer given by pWorkMemory as working memory. The required memory size is given by nn::cfg::CTR::CFG_SIMPLE_ADDRESS_WORKMEMORY_SIZE. Do not write to or free the specified working memory during execution of this function. Furthermore, be sure the application frees the specified working memory after it is finished being used.

The size of the SimpleAddress structure is at least 4 KB. Be careful not to exhaust the stack, if it is allocated on the stack. The country and region names in the simple address information are guaranteed to be NULL terminated.

Country and region IDs may be added later. If you get detailed information regarding country and region ID received from a peer, you must keep in mind cases where that ID is unknown.
ResultNotFound is returned if you specify an unknown ID to this function. This return value must always be handled.

Revision History

2011/10/11
Added more details specific to simple address information.
2010/05/27
Initial version.

CONFIDENTIAL