ReactOS  0.4.14-dev-583-g2a1ba2c
KeTimer.c File Reference
#include <kmt_test.h>
Include dependency graph for KeTimer.c:

Go to the source code of this file.

Macros

#define CheckTimer(Timer, ExpectedType, State, ExpectedWaitNext, Irql, ThreadList, ThreadCount)
 

Functions

static VOID TestTimerFunctional (IN PKTIMER Timer, IN TIMER_TYPE Type, IN KIRQL OriginalIrql)
 
 START_TEST (KeTimer)
 

Macro Definition Documentation

◆ CheckTimer

#define CheckTimer (   Timer,
  ExpectedType,
  State,
  ExpectedWaitNext,
  Irql,
  ThreadList,
  ThreadCount 
)
Value:
do \
{ \
INT TheIndex; \
PLIST_ENTRY TheEntry; \
PKTHREAD TheThread; \
ok_eq_uint((Timer)->Header.Type, ExpectedType); \
ok_eq_uint((Timer)->Header.Hand, sizeof *(Timer) / sizeof(ULONG)); \
ok_eq_hex((Timer)->Header.Lock & 0xFF00FF00L, 0x00005500L); \
ok_eq_long((Timer)->Header.SignalState, State); \
TheEntry = (Timer)->Header.WaitListHead.Flink; \
for (TheIndex = 0; TheIndex < (ThreadCount); ++TheIndex) \
{ \
TheThread = CONTAINING_RECORD(TheEntry, KTHREAD, \
WaitBlock[0].WaitListEntry); \
ok_eq_pointer(TheThread, (ThreadList)[TheIndex]); \
ok_eq_pointer(TheEntry->Flink->Blink, TheEntry); \
TheEntry = TheEntry->Flink; \
} \
ok_eq_pointer(TheEntry, &(Timer)->Header.WaitListHead); \
ok_eq_pointer(TheEntry->Flink->Blink, TheEntry); \
ok_eq_long(KeReadStateTimer(Timer), State); \
ok_eq_bool(Thread->WaitNext, ExpectedWaitNext); \
ok_irql(Irql); \
} while (0)
BOOLEAN NTAPI KeReadStateTimer(IN PKTIMER Timer)
Definition: timerobj.c:269
_Out_ PKIRQL Irql
Definition: csq.h:179
Definition: Header.h:8
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define for
Definition: utility.h:88
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
UINT Timer
Definition: capclock.c:11
unsigned int ULONG
Definition: retypes.h:1

Definition at line 10 of file KeTimer.c.

Function Documentation

◆ START_TEST()

START_TEST ( KeTimer  )

Definition at line 50 of file KeTimer.c.

51 {
52  KTIMER Timer;
53  KIRQL Irql;
55  INT i;
56 
57  for (i = 0; i < sizeof Irqls / sizeof Irqls[0]; ++i)
58  {
59  /* DRIVER_IRQL_NOT_LESS_OR_EQUAL (TODO: on MP only?) */
60  if (Irqls[i] > DISPATCH_LEVEL && KmtIsCheckedBuild)
61  return;
62  KeRaiseIrql(Irqls[i], &Irql);
66  }
67 
68  ok_irql(PASSIVE_LEVEL);
70 }
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
_Out_ PKIRQL Irql
Definition: csq.h:179
int32_t INT
Definition: typedefs.h:56
UCHAR KIRQL
Definition: env_spec_w32.h:591
BOOLEAN KmtIsCheckedBuild
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static VOID TestTimerFunctional(IN PKTIMER Timer, IN TIMER_TYPE Type, IN KIRQL OriginalIrql)
Definition: KeTimer.c:38
VOID KmtSetIrql(IN KIRQL NewIrql)
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
UINT Timer
Definition: capclock.c:11
#define APC_LEVEL
Definition: env_spec_w32.h:695

◆ TestTimerFunctional()

static VOID TestTimerFunctional ( IN PKTIMER  Timer,
IN TIMER_TYPE  Type,
IN KIRQL  OriginalIrql 
)
static

Definition at line 38 of file KeTimer.c.

42 {
44 
45  memset(Timer, 0x55, sizeof *Timer);
47  CheckTimer(Timer, TimerNotificationObject + Type, 0L, FALSE, OriginalIrql, (PVOID *)NULL, 0);
48 }
Type
Definition: Type.h:6
smooth NULL
Definition: ftsmooth.c:416
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
static const WCHAR L[]
Definition: oid.c:1250
#define KeGetCurrentThread
Definition: hal.h:44
#define memset(x, y, z)
Definition: compat.h:39
#define CheckTimer(Timer, ExpectedType, State, ExpectedWaitNext, Irql, ThreadList, ThreadCount)
Definition: KeTimer.c:10
VOID NTAPI KeInitializeTimerEx(OUT PKTIMER Timer, IN TIMER_TYPE Type)
Definition: timerobj.c:244

Referenced by START_TEST().