3.1.4.20 NetrServerStatisticsGet (Opnum 24)
The NetrServerStatisticsGet method retrieves the operating statistics for a service.
-
NET_API_STATUS NetrServerStatisticsGet( [in, string, unique] SRVSVC_HANDLE ServerName, [in, string, unique] WCHAR* Service, [in] DWORD Level, [in] DWORD Options, [out] LPSTAT_SERVER_0* InfoStruct );
ServerName: An SRVSVC_HANDLE (section 2.2.1.1) pointer that identifies the server. The client MUST map this structure to an RPC binding handle (see [C706] sections 4.3.5 and 5.1.5.2). The server MUST ignore this parameter.
Service: A pointer to a null-terminated UTF-16 string. This parameter MUST be ignored on receipt.
Level: Specifies the information level of the data. This MUST be set to 0.
Options: Reserved; MUST be 0.
InfoStruct: A pointer to the buffer that receives the data, as specified in section 2.2.4.39. This pointer is in the format of STAT_SERVER_0.
Return Values: The method returns 0x00000000 (NERR_Success) to indicate success; otherwise, it returns a nonzero error code. The method can take any specific error code value, as specified in [MS-ERREF] section 2.2.
In response to the NetrServerStatisticsGet message, the server MUST return the operating statistics for the service or return an error code.
The server MUST ignore the Service parameter on receipt.
If the Level parameter is not equal to 0, the server MUST fail the call with an ERROR_INVALID_LEVEL error code.
If the Options parameter is not equal to 0, the server MUST fail the call with an ERROR_INVALID_PARAMETER error code.
The server MUST query the statistics by invoking the underlying server events as specified in [MS-CIFS] section 3.3.4.23 and [MS-SMB2] section 3.3.4.24. The server MUST aggregate all the values in the structures received from both CIFS and SMB2 servers into a new STAT_SERVER_0 structure. In addition to these values, sts0_start MUST be set to StatisticsStartTime. The server MUST return the statistics in the STAT_SERVER_0 structure in the InfoStruct parameter.
The server SHOULD<88> enforce security measures to verify that the caller has the required permissions to execute this routine. If the caller does not have the required credentials, the server SHOULD<89> fail the call.