ReactOS  0.4.14-dev-323-g6fe6a88
lpc.h
Go to the documentation of this file.
1 /*
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)
7 */
8 
9 //
10 // Define this if you want debugging support
11 //
12 #define _LPC_DEBUG_ 0x00
13 
14 //
15 // These define the Debug Masks Supported
16 //
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
24 
25 //
26 // Debug/Tracing support
27 //
28 #if _LPC_DEBUG_
29 #ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented
30 #define LPCTRACE(x, ...) \
31  { \
32  DbgPrintEx("%s [%.16s] - ", \
33  __FUNCTION__, \
34  PsGetCurrentProcess()->ImageFileName); \
35  DbgPrintEx(__VA_ARGS__); \
36  }
37 #else
38 #define LPCTRACE(x, ...) \
39  if (x & LpcpTraceLevel) \
40  { \
41  DbgPrint("%s [%.16s:%lx] - ", \
42  __FUNCTION__, \
43  PsGetCurrentProcess()->ImageFileName, \
44  PsGetCurrentThreadId()); \
45  DbgPrint(__VA_ARGS__); \
46  }
47 #endif
48 #else
49 #define LPCTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__)
50 #endif
51 
52 //
53 // LPC Port/Message Flags
54 //
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)
59 
60 //
61 // LPC Locking Flags
62 //
63 #define LPCP_LOCK_HELD 1
64 #define LPCP_LOCK_RELEASE 2
65 
66 
67 typedef struct _LPCP_DATA_INFO
68 {
70  struct
71  {
74  } Entries[1];
76 
77 
78 //
79 // Internal Port Management
80 //
81 VOID
82 NTAPI
85  IN PVOID Object,
88  IN ULONG SystemHandleCount
89 );
90 
91 VOID
92 NTAPI
94  IN PVOID ObjectBody
95 );
96 
98 NTAPI
101 );
102 
103 VOID
104 NTAPI
107  IN ULONG LockFlags
108 );
109 
110 VOID
111 NTAPI
114  IN PPORT_MESSAGE Origin,
115  IN PVOID Data,
116  IN ULONG MessageType,
118 );
119 
120 VOID
121 NTAPI
125  IN ULONG LockFlags
126 );
127 
128 //
129 // Module-external utlity functions
130 //
131 VOID
132 NTAPI
135 );
136 
137 //
138 // Initialization functions
139 //
140 INIT_FUNCTION
141 BOOLEAN
142 NTAPI
144  VOID
145 );
146 
147 BOOLEAN
148 NTAPI
152 
153 
154 //
155 // Global data inside the Process Manager
156 //
159 extern KGUARDED_MUTEX LpcpLock;
162 extern ULONG LpcpTraceLevel;
163 
164 //
165 // Inlined Functions
166 //
167 #include "lpc_x.h"
CPPORT Port[4]
Definition: headless.c:34
#define IN
Definition: typedefs.h:38
KGUARDED_MUTEX LpcpLock
Definition: port.c:20
struct _LPCP_DATA_INFO * PLPCP_DATA_INFO
PAGED_LOOKASIDE_LIST LpcpMessagesLookaside
Definition: port.c:19
VOID NTAPI LpcpMoveMessage(IN PPORT_MESSAGE Destination, IN PPORT_MESSAGE Origin, IN PVOID Data, IN ULONG MessageType, IN PCLIENT_ID ClientId)
Definition: reply.c:139
LONG NTSTATUS
Definition: precomp.h:26
INIT_FUNCTION BOOLEAN NTAPI LpcInitSystem(VOID)
Definition: port.c:37
ULONG LpcpNextMessageId
Definition: port.c:22
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
BOOLEAN NTAPI LpcpValidateClientPort(PETHREAD ClientThread, PLPCP_PORT_OBJECT Port)
Definition: port.c:90
unsigned char BOOLEAN
UINT CALLBACK ClientThread(_Inout_ PVOID Parameter)
ULONG DataLength
Definition: lpc.h:73
POBJECT_TYPE LpcPortObjectType
Definition: port.c:17
NTSTATUS NTAPI LpcpInitializePortQueue(IN PLPCP_PORT_OBJECT Port)
Definition: create.c:19
struct _LPCP_DATA_INFO LPCP_DATA_INFO
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1176
VOID NTAPI LpcpDeletePort(IN PVOID ObjectBody)
Definition: close.c:302
ULONG LpcpNextCallbackId
Definition: port.c:22
ULONG NumberOfEntries
Definition: lpc.h:69
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2891
static IUnknown Object
Definition: main.c:512
CHAR Message[80]
Definition: alive.c:5
ULONG LpcpMaxMessageSize
Definition: port.c:18
ULONG LpcpTraceLevel
Definition: port.c:21
VOID NTAPI LpcpFreeToPortZone(IN PLPCP_MESSAGE Message, IN ULONG LockFlags)
Definition: close.c:52
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST PAGED_LOOKASIDE_LIST
PVOID BaseAddress
Definition: lpc.h:72
struct _LPCP_DATA_INFO::@1741 Entries[1]
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
unsigned int ULONG
Definition: retypes.h:1
VOID NTAPI LpcExitThread(IN PETHREAD Thread)
Definition: close.c:19
VOID NTAPI LpcpClosePort(IN PEPROCESS Process OPTIONAL, IN PVOID Object, IN ACCESS_MASK GrantedAccess, IN ULONG ProcessHandleCount, IN ULONG SystemHandleCount)
Definition: close.c:244
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET _In_ PGENERIC_MAPPING _In_ KPROCESSOR_MODE _Out_ PACCESS_MASK GrantedAccess
Definition: sefuncs.h:13
VOID NTAPI LpcpSaveDataInfoMessage(IN PLPCP_PORT_OBJECT Port, IN PLPCP_MESSAGE Message, IN ULONG LockFlags)
Definition: reply.c:62
ULONG ACCESS_MASK
Definition: nt_native.h:40
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68