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

# XUserResolveIssueWithUiResult

> XUserResolveIssueWithUiResult

# XUserResolveIssueWithUiResult

Recupera o resultado de uma chamada para [XUserResolveIssueWithUiAsync](/pt-BR/reference/system/xuser/functions/xuserresolveissuewithuiasync).

## Sintaxe

```cpp theme={null}
HRESULT XUserResolveIssueWithUiResult(  
         XAsyncBlock* async  
)  
```

### Parâmetros

*async*   \_Inout\_\
Tipo: [XAsyncBlock\*](/pt-BR/reference/system/xasync/structs/xasyncblock)

O AsyncBlock que passamos para [XUserResolveIssueWithUiAsync](/pt-BR/reference/system/xuser/functions/xuserresolveissuewithuiasync).

### Valor retornado

Tipo: HRESULT

Retornará S\_OK se for bem-sucedido; caso contrário, retornará um código de erro. Para obter uma lista de códigos de erro, confira [Códigos de erro](/pt-BR/reference/errorcodes).

| Código de retorno | Descrição |
| - | - |
| S\_OK | A operação foi bem-sucedida |
| E\_ABORT | O usuário cancelou a operação |

## Comentários

Se uma API XUsers retornar um erro E\_GAMEUSER\_RESOLVE\_USER\_ISSUE\_REQUIRED, o usuário deverá interagir com a interface do usuário (IU) do sistema para resolver o problema.
Chame [XUserResolveIssueWithUiAsync](/pt-BR/reference/system/xuser/functions/xuserresolveissuewithuiasync) para mostrar a IU do sistema apropriada.

Para exibir uma interface do usuário do sistema para resolver problemas de token com uma URL Unicode, chame [XUserResolveIssueWithUiUtf16Async](/pt-BR/reference/system/xuser/functions/xuserresolveissuewithuiutf16async).

Para recuperar o resultado de uma chamada para [XUserResolveIssueWithUiUtf16Async](/pt-BR/reference/system/xuser/functions/xuserresolveissuewithuiutf16async), chame [XUserResolveIssueWithUiUtf16Result](/pt-BR/reference/system/xuser/functions/xuserresolveissuewithuiutf16result).

O exemplo a seguir demonstra como exibir a IU do sistema para resolver problemas de token com uma URL.

```cpp theme={null}
HRESULT ResolveUserIssueComplete(XAsyncBlock* ab)
{
    if (SUCCEEDED_LOG(XUserResolveIssueWithUiResult(ab)))
    {
        appLog.AddLog("Successfully Resolved User Issue\n");
    }

    return S_OK;
}

HRESULT ResolveUserIssueUtf16Complete(XAsyncBlock* ab)
{
    if (SUCCEEDED_LOG(XUserResolveIssueWithUiUtf16Result(ab)))
    {
        appLog.AddLog("Successfully Resolved User Issue\n");
    }

    return S_OK;
}

HRESULT ResolveUserIssueWithUiAsync(
    XTaskQueueHandle queue,
    const char* narrowUrl = nullptr,
    const wchar_t* wideUrl = nullptr,
    bool useUtf16 = false)
{
    auto resolveAsyncBlock = std::make_unique<XAsyncBlock>();
    ZeroMemory(resolveAsyncBlock.get(), sizeof(*resolveAsyncBlock));
    resolveAsyncBlock->queue = queue;
    resolveAsyncBlock->context = this;

    if (useUtf16)
    {
        resolveAsyncBlock->callback = [](XAsyncBlock* ab)
        {
            auto asyncBlock = std::unique_ptr<XAsyncBlock>(ab);
            LOG_IF_FAILED(static_cast<User*>(ab->context)->ResolveUserIssueUtf16Complete(ab));
        };

        if (SUCCEEDED_LOG(XUserResolveIssueWithUiUtf16Async(
            _handle.get(),
            wideUrl,
            resolveAsyncBlock.get())))
        {
            // The call succeeded, so release the std::unique_ptr ownership of XAsyncBlock* since the callback will take over ownership.
            // If the call fails, the std::unique_ptr will keep ownership and delete the XAsyncBlock*
            resolveAsyncBlock.release();
        }
    }
    else
    {
        resolveAsyncBlock->callback = [](XAsyncBlock* ab)
        {
            auto asyncBlock = std::unique_ptr<XAsyncBlock>(ab);
            LOG_IF_FAILED(static_cast<User*>(ab->context)->ResolveUserIssueComplete(ab));
        };

        if (SUCCEEDED_LOG(XUserResolveIssueWithUiAsync(
            _handle.get(),
            narrowUrl,
            resolveAsyncBlock.get())))
        {
            // The call succeeded, so release the std::unique_ptr ownership of XAsyncBlock* since the callback will take over ownership.
            // If the call fails, the std::unique_ptr will keep ownership and delete the XAsyncBlock*
            resolveAsyncBlock.release();
        }
    }

    return S_OK;
}
```

## Requisitos

**Cabeçalho:** XUser.h

**Biblioteca:** xgameruntime.lib

**Plataformas com suporte:** Windows, Steam Deck, consoles da família XBOX One e consoles XBOX Series

## Confira também

[XUser](/pt-BR/reference/system/xuser/xuser_members)

[XUserResolveIssueWithUiAsync](/pt-BR/reference/system/xuser/functions/xuserresolveissuewithuiasync)

[XUserResolveIssueWithUiUtf16Async](/pt-BR/reference/system/xuser/functions/xuserresolveissuewithuiutf16async)

[XUserResolveIssueWithUiUtf16Result](/pt-BR/reference/system/xuser/functions/xuserresolveissuewithuiutf16result)


## Related topics

- [XUserResolveIssueWithUiResult](/es/reference/system/xuser/functions/xuserresolveissuewithuiresult.md)
- [XUserResolveIssueWithUiAsync](/reference/system/xuser/functions/xuserresolveissuewithuiasync.md)
- [XUser](/reference/system/xuser/xuser_members.md)
- [XUserResolveIssueWithUiUtf16Result](/reference/system/xuser/functions/xuserresolveissuewithuiutf16result.md)
- [XUserResolveIssueWithUiUtf16Async](/reference/system/xuser/functions/xuserresolveissuewithuiutf16async.md)
