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

# XAsyncGetResult

> XAsyncGetResult

# XAsyncGetResult

非同期プロバイダーからの非同期呼び出しの結果を返します。

## Syntax

```cpp theme={null}
HRESULT XAsyncGetResult(  
         XAsyncBlock* asyncBlock,  
         const void* identity,  
         size_t bufferSize,  
         void* buffer,  
         size_t* bufferUsed  
)  
```

### Parameters

*asyncBlock*   \_Inout\_\
型: [XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

非同期呼び出しのために [XAsyncBegin](/reference/system/xasyncprovider/functions/xasyncbegin) に渡された [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) へのポインター。

*identity*   \_In\_opt\_\
型: void\*

省略可能。非同期呼び出しを識別するために使用できる任意のトークンへのポインター。対応する [XAsyncBegin](/reference/system/xasyncprovider/functions/xasyncbegin) 呼び出しの *identity* パラメーターに値が指定された場合、ここには同じポインターを指定する必要があります。

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

*buffer* に指定された結果バッファーのサイズ (バイト単位)。

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

結果バッファーへのポインター。

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

省略可能。*buffer* に指定された結果バッファーに書き込まれたバイト数を格納するポインター。この値は、[XAsyncComplete](/reference/system/xasyncprovider/functions/xasynccomplete) が呼び出された際に非同期プロバイダーによって指定された *requiredResultSize* パラメーターの値として定義されます。

### Return value

型: [HRESULT](https://learn.microsoft.com/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)

成功した場合は `S_OK` を返します。それ以外の場合はエラー コードを返します。エラー コードの一覧については、[Error Codes](/reference/errorcodes) を参照してください。

## Remarks

非同期呼び出しにデータ ペイロードがある場合は、この関数を呼び出してデータ ペイロードを返します。非同期呼び出しにデータ ペイロードがない場合は、この関数を呼び出す必要はありません。この関数がデータ ペイロードを持たない非同期呼び出しに対して呼び出された場合、関数はエラー コード `E_NOT_SUPPORTED` を返します。

この非同期呼び出しの [XAsyncBegin](/reference/system/xasyncprovider/functions/xasyncbegin) 関数の *identity* パラメーターに値が指定されていた場合は、この関数の *identity* パラメーターにも同じ値を指定する必要があります。それ以外の場合、呼び出しの不一致が発生し、関数はエラー コード `E_INVALIDARG` を返します。

この関数が完了し、結果が *buffer* に指定された結果バッファーに返された後、*asyncBlock* に指定された [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) は完了し、非同期呼び出しには関連付けられなくなります。

## Requirements

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

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

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体および XBOX Series 本体

## Conceptual documentation

* [Set up custom provider](/build/core-features/common/async/async-libraries/async-library-xasyncprovider-example-setup-custom-provider)
* [Set up return data](/build/core-features/common/async/async-libraries/async-library-xasyncprovider-example-setup-return-data)
* [Asynchronous Programming Model](/build/core-features/common/async/async-programming-model)

## See also

[XAsyncProvider Members](/reference/system/xasyncprovider/xasyncprovider_members)\
[XAsyncBegin](/reference/system/xasyncprovider/functions/xasyncbegin)\
[XAsyncComplete](/reference/system/xasyncprovider/functions/xasynccomplete)\
[Asynchronous Programming Model](/build/core-features/common/async/async-programming-model)


## Related topics

- [XAsyncGetResultSize](/ja-jp/reference/system/xasync/functions/xasyncgetresultsize.md)
- [XAsyncGetStatus](/ja-jp/reference/system/xasync/functions/xasyncgetstatus.md)
- [XAsyncBegin](/ja-jp/reference/system/xasyncprovider/functions/xasyncbegin.md)
- [戻りデータのセットアップ例](/ja-jp/build/core-features/common/async/async-libraries/async-library-xasyncprovider-example-setup-return-data.md)
- [非同期プログラミング モデル](/ja-jp/build/core-features/common/async/async-programming-model.md)
