ReactOS  0.4.13-dev-479-gec9c8fd
lpcfuncs.h
Go to the documentation of this file.
1 /*++ NDK Version: 0098
2 
3 Copyright (c) Alex Ionescu. All rights reserved.
4 
5 Header Name:
6 
7  lpcfuncs.h
8 
9 Abstract:
10 
11  Function definitions for the Local Procedure Call.
12 
13 Author:
14 
15  Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
16 
17 --*/
18 
19 #ifndef _LPCFUNCS_H
20 #define _LPCFUNCS_H
21 
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #include <lpctypes.h>
27 
28 //
29 // LPC Exports
30 //
31 #ifndef NTOS_MODE_USER
34 NTAPI
36  _In_ PVOID Port,
37  _In_ PPORT_MESSAGE LpcMessageRequest,
38  _Out_ PPORT_MESSAGE LpcMessageReply
39 );
40 
42 NTAPI
44  _In_ PVOID Port,
45  _In_ PPORT_MESSAGE LpcMessage
46 );
47 #endif
48 
49 //
50 // Native calls
51 //
54 NTAPI
56  _Out_ PHANDLE PortHandle,
57  _In_opt_ PVOID PortContext,
58  _In_ PPORT_MESSAGE ConnectionRequest,
59  _In_ BOOLEAN AcceptConnection,
60  _Inout_opt_ PPORT_VIEW ServerView,
61  _Out_opt_ PREMOTE_PORT_VIEW ClientView
62 );
63 
66 NTAPI
68  _In_ HANDLE PortHandle
69 );
70 
73 NTAPI
75  _Out_ PHANDLE PortHandle,
78  _Inout_opt_ PPORT_VIEW ClientView,
79  _Inout_opt_ PREMOTE_PORT_VIEW ServerView,
80  _Out_opt_ PULONG MaxMessageLength,
81  _Inout_opt_ PVOID ConnectionInformation,
82  _Inout_opt_ PULONG ConnectionInformationLength
83 );
84 
87 NTAPI
89  _Out_ PHANDLE PortHandle,
91  _In_ ULONG MaxConnectionInfoLength,
92  _In_ ULONG MaxMessageLength,
93  _In_ ULONG MaxPoolUsage
94 );
95 
98 NTAPI
100  _Out_ PHANDLE PortHandle,
102  _In_ ULONG MaxConnectInfoLength,
103  _In_ ULONG MaxDataLength,
104  _In_opt_ ULONG NPMessageQueueSize
105 );
106 
108 NTSTATUS
109 NTAPI
111  _In_ HANDLE PortHandle,
112  _In_ PPORT_MESSAGE ClientMessage
113 );
114 
116 NTSTATUS
117 NTAPI
119  _In_ HANDLE PortHandle,
120  _In_ PPORT_MESSAGE ConnectionRequest
121 );
122 
124 NTSTATUS
125 NTAPI
127  _In_ HANDLE PortHandle,
132 );
133 
134 NTSTATUS
135 NTAPI
137  VOID
138 );
139 
141 NTSTATUS
142 NTAPI
144  _In_ HANDLE PortHandle,
146  _In_ ULONG Index,
150 );
151 
153 NTSTATUS
154 NTAPI
156  _In_ HANDLE PortHandle,
157  _In_ PPORT_MESSAGE LpcReply
158 );
159 
161 NTSTATUS
162 NTAPI
164  _In_ HANDLE PortHandle,
165  _Out_opt_ PVOID *PortContext,
167  _Out_ PPORT_MESSAGE ReceiveMessage
168 );
169 
171 NTSTATUS
172 NTAPI
174  _In_ HANDLE PortHandle,
175  _Out_opt_ PVOID *PortContext,
177  _Out_ PPORT_MESSAGE ReceiveMessage,
179 );
180 
182 NTSTATUS
183 NTAPI
185  _In_ HANDLE PortHandle,
187 );
188 
190 NTSTATUS
191 NTAPI
193  _In_ HANDLE PortHandle,
194  _In_ PPORT_MESSAGE LpcMessage
195 );
196 
198 NTSTATUS
199 NTAPI
201  _In_ HANDLE PortHandle,
202  _Out_ PPORT_MESSAGE LpcReply,
203  _In_ PPORT_MESSAGE LpcRequest
204 );
205 
207 NTSTATUS
208 NTAPI
210  _Out_ PHANDLE PortHandle,
213  _Inout_opt_ PPORT_VIEW ClientView,
214  _In_opt_ PSID ServerSid,
215  _Inout_opt_ PREMOTE_PORT_VIEW ServerView,
216  _Out_opt_ PULONG MaxMessageLength,
217  _Inout_opt_ PVOID ConnectionInformation,
218  _Inout_opt_ PULONG ConnectionInformationLength
219 );
220 
222 NTSTATUS
223 NTAPI
225  _In_ HANDLE PortHandle,
227  _In_ ULONG Index,
231 );
232 
233 NTSYSAPI
234 NTSTATUS
235 NTAPI
237  _Out_ PHANDLE PortHandle,
238  _In_opt_ PVOID PortContext,
239  _In_ PPORT_MESSAGE ConnectionRequest,
240  _In_ BOOLEAN AcceptConnection,
241  _In_opt_ PPORT_VIEW ServerView,
242  _In_opt_ PREMOTE_PORT_VIEW ClientView
243 );
244 
245 NTSYSAPI
246 NTSTATUS
247 NTAPI
249  _In_ HANDLE PortHandle
250 );
251 
252 NTSYSAPI
253 NTSTATUS
254 NTAPI
256  _Out_ PHANDLE PortHandle,
259  _In_opt_ PPORT_VIEW ClientView,
260  _In_opt_ PREMOTE_PORT_VIEW ServerView,
261  _In_opt_ PULONG MaxMessageLength,
262  _In_opt_ PVOID ConnectionInformation,
263  _In_opt_ PULONG ConnectionInformationLength
264 );
265 
266 NTSYSAPI
267 NTSTATUS
268 NTAPI
270  _Out_ PHANDLE PortHandle,
272  _In_ ULONG MaxConnectionInfoLength,
273  _In_ ULONG MaxMessageLength,
274  _In_ ULONG MaxPoolUsage
275 );
276 
277 NTSYSAPI
278 NTSTATUS
279 NTAPI
281  _Out_ PHANDLE PortHandle,
283  _In_ ULONG MaxConnectInfoLength,
284  _In_ ULONG MaxDataLength,
285  _In_opt_ ULONG NPMessageQueueSize
286 );
287 
288 NTSYSAPI
289 NTSTATUS
290 NTAPI
292  _In_ HANDLE PortHandle,
293  _In_ PPORT_MESSAGE ClientMessage
294 );
295 
296 NTSYSAPI
297 NTSTATUS
298 NTAPI
300  _In_ HANDLE PortHandle,
301  _In_ PPORT_MESSAGE ConnectionRequest
302 );
303 
304 NTSYSAPI
305 NTSTATUS
306 NTAPI
308  _In_ HANDLE PortHandle,
313 );
314 
315 NTSYSAPI
316 NTSTATUS
317 NTAPI
319  _In_ HANDLE PortHandle,
321  _In_ ULONG Index,
325 );
326 
327 NTSYSAPI
328 NTSTATUS
329 NTAPI
331  _In_ HANDLE PortHandle,
332  _In_ PPORT_MESSAGE LpcReply
333 );
334 
335 NTSYSAPI
336 NTSTATUS
337 NTAPI
339  _In_ HANDLE PortHandle,
340  _Out_opt_ PVOID *PortContext,
342  _Out_ PPORT_MESSAGE ReceiveMessage
343 );
344 
345 NTSYSAPI
346 NTSTATUS
347 NTAPI
349  _In_ HANDLE PortHandle,
350  _Out_opt_ PVOID *PortContext,
352  _Out_ PPORT_MESSAGE ReceiveMessage,
354 );
355 
356 NTSYSAPI
357 NTSTATUS
358 NTAPI
360  _In_ HANDLE PortHandle,
362 );
363 
364 NTSYSAPI
365 NTSTATUS
366 NTAPI
368  _In_ HANDLE PortHandle,
369  _In_ PPORT_MESSAGE LpcMessage
370 );
371 
372 NTSYSAPI
373 NTSTATUS
374 NTAPI
376  _In_ HANDLE PortHandle,
377  _Out_ PPORT_MESSAGE LpcReply,
378  _In_ PPORT_MESSAGE LpcRequest
379 );
380 
381 NTSYSAPI
382 NTSTATUS
383 NTAPI
385  _Out_ PHANDLE PortHandle,
388  _Inout_opt_ PPORT_VIEW ClientView,
389  _In_opt_ PSID Sid,
390  _Inout_opt_ PREMOTE_PORT_VIEW ServerView,
391  _Out_opt_ PULONG MaxMessageLength,
392  _Inout_opt_ PVOID ConnectionInformation,
393  _Inout_opt_ PULONG ConnectionInformationLength
394 );
395 
396 NTSYSAPI
397 NTSTATUS
398 NTAPI
400  _In_ HANDLE PortHandle,
402  _In_ ULONG Index,
406 );
407 
408 #endif
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
CPPORT Port[4]
Definition: headless.c:34
NTSYSAPI NTSTATUS NTAPI ZwReplyWaitReplyPort(_In_ HANDLE PortHandle, _Out_ PPORT_MESSAGE ReplyMessage)
NTSYSAPI NTSTATUS NTAPI ZwListenPort(_In_ HANDLE PortHandle, _In_ PPORT_MESSAGE ConnectionRequest)
NTSYSCALLAPI NTSTATUS NTAPI NtCreatePort(_Out_ PHANDLE PortHandle, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _In_ ULONG MaxConnectionInfoLength, _In_ ULONG MaxMessageLength, _In_ ULONG MaxPoolUsage)
NTSYSAPI NTSTATUS NTAPI ZwCreateWaitablePort(_Out_ PHANDLE PortHandle, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _In_ ULONG MaxConnectInfoLength, _In_ ULONG MaxDataLength, _In_opt_ ULONG NPMessageQueueSize)
NTSYSAPI NTSTATUS NTAPI ZwCompleteConnectPort(_In_ HANDLE PortHandle)
NTSYSAPI NTSTATUS NTAPI ZwReplyWaitReceivePortEx(_In_ HANDLE PortHandle, _Out_opt_ PVOID *PortContext, _In_opt_ PPORT_MESSAGE ReplyMessage, _Out_ PPORT_MESSAGE ReceiveMessage, _In_opt_ PLARGE_INTEGER Timeout)
NTSYSAPI NTSTATUS NTAPI ZwAcceptConnectPort(_Out_ PHANDLE PortHandle, _In_opt_ PVOID PortContext, _In_ PPORT_MESSAGE ConnectionRequest, _In_ BOOLEAN AcceptConnection, _In_opt_ PPORT_VIEW ServerView, _In_opt_ PREMOTE_PORT_VIEW ClientView)
NTSYSCALLAPI NTSTATUS NTAPI NtCompleteConnectPort(_In_ HANDLE PortHandle)
LONG NTSTATUS
Definition: precomp.h:26
IN CINT OUT PVOID PortInformation
Definition: dumpinfo.c:39
NTSYSCALLAPI NTSTATUS NTAPI NtRequestWaitReplyPort(_In_ HANDLE PortHandle, _Out_ PPORT_MESSAGE LpcReply, _In_ PPORT_MESSAGE LpcRequest)
NTSYSCALLAPI NTSTATUS NTAPI NtListenPort(_In_ HANDLE PortHandle, _In_ PPORT_MESSAGE ConnectionRequest)
#define NTSYSCALLAPI
Definition: ntbasedef.h:204
NTKERNELAPI NTSTATUS NTAPI LpcRequestWaitReplyPort(_In_ PVOID Port, _In_ PPORT_MESSAGE LpcMessageRequest, _Out_ PPORT_MESSAGE LpcMessageReply)
NTSYSCALLAPI NTSTATUS NTAPI NtAcceptConnectPort(_Out_ PHANDLE PortHandle, _In_opt_ PVOID PortContext, _In_ PPORT_MESSAGE ConnectionRequest, _In_ BOOLEAN AcceptConnection, _Inout_opt_ PPORT_VIEW ServerView, _Out_opt_ PREMOTE_PORT_VIEW ClientView)
#define NTSYSAPI
Definition: ntoskrnl.h:14
NTSYSCALLAPI NTSTATUS NTAPI NtConnectPort(_Out_ PHANDLE PortHandle, _In_ PUNICODE_STRING PortName, _In_ PSECURITY_QUALITY_OF_SERVICE SecurityQos, _Inout_opt_ PPORT_VIEW ClientView, _Inout_opt_ PREMOTE_PORT_VIEW ServerView, _Out_opt_ PULONG MaxMessageLength, _Inout_opt_ PVOID ConnectionInformation, _Inout_opt_ PULONG ConnectionInformationLength)
#define _In_opt_
Definition: no_sal2.h:213
IN CINT OUT PVOID IN ULONG PortInformationLength
Definition: dumpinfo.c:39
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
NTSYSCALLAPI NTSTATUS NTAPI NtReadRequestData(_In_ HANDLE PortHandle, _In_ PPORT_MESSAGE Message, _In_ ULONG Index, _Out_bytecap_(BufferLength) PVOID Buffer, _In_ ULONG BufferLength, _Out_ PULONG ReturnLength)
_In_ ULONG BufferLength
Definition: usbdlib.h:225
unsigned char BOOLEAN
NTSYSAPI NTSTATUS NTAPI ZwRequestWaitReplyPort(_In_ HANDLE PortHandle, _Out_ PPORT_MESSAGE LpcReply, _In_ PPORT_MESSAGE LpcRequest)
#define _Out_
Definition: no_sal2.h:323
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1104
#define NTKERNELAPI
Definition: bufpool.h:45
BOOL WINAPI ReplyMessage(_In_ LRESULT)
NTSTATUS NTAPI NtQueryPortInformationProcess(VOID)
Definition: port.c:277
NTSYSAPI NTSTATUS NTAPI ZwRequestPort(_In_ HANDLE PortHandle, _In_ PPORT_MESSAGE LpcMessage)
NTSYSAPI NTSTATUS NTAPI ZwConnectPort(_Out_ PHANDLE PortHandle, _In_ PUNICODE_STRING PortName, _In_ PSECURITY_QUALITY_OF_SERVICE SecurityQos, _In_opt_ PPORT_VIEW ClientView, _In_opt_ PREMOTE_PORT_VIEW ServerView, _In_opt_ PULONG MaxMessageLength, _In_opt_ PVOID ConnectionInformation, _In_opt_ PULONG ConnectionInformationLength)
#define _Out_opt_
Definition: no_sal2.h:339
NTSYSCALLAPI NTSTATUS NTAPI NtReplyWaitReceivePortEx(_In_ HANDLE PortHandle, _Out_opt_ PVOID *PortContext, _In_opt_ PPORT_MESSAGE ReplyMessage, _Out_ PPORT_MESSAGE ReceiveMessage, _In_opt_ PLARGE_INTEGER Timeout)
static const UCHAR Index[8]
Definition: usbohci.c:18
CHAR Message[80]
Definition: alive.c:5
NTSYSAPI NTSTATUS NTAPI ZwImpersonateClientOfPort(_In_ HANDLE PortHandle, _In_ PPORT_MESSAGE ClientMessage)
enum _PORT_INFORMATION_CLASS PORT_INFORMATION_CLASS
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
NTSYSCALLAPI NTSTATUS NTAPI NtWriteRequestData(_In_ HANDLE PortHandle, _In_ PPORT_MESSAGE Message, _In_ ULONG Index, _In_bytecount_(BufferLength) PVOID Buffer, _In_ ULONG BufferLength, _Out_ PULONG ReturnLength)
NTSYSAPI NTSTATUS NTAPI ZwReplyWaitReceivePort(_In_ HANDLE PortHandle, _Out_opt_ PVOID *PortContext, _In_opt_ PPORT_MESSAGE ReplyMessage, _Out_ PPORT_MESSAGE ReceiveMessage)
NTSYSCALLAPI NTSTATUS NTAPI NtReplyWaitReceivePort(_In_ HANDLE PortHandle, _Out_opt_ PVOID *PortContext, _In_opt_ PPORT_MESSAGE ReplyMessage, _Out_ PPORT_MESSAGE ReceiveMessage)
#define _In_
Definition: no_sal2.h:204
NTSYSCALLAPI NTSTATUS NTAPI NtImpersonateClientOfPort(_In_ HANDLE PortHandle, _In_ PPORT_MESSAGE ClientMessage)
static ULONG Timeout
Definition: ping.c:61
NTSYSCALLAPI NTSTATUS NTAPI NtRequestPort(_In_ HANDLE PortHandle, _In_ PPORT_MESSAGE LpcMessage)
unsigned int * PULONG
Definition: retypes.h:1
NTSYSAPI NTSTATUS NTAPI ZwQueryInformationPort(_In_ HANDLE PortHandle, _In_ PORT_INFORMATION_CLASS PortInformationClass, _Out_bytecap_(PortInformationLength) PVOID PortInformation, _In_ ULONG PortInformationLength, _Out_ PULONG ReturnLength)
NTSTATUS NTAPI LpcRequestPort(_In_ PVOID Port, _In_ PPORT_MESSAGE LpcMessage)
NTSYSAPI NTSTATUS NTAPI ZwReadRequestData(_In_ HANDLE PortHandle, _In_ PPORT_MESSAGE Message, _In_ ULONG Index, _Out_bytecap_(BufferLength) PVOID Buffer, _In_ ULONG BufferLength, _Out_ PULONG ReturnLength)
NTSYSCALLAPI NTSTATUS NTAPI NtSecureConnectPort(_Out_ PHANDLE PortHandle, _In_ PUNICODE_STRING PortName, _In_ PSECURITY_QUALITY_OF_SERVICE SecurityQos, _Inout_opt_ PPORT_VIEW ClientView, _In_opt_ PSID ServerSid, _Inout_opt_ PREMOTE_PORT_VIEW ServerView, _Out_opt_ PULONG MaxMessageLength, _Inout_opt_ PVOID ConnectionInformation, _Inout_opt_ PULONG ConnectionInformationLength)
NTSYSAPI NTSTATUS NTAPI ZwWriteRequestData(_In_ HANDLE PortHandle, _In_ PPORT_MESSAGE Message, _In_ ULONG Index, _In_bytecount_(BufferLength) PVOID Buffer, _In_ ULONG BufferLength, _Out_ PULONG ReturnLength)
NTSYSCALLAPI NTSTATUS NTAPI NtReplyWaitReplyPort(_In_ HANDLE PortHandle, _Out_ PPORT_MESSAGE ReplyMessage)
NTSYSAPI NTSTATUS NTAPI ZwSecureConnectPort(_Out_ PHANDLE PortHandle, _In_ PUNICODE_STRING PortName, _In_ PSECURITY_QUALITY_OF_SERVICE SecurityQos, _Inout_opt_ PPORT_VIEW ClientView, _In_opt_ PSID Sid, _Inout_opt_ PREMOTE_PORT_VIEW ServerView, _Out_opt_ PULONG MaxMessageLength, _Inout_opt_ PVOID ConnectionInformation, _Inout_opt_ PULONG ConnectionInformationLength)
#define _Out_bytecap_(size)
Definition: no_sal2.h:325
NTSYSCALLAPI NTSTATUS NTAPI NtReplyPort(_In_ HANDLE PortHandle, _In_ PPORT_MESSAGE LpcReply)
NTSYSCALLAPI NTSTATUS NTAPI NtCreateWaitablePort(_Out_ PHANDLE PortHandle, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _In_ ULONG MaxConnectInfoLength, _In_ ULONG MaxDataLength, _In_opt_ ULONG NPMessageQueueSize)
NTSYSAPI NTSTATUS NTAPI ZwReplyPort(_In_ HANDLE PortHandle, _In_ PPORT_MESSAGE LpcReply)
unsigned int ULONG
Definition: retypes.h:1
_In_ ULONG _In_ ULONG _In_bytecount_(cjIn) PVOID pvIn
Definition: winddi.h:3582
NTSYSAPI NTSTATUS NTAPI ZwCreatePort(_Out_ PHANDLE PortHandle, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _In_ ULONG MaxConnectionInfoLength, _In_ ULONG MaxMessageLength, _In_ ULONG MaxPoolUsage)
IN CINT PortInformationClass
Definition: dumpinfo.c:39
#define _Inout_opt_
Definition: no_sal2.h:258
IN PUNICODE_STRING PortName
Definition: conport.c:35
NTSYSCALLAPI NTSTATUS NTAPI NtQueryInformationPort(_In_ HANDLE PortHandle, _In_ PORT_INFORMATION_CLASS PortInformationClass, _Out_bytecap_(PortInformationLength) PVOID PortInformation, _In_ ULONG PortInformationLength, _Out_ PULONG ReturnLength)