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

# XUserGetTokenAndSignatureUtf16Result

> XUserGetTokenAndSignatureUtf16Result

# XUserGetTokenAndSignatureUtf16Result

Gets the result of a call to [XUserGetTokenAndSignatureUtf16Async](/reference/system/xuser/functions/xusergettokenandsignatureutf16async).

## 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](/reference/system/xasync/structs/xasyncblock) 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](/reference/system/xuser/functions/xusergettokenandsignatureutf16async).

*ptrToBuffer*   \_Outptr\_\
Type: [XUserGetTokenAndSignatureUtf16Data\*\*](/reference/system/xuser/structs/xusergettokenandsignatureutf16data)

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](/reference/errorcodes).

## Remarks

The XUserGetTokenAndSignatureUtf16Async function uses an [XUserGetTokenAndSignatureOptions](/reference/system/xuser/enums/xusergettokenandsignatureoptions) 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](/reference/system/xuser/functions/xusergettokenandsignatureutf16async).

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

## Requirements

**Header:** XUser.h

**Library:** xgameruntime.lib

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

## See also

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

[XUserGetTokenAndSignatureUtf16Async](/reference/system/xuser/functions/xusergettokenandsignatureutf16async)

[XUserGetTokenAndSignatureUtf16ResultSize](/reference/system/xuser/functions/xusergettokenandsignatureutf16resultsize)


## Related topics

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