> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XPersistentLocalStoragePromptUserForSpaceAsync

> XPersistentLocalStoragePromptUserForSpaceAsync

# XPersistentLocalStoragePromptUserForSpaceAsync

允許遊戲提示使用者釋放所要求之可成長永續性本機儲存體的總位元組數。

## 語法

```cpp theme={null}
HRESULT XPersistentLocalStoragePromptUserForSpaceAsync(  
         uint64_t requestedBytes,  
         XAsyncBlock* asyncBlock  
)  
```

### 參數

*requestedBytes*   \_In\_\
類型：uint64\_t

遊戲希望可供使用的總空間量。

*asyncBlock*   \_Inout\_\
類型：XAsyncBlock\*

用於監視非同步呼叫狀態的 XAsyncBlock。

### 傳回值

類型：[HRESULT](https://learn.microsoft.com/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)

如果成功，則傳回 **S\_OK**；否則傳回錯誤碼。如需錯誤碼的清單，請參閱[錯誤碼](/zh-TW/reference/errorcodes)。

## 備註

在呼叫之前，遊戲應使用 [XPersistentLocalStorageGetSpaceInfo](/zh-TW/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragegetspaceinfo) 檢查可用空間。

應在回呼函式內呼叫 [XPersistentLocalStoragePromptUserForSpaceResult](/zh-TW/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragepromptuserforspaceresult) 來檢查要求的結果。這並不保證使用者已釋放所要求的位元組數，只表示使用者已採取動作。當使用者重試導致空間要求的作業時，您的遊戲應再次使用 [XPersistentLocalStorageGetSpaceInfo](/zh-TW/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragegetspaceinfo) 查詢可用空間。如果使用者選擇不釋放空間，非同步作業的結果會是 E\_ABORT。

PC 平台上未實作永續性本機儲存體。雖然此方法存在，但不應在 PC 上使用。

此功能在資料中心串流伺服器上已停用。在資料中心串流伺服器上呼叫時，一律會傳回 E\_ABORT。

## 需求

**標頭：** XPersistentLocalStorage.h

**程式庫：** xgameruntime.lib

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

## 概念文件

* [XBOX 主機上的本機儲存體](/zh-TW/build/console-features/storage/local-storage)

## 另請參閱

[XPersistentLocalStorage](/zh-TW/reference/system/xpersistentlocalstorage/xpersistentlocalstorage_members)


## Related topics

- [XPersistentLocalStoragePromptUserForSpaceAsync](/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragepromptuserforspaceasync.md)
- [XPersistentLocalStorage](/reference/system/xpersistentlocalstorage/xpersistentlocalstorage_members.md)
- [XPersistentLocalStoragePromptUserForSpaceResult](/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragepromptuserforspaceresult.md)
