ReactOS 0.4.15-dev-8093-g3285f69
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)
Definition: Header.h:9
_Out_ PKIRQL Irql
Definition: csq.h:179
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
#define for
Definition: utility.h:88
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
BOOLEAN NTAPI KeReadStateTimer(IN PKTIMER Timer)
Definition: timerobj.c:269
int32_t INT
Definition: typedefs.h:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59

Definition at line 10 of file KeTimer.c.

Function Documentation

◆ START_TEST()

START_TEST ( KeTimer  )

Definition at line 50 of file KeTimer.c.

51{
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}
static VOID TestTimerFunctional(IN PKTIMER Timer, IN TIMER_TYPE Type, IN KIRQL OriginalIrql)
Definition: KeTimer.c:38
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
#define APC_LEVEL
Definition: env_spec_w32.h:695
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
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
VOID KmtSetIrql(IN KIRQL NewIrql)
BOOLEAN KmtIsCheckedBuild
@ SynchronizationTimer
@ NotificationTimer

◆ 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}
#define CheckTimer(Timer, ExpectedType, State, ExpectedWaitNext, Irql, ThreadList, ThreadCount)
Definition: KeTimer.c:10
Type
Definition: Type.h:7
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define KeGetCurrentThread
Definition: hal.h:55
@ TimerNotificationObject
Definition: ketypes.h:414
#define L(x)
Definition: ntvdm.h:50
#define memset(x, y, z)
Definition: compat.h:39
VOID NTAPI KeInitializeTimerEx(OUT PKTIMER Timer, IN TIMER_TYPE Type)
Definition: timerobj.c:244

Referenced by START_TEST().