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

# XtfGetTitleOSState

> XtfGetTitleOSState

# XtfGetTitleOSState

Get information about the running game, including its state, process ID, package full name, and Application User Model IDs (AUMIDs).

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
HRESULT XtfGetTitleOSState(
        PCWSTR address,
        UINT32* titleStateFlags,
        UINT32* pid,
        PWSTR packageFullName,
        UINT32* packageFullNameLength,
        PWSTR aumid,
        UINT32* aumidLength)
```

<a id="parametersSection" />

### Parameters

*address*\
Type: PCWSTR

\[in] The address of the console.

*titleStateFlags*\
Type: UINT32\*

\[out, optional] A bitwise-OR combination of flags that provide additional information about the game. If this value is not required, set this to `nullptr`. This parameter supports the following flags:

| Flag                                    | Value  | Description                                                                                                                                                                                                                                                                                                      |
| --------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| XTF\_TITLESTATE\_FASTITERATION\_ENABLED | 0x0001 | Fast Iteration Mode is enabled for this game. For more information about Fast Iteration Mode, see [Application Management (xbapp.exe) (NDA topic)](/tools/tools-console/commandlinetools/xbapp) and [Managing applications and files (NDA topic)](/tools/tools-console/xbom/manager-tool-managing-applications). |
| XTF\_TITLESTATE\_TITLE\_RUNNING         | 0x0002 | The game is currently running.                                                                                                                                                                                                                                                                                   |
| XTF\_TITLESTATE\_TITLEOS\_RUNNING       | 0x0004 | The Game OS for the game is currently running.                                                                                                                                                                                                                                                                   |
| XTF\_TITLESTATE\_TITLENETWORK\_READY    | 0x0008 | Networking is ready for the game.                                                                                                                                                                                                                                                                                |

*pid*\
Type: UINT32\*

\[out, optional] The process ID of the game, if the game is currently running; otherwise, zero. If this value is not required, set this to `nullptr`.

*packageFullName*\
Type: PWSTR

\[out, optional] The package full name of the game, if the game is currently running; otherwise, an empty string (""). If this value is not required or if the buffer length is required, set this to `nullptr`.

*packageFullNameLength*\
Type: UINT32\*

\[out, optional] The length of the buffer required for *packageFullName* in WCHAR. If this value is not required, set this to `nullptr`.

*aumid*\
Type: PWSTR

\[out, optional] The AUMID of the game, if the game is currently running; otherwise, an empty string (""). If this value is not required, set this to `nullptr`.

*aumidLength*\
Type: UINT32\*

\[out, optional] The length of the buffer required for *aumid* in WCHAR. If this value is not required, set this to `nullptr`.

<a id="retvalSection" />

### Return value

Type: HRESULT

Returns `S_OK` if successful; otherwise, returns an HRESULT error code. Returns `HRESULT_FROM_WIN32(ERROR_MORE_DATA)` if `packageFullName` or `aumid` buffers are too small.

<a id="remarksSection" />

## Remarks

This function returns information about the state of the currently running game, including title state flags, process ID, package full name, and Application User Model ID (AUMID). For more information about packaging, see [Packaging](/build/core-features/common/packaging/gc-packaging-toc).

To retrieve the required buffer lengths for the `packageFullName` and `aumid` buffers, perform the following steps:

1. Set `packageFullName` and `aumid` parameters to `nullptr`
2. Set `packageFullNameLength` and `aumidLength` parameters to valid UINT32 pointers
3. Call `XtfGetTitleOSState`

If the function runs successfully, the `packageFullNameLength` and `aumidLength` parameters contain the required buffer lengths, in WCHAR, for `packageFullName` and `aumidLength`, respectively.

<a id="requirementsSection" />

## Requirements

**Header:** xtfapi.h

**Library:** XtfApi.lib

**Supported platforms:** Windows (for XBOX console tools)

<a id="seealsoSection" />

## See also

[XtfGetAumid](/reference/tools/xtf/xtfapi/functions/xtfgetaumid-xtfapi-xbox-windows-m)\
[XtfGetPackageFullName](/reference/tools/xtf/xtfapi/functions/xtfgetpackagefullname-xtfapi-xbox-windows-m)\
[XTF Transport Errors (NDA topic)](/tools/tools-console/commandlinetools/xtf-transport-errors)\
[Additional Xtf APIs](/reference/tools/xtf/xtfapi/atoc-xtfapi)
