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

# XtfGetErrorTextA

> XtfGetErrorTextA

# XtfGetErrorTextA

Gets a user-friendly error message and user action text for the specified `HRESULT`.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
HRESULT XtfGetErrorTextA(
         HRESULT HResult,
         PSTR *errorMessageBuffer,
         UINT32 *errorMessageBufferLength,
         PSTR *userActionTextBuffer,
         UINT32 *userActionTextBufferLength
)  
```

<a id="parametersSection" />

### Parameters

*HResult*\
Type: HRESULT

\[in] The `HRESULT` to look up the error message and user action text for.

*errorMessageBuffer*\
Type: PSTR\*

\[out] A pointer to the buffer that receives the error message as a null-terminated string. To determine the required buffer length, set this parameter to `nullptr` and the *errorMessageBufferLength* parameter to 0. Upon invocation, *errorMessageBufferLength* is set to the length of the required buffer in CHARs, including the terminating null character.

*errorMessageBufferLength*\
Type: UINT32\*

\[in, out] On input the length of the error message buffer in CHARs. The buffer length must include room for a terminating null character. On output the required length of **errorMessageBuffer** in CHARs

*userActionTextBuffer*\
Type: PSTR\*

\[out] A pointer to the buffer that receives the user action text as a null terminated string. To determine the required buffer length, set this parameter to `nullptr` and the *userActionTextBufferLength* parameter to 0. Upon invocation, *userActionTextBufferLength* is set to the length of the required buffer in CHARs, including the terminating null character.

*userActionTextBufferLength*\
Type: UINT32\*

\[in, out] The length of the user action text buffer in CHARs. The buffer length must include room for a terminating null character.

<a id="retvalSection" />

### Return value

Type: HRESULT

Returns `S_OK` if successful; otherwise, it returns an HRESULT error code.

If `S_OK` is returned, the function succeeded. `errorMessageBuffer` and `userActionTextBuffer` are set to the error message and user action text, respectively, for the specified `HRESULT`.

If `HRESULT_FROM_WIN32(ERROR_MORE_DATA)` is returned, the buffer supplied for `errorMessageBuffer` or `userActionTextBuffer` was not large enough. `errorMessageBufferLength` and `userActionTextBufferLength` are set to the required buffer lengths of the error message and user action text, respectively, for the specified `HRESULT`.

If any other HRESULT code is returned, an unexpected error occurred.

<a id="remarksSection" />

## Remarks

If the `HRESULT` passed to `XtfGetErrorText` is not a recognized XBOX Tools Framework (XTF) error code, `errorMessageBuffer` is set to "Unspecified error". You can use this result to check whether the specified `HRESULT` is a recognized XTF error code. For more information about recognized XTF error codes, see [XTF transport errors (NDA topic)](/tools/tools-console/commandlinetools/xtf-transport-errors).

<a id="requirementsSection" />

## Requirements

**Header:** xtfapi.h

**Library:** XtfApi.lib

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

<a id="seealsoSection" />

## See also

[XtfConsoleControl](/reference/tools/xtf/xtfconsolecontrol/xtfconsolecontrol_members)\
[XBOX Tools Framework native API reference](/reference/tools/xtf/atoc-xtf-native)


## Related topics

- [XtfGetErrorText](/reference/tools/xtf/xtfconsolecontrol/functions/xtfgeterrortext-xtfconsolecontrol-xbox-microsoft-m.md)
- [PartyTextToSpeechProfile::GetGender](/services/playfab/multiplayer/networking/reference/classes/PartyTextToSpeechProfile/methods/partytexttospeechprofile_getgender.md)
- [PartyTextToSpeechProfile::GetIdentifier](/services/playfab/multiplayer/networking/reference/classes/PartyTextToSpeechProfile/methods/partytexttospeechprofile_getidentifier.md)
- [PartyTextToSpeechProfile::GetName](/services/playfab/multiplayer/networking/reference/classes/PartyTextToSpeechProfile/methods/partytexttospeechprofile_getname.md)
- [XGameUiTextEntryGetState](/reference/system/xgameui/functions/xgameuitextentrygetstate.md)
