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

# XUserResolveIssueWithUiUtf16Result

> XUserResolveIssueWithUiUtf16Result

# XUserResolveIssueWithUiUtf16Result

检索对 [XUserResolveIssueWithUiUtf16Async](/reference/system/xuser/functions/xuserresolveissuewithuiutf16async) 的调用结果。

## 语法

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

### 参数

*async*   \_Inout\_\
类型：XAsyncBlock\*

传递给 [XUserResolveIssueWithUiUtf16Async](/reference/system/xuser/functions/xuserresolveissuewithuiutf16async) 的 [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)。

### 返回值

类型：HRESULT

成功时返回 S\_OK；否则返回错误代码。
有关错误代码的列表，请参阅[错误代码](/reference/errorcodes)。

| 返回代码     | 描述      |
| -------- | ------- |
| S\_OK    | 操作成功    |
| E\_ABORT | 用户取消了操作 |

## 备注

如果 XUsers API 返回 E\_GAMEUSER\_RESOLVE\_USER\_ISSUE\_REQUIRED 错误，用户必须与系统用户界面（UI）交互才能解决该问题。
调用 [XUserResolveIssueWithUiUtf16Async](/reference/system/xuser/functions/xuserresolveissuewithuiutf16async) 以显示相应的系统 UI。

要显示用于解决非 Unicode URL 令牌问题的系统用户界面，请调用 [XUserResolveIssueWithUiAsync](/reference/system/xuser/functions/xuserresolveissuewithuiasync)。

以下示例演示如何显示系统 UI 来解决 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;
}
```

## 要求

**头文件：** XUser.h

**库：** xgameruntime.lib

**支持的平台：** Windows、Steam Deck、XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

[XUser](/reference/system/xuser/xuser_members)

[XUserResolveIssueWithUiUtf16Async](/reference/system/xuser/functions/xuserresolveissuewithuiutf16async)

[XUserResolveIssueWithUiAsync](/reference/system/xuser/functions/xuserresolveissuewithuiasync)


## Related topics

- [XUserResolveIssueWithUiResult](/zh-CN/reference/system/xuser/functions/xuserresolveissuewithuiresult.md)
- [XUserResolveIssueWithUiUtf16Async](/zh-CN/reference/system/xuser/functions/xuserresolveissuewithuiutf16async.md)
- [XUser](/zh-CN/reference/system/xuser/xuser_members.md)
- [面向 GDK 的 Unity C# API 包装器](/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XUserResolveIssueWithUiAsync](/zh-CN/reference/system/xuser/functions/xuserresolveissuewithuiasync.md)
