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

Returns a unique value from the console that is specific to caller's title ID.

## Syntax

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

### Parameters

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

The size of the *appSpecificDeviceId*, in bytes. This value must be equal to or greater than the **XSystemAppSpecificDeviceIdBytes**
constant defined in XSystem.h.

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

The character buffer that will receive the application specific device ID.

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

The size, in bytes, of the *appSpecificDeviceIdUsed* buffer returned.

### Return value

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

Returns **S\_OK** if successful; otherwise, returns an error code. For a list of error codes, see [Error Codes](/reference/errorcodes).
If the function fails because *appSpecificDeviceIdSize* is set to a value less than **XSystemAppSpecificDeviceIdBytes**, the
return value is set to **HRESULT\_FROM\_WIN32(ERROR\_INSUFFICIENT\_BUFFER)**.

## Remarks

<Note>This function isn't safe to call on a time-sensitive thread. For more information, see</Note>
[Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).

The constant string "00000000000000000000000000000000000000000000" will be returned in cases where the application
specific device identifier could not be obtained due to an error.

If your application is using Single-Sign-On (SSO), you should the XSTS SSO token's pairwise ID instead of the id returned
by this function.

## Requirements

**Header:** XSystem.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[Activating your dev kit (NDA topic)](/home/setup-install/devkits/setup/activating-dev-kit)\
[XSystemGetXboxLiveSandbodId](/reference/system/xsystem/functions/xsystemgetxboxlivesandboxid)\
[XSystem](/reference/system/xsystem/xsystem_members)


## Related topics

- [XSystem](/reference/system/xsystem/xsystem_members.md)
- [XSystemGetConsoleId](/reference/system/xsystem/functions/xsystemgetconsoleid.md)
- [APP_LOCAL_DEVICE_ID](/reference/system/xuser/structs/app_local_device_id.md)
- [Users and input devices](/build/core-features/common/user/users-input-devices.md)
- [XUser](/reference/system/xuser/xuser_members.md)
