SecureDeviceAddress.CompareBytes Method

Compares two serialized SecureDeviceAddress byte arrays to see if they represent the same device.

Syntax

public:
static int32 CompareBytes(
         Array<unsigned char>^ bytes1,
         Array<unsigned char>^ bytes2
)  

Parameters

bytes1
Type: unsigned char 

 A pointer to the first serialized byte array.

bytes2
Type: unsigned char 

 A pointer to the second serialized byte array.

Return value

Type: int32 

 Returns 0 if the byte arrays represent the same device, or a non-zero value if they represent different devices.

Remarks

This method compares two byte arrays representing serialized SecureDeviceAddress data blocks, and returns 0 if they refer to the same device. If they do not refer to the same device, then -1 is returned if the first identity’s value is less than the second’s, or 1 if the first identity’s value is greater than the second’s, where the relative value will enable consistently sorting one device before another.

Equality or relative value of the device identities is determined based on contents inside the opaque block, not a direct memory comparison. Two network identities with different byte array sizes or contents may still refer to the same device.

No connection to either of the SecureDeviceAddresses is required, and this method does not initiate communication with them.

Requirements

Namespace: Windows.Xbox.Networking

Metadata: windows.winmd

See also

Reference

SecureDeviceAddress Class

SecureDeviceAddress Members

Windows.Xbox.Networking Namespace