Process Hacker
phsvc.h
Go to the documentation of this file.
1 #ifndef PH_PHSVC_H
2 #define PH_PHSVC_H
3 
4 #include <phsvcapi.h>
5 
6 #define PHSVC_SHARED_SECTION_SIZE (512 * 1024)
7 
8 // svcmain
9 
10 typedef struct _PHSVC_STOP
11 {
12  BOOLEAN Stop;
13  HANDLE Event1;
14  HANDLE Event2;
16 
17 NTSTATUS PhSvcMain(
18  _In_opt_ PUNICODE_STRING PortName,
19  _In_opt_ PLARGE_INTEGER Timeout,
20  _Inout_opt_ PPHSVC_STOP Stop
21  );
22 
24  _Inout_ PPHSVC_STOP Stop
25  );
26 
27 // svcclient
28 
29 typedef struct _PHSVC_CLIENT
30 {
31  LIST_ENTRY ListEntry;
32 
35  HANDLE PortHandle;
39 
41  VOID
42  );
43 
44 PPHSVC_CLIENT PhSvcCreateClient(
45  _In_opt_ PCLIENT_ID ClientId
46  );
47 
48 PPHSVC_CLIENT PhSvcReferenceClientByClientId(
49  _In_ PCLIENT_ID ClientId
50  );
51 
52 PPHSVC_CLIENT PhSvcGetCurrentClient(
53  VOID
54  );
55 
56 BOOLEAN PhSvcAttachClient(
57  _In_ PPHSVC_CLIENT Client
58  );
59 
61  _In_ PPHSVC_CLIENT Client
62  );
63 
64 // svcapiport
65 
66 typedef struct _PHSVC_THREAD_CONTEXT
67 {
68  PPHSVC_CLIENT CurrentClient;
69  PPHSVC_CLIENT OldClient;
71 
73  _In_ PUNICODE_STRING PortName
74  );
75 
76 PPHSVC_THREAD_CONTEXT PhSvcGetCurrentThreadContext(
77  VOID
78  );
79 
81  _In_ PPORT_MESSAGE PortMessage
82  );
83 
84 // svcapi
85 
86 NTSTATUS PhSvcApiInitialization(
87  VOID
88  );
89 
90 typedef NTSTATUS (NTAPI *PPHSVC_API_PROCEDURE)(
91  _In_ PPHSVC_CLIENT Client,
92  _Inout_ PPHSVC_API_PAYLOAD Payload
93  );
94 
96  _In_ PPHSVC_CLIENT Client,
97  _Inout_ PPHSVC_API_PAYLOAD Payload,
98  _Out_ PHANDLE ReplyPortHandle
99  );
100 
101 PVOID PhSvcValidateString(
102  _In_ PPH_RELATIVE_STRINGREF String,
103  _In_ ULONG Alignment
104  );
105 
106 NTSTATUS PhSvcProbeBuffer(
107  _In_ PPH_RELATIVE_STRINGREF String,
108  _In_ ULONG Alignment,
109  _In_ BOOLEAN AllowNull,
110  _Out_ PVOID *Pointer
111  );
112 
113 NTSTATUS PhSvcCaptureBuffer(
114  _In_ PPH_RELATIVE_STRINGREF String,
115  _In_ BOOLEAN AllowNull,
116  _Out_ PVOID *CapturedBuffer
117  );
118 
119 NTSTATUS PhSvcCaptureString(
120  _In_ PPH_RELATIVE_STRINGREF String,
121  _In_ BOOLEAN AllowNull,
122  _Out_ PPH_STRING *CapturedString
123  );
124 
125 NTSTATUS PhSvcCaptureSid(
126  _In_ PPH_RELATIVE_STRINGREF String,
127  _In_ BOOLEAN AllowNull,
128  _Out_ PSID *CapturedSid
129  );
130 
132  _In_ PPH_RELATIVE_STRINGREF String,
133  _In_ BOOLEAN AllowNull,
134  _In_ SECURITY_INFORMATION RequiredInformation,
135  _Out_ PSECURITY_DESCRIPTOR *CapturedSecurityDescriptor
136  );
137 
138 NTSTATUS PhSvcApiDefault(
139  _In_ PPHSVC_CLIENT Client,
140  _Inout_ PPHSVC_API_PAYLOAD Payload
141  );
142 
143 NTSTATUS PhSvcApiPlugin(
144  _In_ PPHSVC_CLIENT Client,
145  _Inout_ PPHSVC_API_PAYLOAD Payload
146  );
147 
149  _In_ PPHSVC_CLIENT Client,
150  _Inout_ PPHSVC_API_PAYLOAD Payload
151  );
152 
153 NTSTATUS PhSvcApiUnloadDriver(
154  _In_ PPHSVC_CLIENT Client,
155  _Inout_ PPHSVC_API_PAYLOAD Payload
156  );
157 
158 NTSTATUS PhSvcApiControlProcess(
159  _In_ PPHSVC_CLIENT Client,
160  _Inout_ PPHSVC_API_PAYLOAD Payload
161  );
162 
163 NTSTATUS PhSvcApiControlService(
164  _In_ PPHSVC_CLIENT Client,
165  _Inout_ PPHSVC_API_PAYLOAD Payload
166  );
167 
168 NTSTATUS PhSvcApiCreateService(
169  _In_ PPHSVC_CLIENT Client,
170  _Inout_ PPHSVC_API_PAYLOAD Payload
171  );
172 
174  _In_ PPHSVC_CLIENT Client,
175  _Inout_ PPHSVC_API_PAYLOAD Payload
176  );
177 
179  _In_ PPHSVC_CLIENT Client,
180  _Inout_ PPHSVC_API_PAYLOAD Payload
181  );
182 
183 NTSTATUS PhSvcApiSetTcpEntry(
184  _In_ PPHSVC_CLIENT Client,
185  _Inout_ PPHSVC_API_PAYLOAD Payload
186  );
187 
188 NTSTATUS PhSvcApiControlThread(
189  _In_ PPHSVC_CLIENT Client,
190  _Inout_ PPHSVC_API_PAYLOAD Payload
191  );
192 
193 NTSTATUS PhSvcApiAddAccountRight(
194  _In_ PPHSVC_CLIENT Client,
195  _Inout_ PPHSVC_API_PAYLOAD Payload
196  );
197 
199  _In_ PPHSVC_CLIENT Client,
200  _Inout_ PPHSVC_API_PAYLOAD Payload
201  );
202 
204  _In_ PPHSVC_CLIENT Client,
205  _Inout_ PPHSVC_API_PAYLOAD Payload
206  );
207 
208 NTSTATUS PhSvcApiPostMessage(
209  _In_ PPHSVC_CLIENT Client,
210  _Inout_ PPHSVC_API_PAYLOAD Payload
211  );
212 
213 NTSTATUS PhSvcApiSendMessage(
214  _In_ PPHSVC_CLIENT Client,
215  _Inout_ PPHSVC_API_PAYLOAD Payload
216  );
217 
219  _In_ PPHSVC_CLIENT Client,
220  _Inout_ PPHSVC_API_PAYLOAD Payload
221  );
222 
224  _In_ PPHSVC_CLIENT Client,
225  _Inout_ PPHSVC_API_PAYLOAD Payload
226  );
227 
228 NTSTATUS PhSvcApiLoadDbgHelp(
229  _In_ PPHSVC_CLIENT Client,
230  _Inout_ PPHSVC_API_PAYLOAD Payload
231  );
232 
234  _In_ PPHSVC_CLIENT Client,
235  _Inout_ PPHSVC_API_PAYLOAD Payload
236  );
237 
238 #endif