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

Automatically restarts the game when the currently running instance of the game abnormally terminates due to a crash.

## Syntax

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

### Parameters

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

Any applicable, game-specific arguments with which to relaunch the game.

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

Reserved. Must be set to 0.

### Return value

Type: HRESULT

HRESULT success or error code.

## Remarks

Like [XLaunchNewGame](/reference/system/xgame/functions/xlaunchnewgame), **XLaunchRestartOnCrash** guarantees that only one game executable
is running at a time. The internal state which determines if a new executable is to be launched when a crash
is detected is tied to the lifetime of the current game instance. Relaunched game instances must also call
**XLaunchRestartOnCrash** again if the relaunch behavior is still desired.

<Note>If a title calls **XLaunchRestartOnCrash** and then later</Note>
[XLaunchNewGame](/reference/system/xgame/functions/xlaunchnewgame) and subsequently crashes prior to starting up the new game, the calling
game will get restarted as opposed to the new launch specified via [XLaunchNewGame](/reference/system/xgame/functions/xlaunchnewgame).

<Note>This API is not meant to be used in retail scenarios and will return E\_NOTIMPL</Note>
if it is invoked on a console which is not a devkit.

## Requirements

**Header:** XGame.h

**Library:** xgameruntime.lib

**Supported platforms:** XBOX One family consoles and XBOX Series consoles

## See also

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


## Related topics

- [XGame](/reference/system/xgame/xgame_members.md)
- [XLaunchNewGame](/reference/system/xgame/functions/xlaunchnewgame.md)
- [Home page (Dev Home)](/tools/tools-console/devhome/devhome-home.md)
- [Connect directly to debug game servers](/services/playfab/multiplayer/servers/directly-debugging-game-servers.md)
- [Best practices and launch checklist](/services/playfab/multiplayer/servers/best-practices.md)
