> ## 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.

# Save

> 지정된 컨테이너 내의 지정된 Blob(파일)에 데이터를 저장합니다.

# Microsoft.Xbox.Wrappers.XGameSave.Provider.Save

지정된 컨테이너 내의 지정된 Blob(파일)에 데이터를 저장합니다.

<a id="syntaxSection" />

## 구문

```cpp theme={null}
HRESULT Save(const std::string& containerName,
             const std::string& blobName,
             size_t dataSize,
             const uint8_t* blobData);
```

<a id="parametersSection" />

### 매개 변수

*containerName*   \_In\_<br />형식: std::string

컨테이너의 이름입니다.

*blobName*  \_In\_<br />형식: std::string

Blob의 이름입니다.

*dataSize*   \_In\_<br />형식: size\_t

Blob에 쓸 데이터의 양입니다. 이 크기는 최대 16MB(GS\_MAX\_BLOB\_SIZE)로 제한됩니다.

*blobData*   \_In\_<br />형식: uint8\_t\*

Blob에 쓸 바이트에 대한 포인터입니다.

<a id="retvalSection" />

### 반환 값

형식: HRESULT

이 메서드는 성공하면 **S\_OK**를 반환하고, 실패하면 다음 HRESULT 코드를 반환합니다.

* **GS\_INVALID\_CONTAINER\_NAME**
* **GS\_OUT\_OF\_LOCAL\_STORAGE**
* **GS\_UPDATE\_TOO\_BIG**
* **GS\_QUOTA\_EXCEEDED**
* **GS\_HANDLE\_EXPIRED**

<a id="exampleSection" />

## 예제

다음 코드 예제는 **Save** 함수를 사용하는 방법을 보여줍니다.

```cpp theme={null}
using Microsoft::Xbox::Wrappers::GameSave;

std::vector<uint8_t> saveData; // Contains the player's data.

Provider provider = new Provider();

if(SUCCEEDED(provider->Initialize(userHandle, mySCID))
{  
   HRESULT hr = provider->Save("Save_slot_1", "progress", saveData.size(), saveData.data());
   if(FAILED(hr))
   {
      if(hr == E_GS_QUOTA_EXCEEDED)
      {
         // Message that the user must delete saves for this game.
      }
      else if(hr == E_GS_OUT_OF_LOCAL_STORAGE)
      {
         // Message to the user that they have run out of save
         // space on the local device.
      }
      else if(hr == E_GS_UPDATE_TOO_BIG)
      {
         // This is really a development time thing to catch.
         // Your save size was too large for this Save call. Save
         // calls are limited to a maximum size of
         // 16 MB (GS_MAX_BLOB_SIZE).
      }
      else if(hr == E_GS_HANDLE_EXPIRED)
      {
         // You must recreate the provider, and then try again.
      }
      else
      {
         // Log error.
      }
   }
}
```

<a id="remarksSection" />

## 설명

`Provider` 클래스의 다른 메서드를 호출하려면 먼저 [Initialize](/reference/system/Wrappers/classes/provider/methods/xgamesave_wrapper_provider_initialize) 메서드를 호출해야 합니다.

저장 게임 래퍼를 초기화하고 지정된 사용자의 모든 컨테이너를 동기화하려면 [Initialize](/reference/system/Wrappers/classes/provider/methods/xgamesave_wrapper_provider_initialize)를 호출하세요.

지정된 컨테이너 내에서 지정된 Blob의 데이터를 로드하려면 [Load](/reference/system/Wrappers/classes/provider/methods/xgamesave_wrapper_provider_load)를 호출하세요.

<a id="requirementsSection" />

## 요구 사항

**헤더:** xgamesavewrappers.hpp

**지원 플랫폼:** Windows, XBOX One 제품군 콘솔 및 XBOX Series 콘솔

<a id="seealsoSection" />

## 참고 항목

[Microsoft.Xbox.Wrappers.XGameSave.Provider](/reference/system/Wrappers/classes/provider/xgamesave_wrapper_provider)<br />[XGameSave 래퍼 멤버](/reference/system/Wrappers/xgamesave_wrapper_members)<br />[Load](/reference/system/Wrappers/classes/provider/methods/xgamesave_wrapper_provider_load)


## Related topics

- [XGameSave](/ko/reference/system/xgamesave/xgamesave_members.md)
- [Game Saves 롤백](/ko/services/playfab/player-progression/game-saves/rollback.md)
- [Game Saves 개요](/ko/services/playfab/player-progression/game-saves/overview.md)
- [Game Saves 제한](/ko/services/playfab/player-progression/game-saves/limits.md)
- [Game Saves 충돌](/ko/services/playfab/player-progression/game-saves/conflicts.md)
