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

# XtfGetErrorTextA

> XtfGetErrorTextA

# XtfGetErrorTextA

指定した `HRESULT` について、ユーザーが理解しやすいエラー メッセージとユーザー アクション テキストを取得します。

## 構文

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

### パラメーター

*HResult*\
型: HRESULT

\[in] エラー メッセージとユーザー アクション テキストを検索する `HRESULT` です。

*errorMessageBuffer*\
型: PSTR\*

\[out] null 終端文字列としてエラー メッセージを受け取るバッファーへのポインターです。 必要なバッファーの長さを決定するには、このパラメーターを `nullptr` に、*errorMessageBufferLength* パラメーターを 0 に設定します。 呼び出し時、*errorMessageBufferLength* は終端の null 文字を含む、必要なバッファーの CHAR での長さに設定されます。

*errorMessageBufferLength*\
型: UINT32\*

\[in, out] 入力ではエラー メッセージ バッファーの長さ (CHAR 単位) です。 バッファーの長さには、終端の null 文字用の領域を含める必要があります。 出力では、**errorMessageBuffer** の必要な長さ (CHAR 単位) です

*userActionTextBuffer*\
型: PSTR\*

\[out] null 終端文字列としてユーザー アクション テキストを受け取るバッファーへのポインターです。 必要なバッファーの長さを決定するには、このパラメーターを `nullptr` に、*userActionTextBufferLength* パラメーターを 0 に設定します。 呼び出し時、*userActionTextBufferLength* は終端の null 文字を含む、必要なバッファーの CHAR での長さに設定されます。

*userActionTextBufferLength*\
型: UINT32\*

\[in, out] ユーザー アクション テキスト バッファーの長さ (CHAR 単位) です。 バッファーの長さには、終端の null 文字用の領域を含める必要があります。

### 戻り値

型: HRESULT

成功した場合は `S_OK` を返します。それ以外の場合は HRESULT エラー コードを返します。

`S_OK` が返された場合、関数は成功しています。 `errorMessageBuffer` と `userActionTextBuffer` は、それぞれ指定された `HRESULT` のエラー メッセージとユーザー アクション テキストに設定されます。

`HRESULT_FROM_WIN32(ERROR_MORE_DATA)` が返された場合、`errorMessageBuffer` または `userActionTextBuffer` に指定されたバッファーが十分な大きさではありません。 `errorMessageBufferLength` と `userActionTextBufferLength` は、指定された `HRESULT` のエラー メッセージとユーザー アクション テキストのそれぞれに必要なバッファーの長さに設定されます。

その他の HRESULT コードが返された場合、予期しないエラーが発生したことを示します。

## 解説

`XtfGetErrorText` に渡された `HRESULT` が認識される XBOX Tools Framework (XTF) エラー コードでない場合、`errorMessageBuffer` は「Unspecified error」に設定されます。 この結果を使用して、指定された `HRESULT` が認識される XTF エラー コードかどうかを確認できます。 認識される XTF エラー コードの詳細については、[XTF トランスポート エラー (NDA トピック)](https://docs.xbox.com/ja-jp/tools/tools-console/commandlinetools/xtf-transport-errors.md) を参照してください。

## 要件

**ヘッダー:** xtfapi.h

**ライブラリ:** XtfApi.lib

**サポートされているプラットフォーム:** Windows (XBOX 本体ツール用)

## 関連項目

[XtfConsoleControl](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfconsolecontrol/xtfconsolecontrol_members.md)\
[XBOX Tools Framework ネイティブ API リファレンス](https://docs.xbox.com/ja-jp/reference/tools/xtf/atoc-xtf-native.md)


## Related topics

- [XtfGetErrorText](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfconsolecontrol/functions/xtfgeterrortext-xtfconsolecontrol-xbox-microsoft-m.md)
- [その他の Xtf API (API の内容)](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfapi/atoc-xtfapi.md)
- [XtfGetAumid](https://docs.xbox.com/ja-jp/reference/tools/xtf/xtfapi/functions/xtfgetaumid-xtfapi-xbox-windows-m.md)
- [PartyTextToSpeechProfile::GetGender](https://docs.xbox.com/ja-jp/services/playfab/multiplayer/networking/reference/classes/PartyTextToSpeechProfile/methods/partytexttospeechprofile_getgender.md)
- [PartyTextToSpeechProfile::GetIdentifier](https://docs.xbox.com/ja-jp/services/playfab/multiplayer/networking/reference/classes/PartyTextToSpeechProfile/methods/partytexttospeechprofile_getidentifier.md)
