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

# XLaunchRestartOnCrash

> XLaunchRestartOnCrash

# XLaunchRestartOnCrash

現在実行中のゲーム インスタンスがクラッシュにより異常終了した場合に、ゲームを自動的に再起動します。

## Syntax

```cpp theme={null}
HRESULT XLaunchRestartOnCrash(  
         const char* args,  
         uint32_t reserved  
)  
```

### Parameters

*args*   \_In\_opt\_z\_\
型: char\*

ゲームを再起動する際に適用可能な、ゲーム固有の引数。

*reserved*   \_In\_\
型: uint32\_t

予約済み。0 に設定する必要があります。

### Return value

型: HRESULT

HRESULT の成功またはエラー コード。

## Remarks

[XLaunchNewGame](/reference/system/xgame/functions/xlaunchnewgame) と同様に、**XLaunchRestartOnCrash** は、一度に実行されるゲーム実行可能ファイルが 1 つだけであることを保証します。
クラッシュが検出された場合に新しい実行可能ファイルを起動するかどうかを決定する内部状態は、現在のゲーム インスタンスのライフタイムに関連付けられます。再起動されたゲーム インスタンスは、再起動の動作がまだ必要な場合、
再度 **XLaunchRestartOnCrash** を呼び出す必要があります。

<Note>タイトルが **XLaunchRestartOnCrash** を呼び出し、その後</Note>
[XLaunchNewGame](/reference/system/xgame/functions/xlaunchnewgame) を呼び出し、その後新しいゲームの起動前にクラッシュした場合、[XLaunchNewGame](/reference/system/xgame/functions/xlaunchnewgame) を介して指定された
新しい起動ではなく、呼び出し元のゲームが再起動されます。

<Note>この API はリテール シナリオでの使用を想定しておらず、devkit でない本体で呼び出された場合は</Note>
E\_NOTIMPL を返します。

## Requirements

**ヘッダー:** XGame.h

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム:** XBOX One ファミリー本体および XBOX Series 本体

## See also

[XGame](/reference/system/xgame/xgame_members)


## Related topics

- [XGame](/ja-jp/reference/system/xgame/xgame_members.md)
- [crash_detected](/ja-jp/services/playfab/api-references/events/MultiplayerServers/crash-detected.md)
- [PC およびモバイル ゲーム向けの XBOX 要件テスト ケース](/ja-jp/publishing/certification/pc-policy-tests.md)
- [XBOX 認定の概要](/ja-jp/publishing/certification/overview.md)
- [Crash data ページ](/ja-jp/tools/tools-console/wdp/windows-device-portal-on-xbox-crash-data.md)
