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

# XSystemGetAppSpecificDeviceId

> XSystemGetAppSpecificDeviceId

# XSystemGetAppSpecificDeviceId

呼び出し元のタイトル ID に固有の、本体からの一意の値を返します。

## Syntax

```cpp theme={null}
HRESULT XSystemGetAppSpecificDeviceId(  
         size_t appSpecificDeviceIdSize,  
         char* appSpecificDeviceId,  
         size_t* appSpecificDeviceIdUsed  
)  
```

### Parameters

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

*appSpecificDeviceId* のサイズ (バイト単位)。この値は、XSystem.h で定義されている **XSystemAppSpecificDeviceIdBytes** 定数以上である必要があります。

*appSpecificDeviceId*   \_Out\_writes\_bytes\_to\_(appSpecificDeviceIdSize, \*appSpecificDeviceIdUsed)\
型: char\*

アプリケーション固有のデバイス ID を受け取る文字バッファー。

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

返される *appSpecificDeviceIdUsed* バッファーのサイズ (バイト単位)。

### Return value

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

成功した場合は **S\_OK**、それ以外の場合はエラー コードを返します。エラー コードの一覧については、[エラー コード](/reference/errorcodes) を参照してください。
*appSpecificDeviceIdSize* が **XSystemAppSpecificDeviceIdBytes** より小さい値に設定されているために関数が失敗した場合、戻り値は **HRESULT\_FROM\_WIN32(ERROR\_INSUFFICIENT\_BUFFER)** に設定されます。

## Remarks

<Note>この関数はタイム センシティブ スレッドで呼び出すのは安全ではありません。詳細については、以下を参照してください</Note>
[タイム センシティブ スレッド](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)。

エラーによりアプリケーション固有のデバイス識別子を取得できなかった場合、定数文字列 "00000000000000000000000000000000000000000000" が返されます。

アプリケーションでシングル サインオン (SSO) を使用している場合は、この関数から返される ID の代わりに、XSTS SSO トークンのペアワイズ ID を使用する必要があります。

## Requirements

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

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

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

## See also

[開発キットのアクティブ化 (NDA トピック)](/home/setup-install/devkits/setup/activating-dev-kit)\
[XSystemGetXboxLiveSandbodId](/reference/system/xsystem/functions/xsystemgetxboxlivesandboxid)\
[XSystem](/reference/system/xsystem/xsystem_members)


## Related topics

- [XSystem](/ja-jp/reference/system/xsystem/xsystem_members.md)
- [XSystemGetConsoleId](/ja-jp/reference/system/xsystem/functions/xsystemgetconsoleid.md)
- [GDK 向け Unity C# API ラッパー](/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [APP_LOCAL_DEVICE_ID](/ja-jp/reference/system/xuser/structs/app_local_device_id.md)
- [ILampArray::GetDeviceId](/ja-jp/reference/lighting/lamparray/interfaces/ilamparray/methods/ilamparray_getdeviceid.md)
