-
Notifications
You must be signed in to change notification settings - Fork 0
/
Process.h
77 lines (62 loc) · 1.21 KB
/
Process.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#pragma once
#include "WdmDriver.h"
#include "Public.h"
#include "ListOp.h"
typedef struct _PROCESS_T
{
PROC_INFO Info; // PPID, PID and Create
PMDL Mdl; // Memory descriptor list
PVOID SystemVA; // System Address Space
LIST_ENTRY ListEntry;
}PROCESS_T, *PPROCESS_T;
PPROCESS_T
PrcAlloc(
_In_ HANDLE ParentId,
_In_ HANDLE ProcessId,
_In_ BOOLEAN Create
);
VOID
PrcFree(
_Inout_ PPROCESS_T Process
);
/* Synq */
VOID
PrcInsertProcess(
_Inout_ PLIST_T List,
_Inout_ PPROCESS_T Process
);
//
// Removes PID from PROCESS_T list
//
// return:
// - NULL - not found (or head?)
// - valid pointer to PROCESS_T that was removed from list (free pointer)
PPROCESS_T
PrcRemoveProcessId(
_Inout_ PLIST_T List,
_In_opt_ PHANDLE ParentId,
_In_ PHANDLE ProcessId
);
//
// Find Pid in PROCESS_T list
//
// returns:
// - NULL - not found
// - valid ptr
PPROCESS_T
PrcFindProcessId(
_In_ PLIST_T List,
_In_ HANDLE ProcessId
);
VOID
PrcFreeList(
_Inout_ PLIST_T List
);
PPROCESS_T
PrcRemoveHeadProcess(
_Inout_ PLIST_T List
);
VOID
PrcUnlockMdlList(
_Inout_ PLIST_T List
);