Skip to main content

XPersistentLocalStorageGetPathSize

Returns the length, in characters, of the path to the persistent local storage (PLS).

Syntax

Parameters

pathSize   _Out_
Type: size_t*
The length, in characters, of the PLS path.

Return value

Type: HRESULT Returns S_OK if successful; otherwise, returns an error code. For a list of error codes, see Error Codes.

Remarks

This function isn’t safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.
The return value of this function is used for the pathSize parameter of the XPersistentLocalStorageGetPath function to return the game-specific PLS path on the device. For more information about PLS, see Local Storage. When calling the XPersistentLocalStorageGetPath function, allocate at least as many characters for the path parameter of XPersistentLocalStorageGetPath as the number specified in the value returned in the pathSize parameter of this function; failure to do so will cause an error. The following example illustrates how to use the XPersistentLocalStorageGetPathSize and XPersistentLocalStorageGetPath functions to get the PLS path for your game.

Requirements

Header: XPersistentLocalStorage.h Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

Conceptual documentation

See also

XPersistentLocalStorageGetPath
XPersistentLocalStorage
How to use the new MicrosoftGame.config file
Last modified on August 20, 2026