ReactOS 0.4.17-dev-573-g8315b8c
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   'SIDN'
 
#define MIN(value1, value2)    ((value1 < value2)? value1 : value2)
 
#define MAX(value1, value2)    ((value1 > value2)? value1 : value2)
 
#define RTL_CONSTANT_LARGE_INTEGER(quad_part)   {{(quad_part), (quad_part) >> 32}}
 
#define ExInterlockedRemoveEntryList(_List, _Lock)
 

Functions

VOID NTAPI ExGetCurrentProcessorCounts (PULONG IdleTime, PULONG KernelAndUserTime, PULONG ProcessorNumber)
 
VOID NTAPI ExGetCurrentProcessorCpuUsage (PULONG CpuUsage)
 
NTSTATUS NdisQueryPciBusInterface (IN PLOGICAL_ADAPTER Adapter)
 

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 39 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   'SIDN'

Definition at line 29 of file ndissys.h.

◆ NDIS_VERSION

#define NDIS_VERSION   0x00050001

Definition at line 27 of file ndissys.h.

◆ RTL_CONSTANT_LARGE_INTEGER

#define RTL_CONSTANT_LARGE_INTEGER (   quad_part)    {{(quad_part), (quad_part) >> 32}}

Definition at line 37 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:1187
struct _KTHREAD * IdleThread
Definition: ketypes.h:666
ULONG UserTime
Definition: ketypes.h:832
USHORT Number
Definition: ketypes.h:657
ULONG KernelTime
Definition: ketypes.h:831
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().

◆ NdisQueryPciBusInterface()

NTSTATUS NdisQueryPciBusInterface ( IN PLOGICAL_ADAPTER  Adapter)

Definition at line 19 of file hardware.c.

21{
24 PIRP Irp;
26 PIO_STACK_LOCATION IrpStack;
27
28 if (Adapter->BusInterfaceQueried)
29 return (Adapter->BusInterface.GetBusData != NULL) ? STATUS_SUCCESS : STATUS_NOT_SUPPORTED;
30
31 Adapter->BusInterfaceQueried = TRUE;
32
34
36 Adapter->NdisMiniportBlock.NextDeviceObject,
37 NULL,
38 0,
39 NULL,
40 &Event,
42 if (Irp == NULL)
44
46 IrpStack->MajorFunction = IRP_MJ_PNP;
48 IrpStack->Parameters.QueryInterface.InterfaceType = &GUID_BUS_INTERFACE_STANDARD;
49 IrpStack->Parameters.QueryInterface.Size = sizeof(Adapter->BusInterface);
51 IrpStack->Parameters.QueryInterface.Interface = (PINTERFACE)&Adapter->BusInterface;
52 IrpStack->Parameters.QueryInterface.InterfaceSpecificData = NULL;
53
54 Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
55
56 Status = IoCallDriver(Adapter->NdisMiniportBlock.NextDeviceObject, Irp);
58 {
61 }
62
63 if (!NT_SUCCESS(Status))
64 RtlZeroMemory(&Adapter->BusInterface, sizeof(Adapter->BusInterface));
65
66 return Status;
67}
LONG NTSTATUS
Definition: precomp.h:26
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_NOT_SUPPORTED
Definition: d3dkmdt.h:48
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
Status
Definition: gdiplustypes.h:24
#define KernelMode
Definition: asm.h:38
@ NotificationEvent
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:100
PIRP NTAPI IoBuildSynchronousFsdRequest(IN ULONG MajorFunction, IN PDEVICE_OBJECT DeviceObject, IN PVOID Buffer, IN ULONG Length, IN PLARGE_INTEGER StartingOffset, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
Definition: irp.c:1069
#define IoCallDriver
Definition: irp.c:1225
struct _INTERFACE * PINTERFACE
#define STATUS_SUCCESS
Definition: shellext.h:65
union _IO_STACK_LOCATION::@1709 Parameters
struct _IO_STACK_LOCATION::@4481::@4507 QueryInterface
#define STATUS_PENDING
Definition: telnetd.h:14
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2695
#define PCI_BUS_INTERFACE_STANDARD_VERSION
Definition: iotypes.h:5339
#define IRP_MN_QUERY_INTERFACE
@ Executive
Definition: ketypes.h:467

Referenced by NdisIPnPStartDevice().