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

# XAsyncWork

> XAsyncWork

# XAsyncWork

[XAsyncRun](/reference/system/xasync/functions/xasyncrun) によって呼び出されるコールバック関数を表します。

## Syntax

```cpp theme={null}
HRESULT XAsyncWork(  
         XAsyncBlock* asyncBlock  
)  
```

### Parameters

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

[XAsyncRun](/reference/system/xasync/functions/xasyncrun) に渡された [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) のコピーへのポインター。

### Return value

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

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

## Remarks

[XAsyncRun](/reference/system/xasync/functions/xasyncrun) に渡された [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) のコピーへのポインターを使用することで、システムはポインターが常に存在し、コールバックに対して有効であることを保証できます。

[XAsyncRun](/reference/system/xasync/functions/xasyncrun) ヘルパー関数を使用してコールバック関数を非同期に実行する場合、呼び出されるコールバック関数の `XAsyncWork` ポインターを指定します。`XAsyncRun` は次に、[XAsyncProvider](/reference/system/xasyncprovider/xasyncprovider_members) 機能を使用してコールバック関数を実行します。

`XAsyncProvider` 機能の詳細については、[Asynchronous Programming Model](/build/core-features/common/async/async-programming-model) を参照してください。

## Requirements

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

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

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

## See also

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


## Related topics

- [XAsyncRun](/ja-jp/reference/system/xasync/functions/xasyncrun.md)
- [XAsync](/ja-jp/reference/system/xasync/xasync_members.md)
- [XAsyncBlock](/ja-jp/reference/system/xasync/structs/xasyncblock.md)
- [How matchmaking works](/ja-jp/services/playfab/multiplayer/matchmaking/how-matchmaking-works.md)
- [PartyWorkMode](/ja-jp/services/playfab/multiplayer/networking/reference/enums/partyworkmode.md)
