2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/include/internal/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_ 0x00
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__); \
49 #define LPCTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__)
53 // LPC Port/Message Flags
55 #define LPCP_THREAD_FLAG_IS_PORT 1
56 #define LPCP_THREAD_FLAG_NO_IMPERSONATION 2
57 #define LPCP_THREAD_FLAGS (LPCP_THREAD_FLAG_IS_PORT | \
58 LPCP_THREAD_FLAG_NO_IMPERSONATION)
61 // Internal Port Management
66 IN PEPROCESS Process OPTIONAL
,
68 IN ACCESS_MASK GrantedAccess
,
69 IN ULONG ProcessHandleCount
,
70 IN ULONG SystemHandleCount
81 LpcpInitializePortQueue(
82 IN PLPCP_PORT_OBJECT Port
88 IN PLPCP_MESSAGE Message
,
95 IN PPORT_MESSAGE Destination
,
96 IN PPORT_MESSAGE Origin
,
99 IN PCLIENT_ID ClientId
104 LpcpSaveDataInfoMessage(
105 IN PLPCP_PORT_OBJECT Port
,
106 IN PLPCP_MESSAGE Message
,
111 // Module-external utlity functions
120 // Initialization functions
129 // Global data inside the Process Manager
131 extern POBJECT_TYPE LpcPortObjectType
;
132 extern ULONG LpcpNextMessageId
, LpcpNextCallbackId
;
133 extern KGUARDED_MUTEX LpcpLock
;
134 extern PAGED_LOOKASIDE_LIST LpcpMessagesLookaside
;
135 extern ULONG LpcpMaxMessageSize
;
136 extern ULONG LpcpTraceLevel
;