2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/include/lpc.h
5 * PURPOSE: Internal header for the Local Procedure Call
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
10 // Define this if you want debugging support
12 #define _LPC_DEBUG_ 0x01
15 // These define the Debug Masks Supported
17 #define LPC_CREATE_DEBUG 0x01
18 #define LPC_CLOSE_DEBUG 0x02
19 #define LPC_CONNECT_DEBUG 0x04
20 #define LPC_LISTEN_DEBUG 0x08
21 #define LPC_REPLY_DEBUG 0x10
22 #define LPC_COMPLETE_DEBUG 0x20
23 #define LPC_SEND_DEBUG 0x40
26 // Debug/Tracing support
29 #ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented
30 #define LPCTRACE(x, ...) \
32 DbgPrintEx("%s [%.16s] - ", \
34 PsGetCurrentProcess()->ImageFileName); \
35 DbgPrintEx(__VA_ARGS__); \
38 #define LPCTRACE(x, ...) \
39 if (x & LpcpTraceLevel) \
41 DbgPrint("%s [%.16s:%lx] - ", \
43 PsGetCurrentProcess()->ImageFileName, \
44 PsGetCurrentThreadId()); \
45 DbgPrint(__VA_ARGS__); \
51 // LPC Port/Message Flags
53 #define LPCP_THREAD_FLAG_IS_PORT 1
54 #define LPCP_THREAD_FLAG_NO_IMPERSONATION 2
55 #define LPCP_THREAD_FLAGS (LPCP_THREAD_FLAG_IS_PORT | \
56 LPCP_THREAD_FLAG_NO_IMPERSONATION)
59 // Internal Port Management
64 IN PEPROCESS Process OPTIONAL
,
66 IN ACCESS_MASK GrantedAccess
,
67 IN ULONG ProcessHandleCount
,
68 IN ULONG SystemHandleCount
79 LpcpInitializePortQueue(
80 IN PLPCP_PORT_OBJECT Port
86 IN PLPCP_MESSAGE Message
,
93 IN PPORT_MESSAGE Destination
,
94 IN PPORT_MESSAGE Origin
,
97 IN PCLIENT_ID ClientId
102 LpcpSaveDataInfoMessage(
103 IN PLPCP_PORT_OBJECT Port
,
104 IN PLPCP_MESSAGE Message
,
109 // Module-external utlity functions
118 // Initialization functions
127 // Global data inside the Process Manager
129 extern POBJECT_TYPE LpcPortObjectType
;
130 extern ULONG LpcpNextMessageId
, LpcpNextCallbackId
;
131 extern KGUARDED_MUTEX LpcpLock
;
132 extern PAGED_LOOKASIDE_LIST LpcpMessagesLookaside
;
133 extern ULONG LpcpMaxMessageSize
;
134 extern ULONG LpcpTraceLevel
;