ReactOS  0.4.14-dev-317-g96040ec
ndissys.h File Reference
#include <ndis.h>
#include "debug.h"
#include "miniport.h"
#include "protocol.h"
#include "efilter.h"
#include "buffer.h"
Include dependency graph for ndissys.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EXPORT   NTAPI
 
#define NDIS_VERSION   0x00050001
 
#define NDIS_TAG   0x4e4d4953
 
#define MIN(value1, value2)   ((value1 < value2)? value1 : value2)
 
#define MAX(value1, value2)   ((value1 > value2)? value1 : value2)
 
#define ExInterlockedRemoveEntryList(_List, _Lock)
 

Functions

VOID NTAPI ExGetCurrentProcessorCounts (PULONG ThreadKernelTime, PULONG TotalCpuTime, PULONG ProcessorNumber)
 
VOID NTAPI ExGetCurrentProcessorCpuUsage (PULONG CpuUsage)
 

Macro Definition Documentation

◆ ExInterlockedRemoveEntryList

#define ExInterlockedRemoveEntryList (   _List,
  _Lock 
)
Value:
KeAcquireSpinLock(_Lock, &OldIrql); \
RemoveEntryList(_List); \
KeReleaseSpinLock(_Lock, OldIrql); \
}
UCHAR KIRQL
Definition: env_spec_w32.h:591
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803

Definition at line 37 of file ndissys.h.

◆ EXPORT

Definition at line 23 of file ndissys.h.

◆ MAX

#define MAX (   value1,
  value2 
)    ((value1 > value2)? value1 : value2)

Definition at line 34 of file ndissys.h.

◆ MIN

#define MIN (   value1,
  value2 
)    ((value1 < value2)? value1 : value2)

Definition at line 31 of file ndissys.h.

◆ NDIS_TAG

#define NDIS_TAG   0x4e4d4953

Definition at line 29 of file ndissys.h.

◆ NDIS_VERSION

#define NDIS_VERSION   0x00050001

Definition at line 27 of file ndissys.h.

Function Documentation

◆ ExGetCurrentProcessorCounts()

VOID NTAPI ExGetCurrentProcessorCounts ( PULONG  ThreadKernelTime,
PULONG  TotalCpuTime,
PULONG  ProcessorNumber 
)

Definition at line 345 of file sysinfo.c.

348 {
349  PKPRCB Prcb;
350 
351  Prcb = KeGetCurrentPrcb();
352 
353  *ThreadKernelTime = Prcb->KernelTime + Prcb->UserTime;
354  *TotalCpuTime = Prcb->CurrentThread->KernelTime;
355  *ProcessorNumber = KeGetCurrentProcessorNumber();
356 }
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1062
FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID)
Definition: ke.h:325
struct _KTHREAD * CurrentThread
Definition: ketypes.h:566
ULONG KernelTime
Definition: ketypes.h:733
ULONG UserTime
Definition: ketypes.h:734

Referenced by NdisGetCurrentProcessorCounts().

◆ ExGetCurrentProcessorCpuUsage()

VOID NTAPI ExGetCurrentProcessorCpuUsage ( PULONG  CpuUsage)

Definition at line 324 of file sysinfo.c.

325 {
326  PKPRCB Prcb;
327  ULONG TotalTime;
328  ULONGLONG ScaledIdle;
329 
330  Prcb = KeGetCurrentPrcb();
331 
332  ScaledIdle = (ULONGLONG)Prcb->IdleThread->KernelTime * 100;
333  TotalTime = Prcb->KernelTime + Prcb->UserTime;
334  if (TotalTime != 0)
335  *CpuUsage = (ULONG)(100 - (ScaledIdle / TotalTime));
336  else
337  *CpuUsage = 0;
338 }
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1062
ULONG KernelTime
Definition: ketypes.h:733
if(!(yy_init))
Definition: macro.lex.yy.c:714
uint64_t ULONGLONG
Definition: typedefs.h:65
ULONG UserTime
Definition: ketypes.h:734
struct _KTHREAD * IdleThread
Definition: ketypes.h:568
unsigned int ULONG
Definition: retypes.h:1

Referenced by NdisGetCurrentProcessorCpuUsage().