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

# XtfSetOverlayFolder

> XtfSetOverlayFolder

# XtfSetOverlayFolder

Sets, or resets, the overlay folder value associated with a specific package full name.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
HRESULT XtfSetOverlayFolder(
        PCWSTR address,
        PCWSTR packageFullName,
        PCWSTR overlayFolderPath
)   
```

<a id="ID4ET" />

### Parameters

*address*<br />Type: PCWSTR

\[in] Pointer to the address of the console.

*packageFullName*<br />Type: PCWSTR

\[in] Pointer to the package full name of the app.

*overlayFolderPath*<br />Type: PCWSTR

\[in] Pointer to a string that contains the overlay folder path. If overlayFolderPath is **null** then packageFullName is ignored and the Overlay Folder is reset (equivalent to [xbapp overlayfolder package\_full\_name /r (NDA topic)](/tools/tools-console/commandlinetools/xbapp)).

<a id="ID4E1" />

### Return value

Type: HRESULT

A return value of **S\_OK** indicates the function succeeded. Any other value indicates an unexpected error occurred.

<a id="remarks" />

## Remarks

Use [XTFSetOverlayFolder](/reference/tools/xtf/xtfapi/functions/xtfsetoverlayfolder-xtfapi-xbox-windows-m) to set or clear an overlay folder. Use [XtfGetOverlayFolder](/reference/tools/xtf/xtfapi/functions/xtfgetoverlayfolder-xtfapi-xbox-windows-m) to retrieve the overlay folder path currently set for a package. Use [XtfClearAllOverlayFolders](/reference/tools/xtf/xtfapi/functions/xtfclearalloverlayfolders-xtfapi-xbox-windows-m) to clear all overlay folder that were previously set on the console. Use [IXtfApplicationClient::GetInstalled](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/getinstalled-ixtfapplicationclient-xtfapplication-xbox-microsoft-m) to enumerate all packages currently installed on the console.

<Note>
  Overlay folders set using XtfSetOverlayFolder are persistent across reboots of the console.
</Note>

<a id="ID4E6C" />

## C++ Example

```cpp theme={null}
int wmain(int argc, wchar_t **argv)
{
    HRESULT             hr = S_OK;
    PCWSTR              consoleAddress = L"190.167.10.18";
    PCWSTR              pOverlayFolderPFN = L"682716bc-bcec-4d5b-a21d-e2b6a4e3066d_1.0.0.0_x64__8wekyb3d8bbwe";
    PWSTR               pOverlayFolderPath = L"D:\\MyGame1\\";
    PWSTR               pOverlayFolderPathReturned = nullptr;
    UINT32              bufferSize = 0;

    hr = XtfSetOverlayFolder(consoleAddress, pOverlayFolderPFN, pOverlayFolderPath);
    if (FAILED(hr))
    {
        wprintf(L"\n\n*** XtfSetOverlayFolder failed 0x%x", hr);
        return hr;
    }

    pOverlayFolderPathReturned = new WCHAR[APPLICATION_USER_MODEL_ID_MAX_LENGTH];
    hr = XtfGetOverlayFolder(consoleAddress, pOverlayFolderPFN, pOverlayFolderPathReturned, &buffersize);
    if (FAILED(hr))
    {
        wprintf(L"\n\n*** Overlay Folder Path is set to %s", pOverlayFolderPathReturned);
    }
    else
    {
        wprintf(L"\n\n*** XtfGetOverlayFolder failed 0x%x", hr);
    }
    delete[] pOverlayFolderPathReturned;

    return hr;
}
```

## Requirements

**Header:** xtfapi.h

**Library:** XtfApi.lib

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

## See also

[Debugging with Overlay Folders (NDA topic)](/build/console-features/debugging-diagnostics/debugging-with-overlay-folders)<br />Command line tool [xbapp overlayfolder (NDA topic)](/tools/tools-console/commandlinetools/xbapp)<br />[XTF Transport Errors (NDA topic)](/tools/tools-console/commandlinetools/xtf-transport-errors)


## Related topics

- [XtfGetOverlayFolder](/reference/tools/xtf/xtfapi/functions/xtfgetoverlayfolder-xtfapi-xbox-windows-m.md)
- [XtfClearAllOverlayFolders](/reference/tools/xtf/xtfapi/functions/xtfclearalloverlayfolders-xtfapi-xbox-windows-m.md)
- [Manage overlay folders](/tools/tools-console/devhome/devhome-overlay-folders.md)
- [Managing overlay folders](/tools/tools-console/wdp/windows-device-portal-on-xbox-overlay-folders.md)
- [Home page (Dev Home)](/tools/tools-console/devhome/devhome-home.md)
