ReactOS 0.4.15-dev-8207-gd73a838
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 IdleTime, PULONG KernelAndUserTime, 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:778

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  IdleTime,
PULONG  KernelAndUserTime,
PULONG  ProcessorNumber 
)

Definition at line 345 of file sysinfo.c.

348{
349 PKPRCB Prcb;
350
351 Prcb = KeGetCurrentPrcb();
352
353 *IdleTime = Prcb->IdleThread->KernelTime;
354 *KernelAndUserTime = Prcb->KernelTime + Prcb->UserTime;
355 *ProcessorNumber = (ULONG)Prcb->Number;
356}
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
Definition: ketypes.h:1161
struct _KTHREAD * IdleThread
Definition: ketypes.h:652
ULONG UserTime
Definition: ketypes.h:818
USHORT Number
Definition: ketypes.h:643
ULONG KernelTime
Definition: ketypes.h:817
uint32_t ULONG
Definition: typedefs.h:59

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}
if(dx< 0)
Definition: linetemp.h:194
uint64_t ULONGLONG
Definition: typedefs.h:67

Referenced by NdisGetCurrentProcessorCpuUsage().