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

# XblFormatSecureDeviceAddress

> XblFormatSecureDeviceAddress

# XblFormatSecureDeviceAddress

Formats a secure device address given a unique device id for platforms that don't support SDAs.

## Syntax

```cpp theme={null}
HRESULT XblFormatSecureDeviceAddress(  
         const char* deviceId,  
         XblFormattedSecureDeviceAddress* address  
)  
```

### Parameters

*deviceId*   \_In\_\
Type: char\*

A unique id to represent this device for the lifetime of the local game process/instance.

*address*   \_Inout\_\
Type: [XblFormattedSecureDeviceAddress\*](/reference/live/xsapi-c/multiplayer_c/structs/xblformattedsecuredeviceaddress)

Passes back the formatted secure device address.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Remarks

Formats the deviceId string according to the following recommendation: Generate 16 random bytes(e.g., a GUID) to be used for the lifetime of the local game process/instance to uniquely represent the device. Format the 'secureDeviceAddress' to be a string with the prefix "AAAAAAAA" (8 capital letter As) followed by the 32 character hexadecimal representation of the random bytes(upper or lower case letters don't matter, nor does the byte order if the bytes are an actual structured GUID). For example, "AAAAAAAA00112233445566778899AABBCCDDEEFF". Call XblMultiplayerSessionCurrentUserSetSecureDeviceAddressBase64 using the formatted SDA to set the SDA for the user.

## Requirements

**Header:** multiplayer\_c.h

**Library:** Microsoft.Xbox.Services.14x.GDK.C.lib

## See also

[multiplayer\_c](/reference/live/xsapi-c/multiplayer_c/multiplayer_c_members)


## Related topics

- [XblMultiplayerSessionCurrentUserSetSecureDeviceAddressBase64](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayersessioncurrentusersetsecuredeviceaddressbase64.md)
- [XblFormattedSecureDeviceAddress](/reference/live/xsapi-c/multiplayer_c/structs/xblformattedsecuredeviceaddress.md)
- [Session template constants](/services/xbox-services/multiplayer/mpsd/concepts/live-session-template-constants.md)
- [XblMultiplayerManagerLobbySessionSetSynchronizedHost](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerlobbysessionsetsynchronizedhost.md)
- [XblMultiplayerManagerGameSessionSetSynchronizedHost](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagergamesessionsetsynchronizedhost.md)
