Packet Sniffer SDK DLL Edition

HNAdapter :: Methods :: AdpGetMissed

 Previous Next

Returns the number of the packets lost by the network adapter.

Syntax:

DWORD __stdcall AdpGetMissed(HANDLE hAdp, DWORD *HiValue);

Parameters:

hAdp

[in] HNAdapter object handle.

HiValue

[out] The pointer to the variable, in which the high DWORD of the result will be stored. May be set to NULL, if the application does not need these data.

Return values:

If the function succeeds, the return value will be the low-order doubleword of the number of the packets lost by the network adapter, and if HiValue is non-NULL, the function will put the high-order doubleword of this number into the variable pointed to by this parameter.

Description:

Use AdpGetMissed after opening the network adapter and executing the AdpUpdateAdapterStatistics function.

This function returns the value of the HNAdapter internal packets counter. This value is set with the PSSDK internal driver packets counter value syncronously after AdpUpdateAdapterStatistics function call. So, to get the latest packets counter value you should call AdpGetMissed immediately after AdpUpdateAdapterStatistics function call.

To get the network adapter statistics synchronously, please do the following:

void GetAdapterStat()
 {
   ULARGE_INTEGER  Stat;

   // Refresh the adapter statistics synchronously
   AdpUpdateAdapterStatistics(hAdp);

   // Display the adapter statistics
   Stat.LowPart = AdpGetMissed(hAdp,&Stat.HighPart);
   NdisMissed->Caption = Stat.QuadPart;

   Stat.LowPart = AdpGetRecvWithErr(hAdp,&Stat.HighPart);
   NdisRecvWithErr->Caption = Stat.QuadPart;

   Stat.LowPart = AdpGetRecvWithoutErr(hAdp,&Stat.HighPart);
   NdisRecvWithoutErr->Caption = Stat.QuadPart;

   Stat.LowPart = AdpGetTranWithErr(hAdp,&Stat.HighPart);
   NdisTranWithErr->Caption = Stat.QuadPart;

   Stat.LowPart = AdpGetTranWithoutErr(hAdp,&Stat.HighPart);
   NdisTranWithoutErr->Caption = Stat.QuadPart;
 }
See also:HNAdapter, AdpOpenAdapter, AdpUpdateAdapterStatistics