ReactOS 0.4.15-dev-7906-g1b85a5f
PsNotify.c File Reference
#include <kmt_test.h>
#include <debug.h>
Include dependency graph for PsNotify.c:

Go to the source code of this file.

Functions

static VOID NTAPI CreateProcessNotifyRoutine (IN HANDLE ParentId, IN HANDLE ProcessId, IN BOOLEAN Create)
 
static VOID TestCreateProcessNotify (VOID)
 
static VOID NTAPI CreateThreadNotifyRoutine (IN HANDLE ProcessId, IN HANDLE ThreadId, IN BOOLEAN Create)
 
static VOID TestCreateThreadNotify (VOID)
 
static VOID NTAPI LoadImageNotifyRoutine (IN PUNICODE_STRING FullImageName OPTIONAL, IN HANDLE ProcessId, IN PIMAGE_INFO ImageInfo)
 
static VOID TestLoadImageNotify (VOID)
 
 START_TEST (PsNotify)
 

Function Documentation

◆ CreateProcessNotifyRoutine()

static VOID NTAPI CreateProcessNotifyRoutine ( IN HANDLE  ParentId,
IN HANDLE  ProcessId,
IN BOOLEAN  Create 
)
static

Definition at line 16 of file PsNotify.c.

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}
#define ok_eq_pointer(value, expected)
Definition: apitest.h:59
#define ok(value,...)
Definition: atltest.h:57
@ Create
Definition: registry.c:563
#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
HANDLE NTAPI PsGetCurrentProcessId(VOID)
Definition: process.c:1123
#define DPRINT
Definition: sndvol32.h:71

Referenced by TestCreateProcessNotify().

◆ CreateThreadNotifyRoutine()

static VOID NTAPI CreateThreadNotifyRoutine ( IN HANDLE  ProcessId,
IN HANDLE  ThreadId,
IN BOOLEAN  Create 
)
static

Definition at line 69 of file PsNotify.c.

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}
PsGetCurrentThreadId
Definition: CrNtStubs.h:8

Referenced by TestCreateThreadNotify().

◆ LoadImageNotifyRoutine()

static VOID NTAPI LoadImageNotifyRoutine ( IN PUNICODE_STRING FullImageName  OPTIONAL,
IN HANDLE  ProcessId,
IN PIMAGE_INFO  ImageInfo 
)
static

Definition at line 127 of file PsNotify.c.

131{
132 ok_irql(PASSIVE_LEVEL);
133 DPRINT("%s('%wZ', %p, %p)\n", __FUNCTION__, FullImageName, ProcessId, ImageInfo);
134}

Referenced by TestLoadImageNotify().

◆ START_TEST()

START_TEST ( PsNotify  )

Definition at line 172 of file PsNotify.c.

173{
177}
static VOID TestLoadImageNotify(VOID)
Definition: PsNotify.c:138
static VOID TestCreateProcessNotify(VOID)
Definition: PsNotify.c:32
static VOID TestCreateThreadNotify(VOID)
Definition: PsNotify.c:90

◆ TestCreateProcessNotify()

static VOID TestCreateProcessNotify ( VOID  )
static

Definition at line 32 of file PsNotify.c.

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}
static VOID NTAPI CreateProcessNotifyRoutine(IN HANDLE ParentId, IN HANDLE ProcessId, IN BOOLEAN Create)
Definition: PsNotify.c:16
#define ok_eq_hex(value, expected)
Definition: apitest.h:77
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
Status
Definition: gdiplustypes.h:25
#define STATUS_PROCEDURE_NOT_FOUND
Definition: ntstatus.h:358
NTSTATUS NTAPI PsSetCreateProcessNotifyRoutine(IN PCREATE_PROCESS_NOTIFY_ROUTINE NotifyRoutine, IN BOOLEAN Remove)
Definition: psnotify.c:33
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by START_TEST().

◆ TestCreateThreadNotify()

static VOID TestCreateThreadNotify ( VOID  )
static

Definition at line 90 of file PsNotify.c.

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}
static VOID NTAPI CreateThreadNotifyRoutine(IN HANDLE ProcessId, IN HANDLE ThreadId, IN BOOLEAN Create)
Definition: PsNotify.c:69
NTSTATUS NTAPI PsSetCreateThreadNotifyRoutine(IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine)
Definition: psnotify.c:260
NTSTATUS NTAPI PsRemoveCreateThreadNotifyRoutine(IN PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine)
Definition: psnotify.c:211

Referenced by START_TEST().

◆ TestLoadImageNotify()

static VOID TestLoadImageNotify ( VOID  )
static

Definition at line 138 of file PsNotify.c.

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}
static VOID NTAPI LoadImageNotifyRoutine(IN PUNICODE_STRING FullImageName OPTIONAL, IN HANDLE ProcessId, IN PIMAGE_INFO ImageInfo)
Definition: PsNotify.c:127
NTSTATUS NTAPI PsSetLoadImageNotifyRoutine(IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine)
Definition: psnotify.c:176
NTSTATUS NTAPI PsRemoveLoadImageNotifyRoutine(IN PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine)
Definition: psnotify.c:127

Referenced by START_TEST().