ReactOS 0.4.15-dev-7942-gd23573b
PsNotify.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS kernel-mode tests
3 * LICENSE: GPLv2+ - See COPYING in the top level directory
4 * PURPOSE: Kernel-Mode Test Suite Process Notification Routines test
5 * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
6 */
7
8#include <kmt_test.h>
9
10//#define NDEBUG
11#include <debug.h>
12
13static
14VOID
17 IN HANDLE ParentId,
20{
21 ok_irql(PASSIVE_LEVEL);
22 if (!Create)
24 else
26 "ProcessId %p equals current\n", ProcessId);
27 DPRINT("%s(%p, %p, %d)\n", __FUNCTION__, ParentId, ProcessId, Create);
28}
29
30static
31VOID
33{
35
38
41
44
47
50
53
54 /* TODO: test whether the callback is notified on process creation */
55
58
61
62 /* TODO: register the same routine twice */
63 /* TODO: register more than the maximum number of notifications */
64}
65
66static
67VOID
71 IN HANDLE ThreadId,
73{
74 ok_irql(PASSIVE_LEVEL);
75 if (!Create)
76 {
79 }
80 else
81 {
82 ok(ThreadId != PsGetCurrentThreadId(),
83 "ThreadId %p equals current\n", ThreadId);
84 }
85 DPRINT("%s(%p, %p, %d)\n", __FUNCTION__, ProcessId, ThreadId, Create);
86}
87
88static
89VOID
91{
93
96
99
102
105
108
111
112 /* TODO: test whether the callback is notified on thread creation */
113
116
119
120 /* TODO: register the same routine twice */
121 /* TODO: register more than the maximum number of notifications */
122}
123
124static
125VOID
126NTAPI
128 IN PUNICODE_STRING FullImageName OPTIONAL,
130 IN PIMAGE_INFO ImageInfo)
131{
132 ok_irql(PASSIVE_LEVEL);
133 DPRINT("%s('%wZ', %p, %p)\n", __FUNCTION__, FullImageName, ProcessId, ImageInfo);
134}
135
136static
137VOID
139{
141
144
147
150
153
156
159
160 /* TODO: test whether the callback is notified on image load */
161
164
167
168 /* TODO: register the same routine twice */
169 /* TODO: register more than the maximum number of notifications */
170}
171
172START_TEST(PsNotify)
173{
177}
unsigned char BOOLEAN
static VOID TestLoadImageNotify(VOID)
Definition: PsNotify.c:138
static VOID TestCreateProcessNotify(VOID)
Definition: PsNotify.c:32
static VOID TestCreateThreadNotify(VOID)
Definition: PsNotify.c:90
static VOID NTAPI CreateProcessNotifyRoutine(IN HANDLE ParentId, IN HANDLE ProcessId, IN BOOLEAN Create)
Definition: PsNotify.c:16
static VOID NTAPI CreateThreadNotifyRoutine(IN HANDLE ProcessId, IN HANDLE ThreadId, IN BOOLEAN Create)
Definition: PsNotify.c:69
static VOID NTAPI LoadImageNotifyRoutine(IN PUNICODE_STRING FullImageName OPTIONAL, IN HANDLE ProcessId, IN PIMAGE_INFO ImageInfo)
Definition: PsNotify.c:127
#define ok_eq_pointer(value, expected)
Definition: apitest.h:59
#define ok_eq_hex(value, expected)
Definition: apitest.h:77
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
LONG NTSTATUS
Definition: precomp.h:26
@ Create
Definition: registry.c:563
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define __FUNCTION__
Definition: types.h:116
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2711
PsGetCurrentThreadId
Definition: CrNtStubs.h:8
Status
Definition: gdiplustypes.h:25
HANDLE NTAPI PsGetCurrentProcessId(VOID)
Definition: process.c:1123
#define STATUS_PROCEDURE_NOT_FOUND
Definition: ntstatus.h:358
NTSTATUS NTAPI PsSetLoadImageNotifyRoutine(IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine)
Definition: psnotify.c:176
NTSTATUS NTAPI PsSetCreateThreadNotifyRoutine(IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine)
Definition: psnotify.c:260
NTSTATUS NTAPI PsSetCreateProcessNotifyRoutine(IN PCREATE_PROCESS_NOTIFY_ROUTINE NotifyRoutine, IN BOOLEAN Remove)
Definition: psnotify.c:33
NTSTATUS NTAPI PsRemoveLoadImageNotifyRoutine(IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine)
Definition: psnotify.c:127
NTSTATUS NTAPI PsRemoveCreateThreadNotifyRoutine(IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine)
Definition: psnotify.c:211
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39