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

# XtfGetErrorText

> XtfGetErrorText

# XtfGetErrorText

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

<a id="syntaxSection" />

## 構文

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

<a id="parametersSection" />

### パラメーター

*HResult*\
型: HRESULT

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

*errorMessageBuffer*\
型: PWSTR\*

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

*errorMessageBufferLength*\
型: UINT32\*

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

*userActionTextBuffer*\
型: PWSTR\*

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

*userActionTextBufferLength*\
型: UINT32\*

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

<a id="retvalSection" />

### 戻り値

型: HRESULT

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

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

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

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

<a id="remarksSection" />

## 解説

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

<a id="requirementsSection" />

## 要件

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

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

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

<a id="seealsoSection" />

## 関連項目

[XtfConsoleControl](/reference/tools/xtf/xtfconsolecontrol/xtfconsolecontrol_members)\
[XBOX Tools Framework ネイティブ API リファレンス](/reference/tools/xtf/atoc-xtf-native)


## Related topics

- [XtfGetErrorTextA](/ja-jp/reference/tools/xtf/xtfconsolecontrol/functions/xtfgeterrortexta.md)
- [XtfGetAumid](/ja-jp/reference/tools/xtf/xtfapi/functions/xtfgetaumid-xtfapi-xbox-windows-m.md)
- [XtfGetTitleOSState](/ja-jp/reference/tools/xtf/xtfapi/functions/xtfgettitleosstate-xtfapi-xbox-windows-m.md)
- [PartyTextToSpeechProfile::GetGender](/ja-jp/services/playfab/multiplayer/networking/reference/classes/PartyTextToSpeechProfile/methods/partytexttospeechprofile_getgender.md)
- [PartyTextToSpeechProfile::GetIdentifier](/ja-jp/services/playfab/multiplayer/networking/reference/classes/PartyTextToSpeechProfile/methods/partytexttospeechprofile_getidentifier.md)
