> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XUserGetTokenAndSignatureUtf16Result

> XUserGetTokenAndSignatureUtf16Result

Gets the result of a call to [XUserGetTokenAndSignatureUtf16Async](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureutf16async.md).

## Syntax

```cpp theme={null}
HRESULT XUserGetTokenAndSignatureUtf16Result(  
         XAsyncBlock* async,  
         size_t bufferSize,  
         void* buffer,  
         XUserGetTokenAndSignatureUtf16Data** ptrToBuffer,  
         size_t* bufferUsed  
)  
```

### Parameters

*async*   \_Inout\_\
Type: XAsyncBlock\*

An [XAsyncBlock](https://docs.xbox.com/reference/system/xasync/structs/xasyncblock.md) for polling the call's status and retrieving call results.

*bufferSize*   \_In\_\
Type: size\_t

The size of the buffer in the *buffer* parameter.

*buffer*   \_Out\_writes\_bytes\_to\_(bufferSize,*bufferUsed)\
Type: void*

Contains the results of the call to [XUserGetTokenAndSignatureUtf16Async](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureutf16async.md).

*ptrToBuffer*   \_Outptr\_\
Type: [XUserGetTokenAndSignatureUtf16Data\*\*](https://docs.xbox.com/reference/system/xuser/structs/xusergettokenandsignatureutf16data.md)

On return, *prtToBuffer* points to the buffer you specify in the *buffer* parameter. The parameter provides a typed pointer to *buffer* and doesn't need to be freed independently.

*bufferUsed*   \_Out\_opt\_\
Type: size\_t\*

The number of bytes written in the *buffer* parameter.

### Return value

### Return value

Type: HRESULT

Returns S\_OK if successful; otherwise, returns an error code.

| HRESULT | Message ID | Description |
| - | - | - |
| 0x80072EE7 | WININET\_E\_NAME\_NOT\_RESOLVED | The server name or address couldn't be resolved. |
| 0x80072EFD | WININET\_E\_CANNOT\_CONNECT | A connection with the server couldn't be established. |
| 0x80072EFE | WININET\_E\_CONNECTION\_ABORTED | The connection with the server was terminated abnormally. |
| 0x80072F8F | WININET\_E\_DECODING\_FAILED | Content decoding failed. |
| 0x8015DC01 | XO\_E\_SYSTEM\_UPDATE\_REQUIRED | System must be updated before being allowed to grant X-tokens. |
| 0x8015DC0B | XO\_E\_ACCOUNT\_COUNTRY\_NOT\_AUTHORIZED | Title trying to be used in a country/region it isn't authorized for. |
| 0x8015DBFF | XO\_E\_GAME\_USAGE\_BY\_USER\_EXCEEDED | User exceeded their allotted time allowed to play the game (parental controls). |
| 0x80860006 | ONL\_E\_FORCESIGNIN | To help protect your Online ID account, you must sign in again. |
| 0x87DD0006 | AM\_E\_XSTS\_UNEXPECTED | Unknown error occurred. |
| 0x87DD0013 | AM\_E\_USER\_NOT\_FOUND | User object is no longer signed in or is unknown. |
| 0x87DD0019 | AM\_E\_XSTS\_TIMEOUT | Timeout limit hit when trying to retrieve the X-token. |
| 0x87DD0022 | AM\_E\_XTITLE\_TIMEOUT | |
| 0x87DD0033 | AM\_E\_XSTS\_SERVICE\_UNAVAILABLE | The X token service is unable to be reached. |

For a list of other error codes, see [Error Codes](https://docs.xbox.com/reference/errorcodes.md).

## Remarks

The XUserGetTokenAndSignatureUtf16Async function uses an [XUserGetTokenAndSignatureOptions](https://docs.xbox.com/reference/system/xuser/enums/xusergettokenandsignatureoptions.md) enumeration argument to asynchronously retrieve unicode X-tokens and signatures for web requests.

To asynchronously retrieve Unicode X-tokens and signatures for web requests, call
[XUserGetTokenAndSignatureUtf16Async](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureutf16async.md).

To retrieve the required buffer size to hold the results of calling [XUserGetTokenAndSignatureUtf16Async](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureutf16async.md), call [XUserGetTokenAndSignatureUtf16ResultSize](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureutf16resultsize.md).

## Requirements

**Header:** XUser.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, Steam Deck, XBOX One family consoles, and XBOX Series consoles

## See also

[XUser](https://docs.xbox.com/reference/system/xuser/xuser_members.md)

[XUserGetTokenAndSignatureUtf16Async](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureutf16async.md)

[XUserGetTokenAndSignatureUtf16ResultSize](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureutf16resultsize.md)


## Related topics

- [XUserGetTokenAndSignatureUtf16ResultSize](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureutf16resultsize.md)
- [XUserGetTokenAndSignatureUtf16Data](https://docs.xbox.com/reference/system/xuser/structs/xusergettokenandsignatureutf16data.md)
- [XUserGetTokenAndSignatureUtf16Async](https://docs.xbox.com/reference/system/xuser/functions/xusergettokenandsignatureutf16async.md)
- [XUserGetTokenAndSignatureUtf16HttpHeader](https://docs.xbox.com/reference/system/xuser/structs/xusergettokenandsignatureutf16httpheader.md)
- [Xbox services authentication](https://docs.xbox.com/services/xbox-services/fundamentals/s2s-auth-calls/service-authentication/live-xbox-live-authentication.md)
