Platform SDK: Network Management

NetStatisticsGet

The NetStatisticsGet function retrieves operating statistics for a service. Currently, only the workstation and server services are supported.

Security Requirements

Only members of the Administrators or Account Operators local group can successfully execute the NetStatisticsGet function on a remote server.

NET_API_STATUS NetStatisticsGet(
  LPWSTR server,  
  LPWSTR service, 
  DWORD level,    
  DWORD options, 
  LPBYTE *bufptr  
);

Parameters

server
[in] Pointer to a Unicode string that specifies the name of the server on which to execute NetStatisticsGet. The string must begin with \\. If this parameter is NULL, the local computer is used.
service
[in] Pointer to a Unicode string that specifies the name of the service about which to get the statistics. Only the values SERVICE_SERVER and SERVICE_WORKSTATION are currently allowed.
level
[in] Specifies the information level of the data. This parameter can be the following value.
Value Meaning
0 Return statistics about a workstation or a server. The bufptr parameter points to a STAT_WORKSTATION_0 or a STAT_SERVER_0 structure.

options
[in] This parameter must be zero.
bufptr
[out] Pointer to the buffer that receives the data. The format of this data depends on the value of the level parameter. This buffer is allocated by the system and must be freed using the NetApiBufferFree function.

Return Values

If the function succeeds, the return value is NERR_Success.

If the function fails, the return value is a Win32 API error code. For a list of error codes, see Error Codes.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Unsupported.
  Header: Declared in Lmstats.h; include Lm.h.
  Library: Use Netapi32.lib.

See Also

Network Management Overview, Network Management Functions, Statistics Functions, NetServerGetInfo, STAT_SERVER_0, STAT_WORKSTATION_0