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

# XNetworkingQueryStatistics

> XNetworkingQueryStatistics

# XNetworkingQueryStatistics

Retrieves the specified networking statistics into a caller provided buffer.

## Syntax

```cpp theme={null}
HRESULT XNetworkingQueryStatistics(  
         XNetworkingStatisticsType statisticsType,  
         XNetworkingStatisticsBuffer* statisticsBuffer
)  
```

### Parameters

*statisticsType*   \_In\_\
Type: [XNetworkingStatisticsType](/reference/networking/xnetworking/enums/xnetworkingstatisticstype)

The enumerated value identifying the particular statistics to be retrieved.

*statisticsBuffer*    \_Out\_\
Type: [XNetworkingStatisticsBuffer](/reference/networking/xnetworking/structs/xnetworkingstatisticsbuffer)

A pointer to a caller-provided structure into which the requested statistics will be written. The exact sub-structure field within the union buffer that is written depends on the requested type of statistics.

### Return value

Type: HRESULT

S\_OK if retrieving the statistics was successful. E\_NOTIMPL if retrieving the specified statistics type isn't supported on the current platform. E\_INVALIDARG if the specified statistics type isn't recognized by the Gaming Runtime.

## Remarks

This function retrieves a snapshot of the specified networking-related statistics into the caller-provided buffer. Note that most statistics are not guaranteed to report the same value across multiple calls to this function.

Only the statistics-specific substructure field within the output buffer union will be written. Any additional memory in the caller's output buffer that is defined by the union as a whole but that lies beyond the end of the substructure is not modified in any way by this function.

## Requirements

**Header:** XNetworking.h

**Library:** xgameruntime.lib

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

## See also

[XNetworking](/reference/networking/xnetworking/xnetworking_members)
