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

# XAsyncGetStatus

> XAsyncGetStatus

# XAsyncGetStatus

非同期呼び出しの状態を返します。必要に応じて完了を待機します。

## Syntax

```cpp theme={null}
HRESULT XAsyncGetStatus(  
         XAsyncBlock* asyncBlock,  
         bool wait  
)  
```

### Parameters

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

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

*wait*   \_In\_\
型: bool

true の場合、`XAsyncGetStatus` は、非同期呼び出しが完了するかキャンセルされるまで待機します。

### Return value

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

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

## Remarks

非同期呼び出しが完了したら、非同期呼び出しに結果のデータ ペイロードがある場合、[XAsyncGetResult](/reference/system/xasyncprovider/functions/xasyncgetresult) を呼び出して結果を取得できます。非同期呼び出しに結果のデータ ペイロードがない場合は、[XAsyncGetResult](/reference/system/xasyncprovider/functions/xasyncgetresult) を呼び出す必要はありません。

**注:** 完了コールバックと、待機パラメーターに true を指定した `XAsyncGetStatus` の両方を使用して、呼び出しが完了した時点を特定できます。これらの呼び出しの順序はあいまいになる可能性があるため、ベスト プラクティスとして、同じ呼び出しに両方を使用しないでください。

## Requirements

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

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

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

## Conceptual documentation

* [Run simple task](/build/core-features/common/async/async-libraries/async-library-xasync-example-run-simple-task)
* [XAsync library overview](/build/core-features/common/async/async-libraries/async-library-xasync)
* [Set up custom provider](/build/core-features/common/async/async-libraries/async-library-xasyncprovider-example-setup-custom-provider)
* [Asynchronous Programming Model](/build/core-features/common/async/async-programming-model)
* [Asynchronous programming design goals and improvements](/build/core-features/common/async/async-whitepaper)

## See also

[XAsync Members](/reference/system/xasync/xasync_members)\
[XAsyncGetResult](/reference/system/xasyncprovider/functions/xasyncgetresult)\
[Asynchronous Programming Model](/build/core-features/common/async/async-programming-model)


## Related topics

- [XAsyncGetResultSize](/ja-jp/reference/system/xasync/functions/xasyncgetresultsize.md)
- [XAsyncCompletionRoutine](/ja-jp/reference/system/xasync/functions/xasynccompletionroutine.md)
- [PFUninitializeAsync](/ja-jp/services/playfab/api-references/c/pfcore/functions/pfuninitializeasync.md)
- [単純なタスクの実行例](/ja-jp/build/core-features/common/async/async-libraries/async-library-xasync-example-run-simple-task.md)
- [XblSocialSubmitReputationFeedbackAsync](/ja-jp/reference/live/xsapi-c/social_c/functions/xblsocialsubmitreputationfeedbackasync.md)
