i-stat怎么打印IStats::GetTotalStatistics method

新闻资讯2026-04-20 23:47:01

The GetTotalStatistics method retrieves the total statistics for the current capture.

HRESULT STDMETHODCALLTYPE GetTotalStatistics(
  [out] LPSTATISTICS lpStats,
  [in]  BOOL         fClearAfterReading
);

lpStats [out]

Pointer to a STATISTICSstructure that provides the total statistics for the capture. It is the caller's responsibility to allocate and free the memory used by the STATISTICS structure.

fClearAfterReading [in]

Flag used to tell Network Monitor how to handle the internal storage of the total statistics. A setting of TRUE tells Network Monitor to clear out the internal storage of the total statistics after the current information is retrieved.

If the method is successful, the return value is NMERR_SUCCESS.

If the method is unsuccessful, the return value is one of the following error codes:

Return code Description
NMERR_NOT_CONNECTED
The NPP is not connected to the network. Call the IStats::Connect method to connect the NPP to the network.
NMERR_NOT_STATS_ONLY
The NPP is connected to the network but not with the IStats::Connect method.
NMERR_NOT_CAPTURING
The NPP is not capturing data. Call the IStats::Start method to start capturing data.

This method returns data only while a capture is in progress, including while the capture is paused.

Network Monitor also stores conversation statistics, which can be retrieved by calling the IStats::GetConversationStatistics method.

Requirement Value Minimum supported client Windows 2000 Professional [desktop apps only] Minimum supported server Windows 2000 Server [desktop apps only] Header
Netmon.h
DLL
Ndisnpp.dll;
Rmtnpp.dll

IStats

IStats::Connect

IStats::GetConversationStatistics

IStats::Start,

STATISTICS