ReactOS 0.4.15-dev-6703-g6528ab8
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
67typedef struct _LPCP_DATA_INFO
68{
70 struct
71 {
74 } Entries[1];
76
77
78//
79// Internal Port Management
80//
81VOID
88 IN ULONG SystemHandleCount
89);
90
91VOID
94 IN PVOID ObjectBody
95);
96
101);
102
103VOID
104NTAPI
107 IN ULONG LockFlags
108);
109
110VOID
111NTAPI
114 IN PPORT_MESSAGE Origin,
115 IN PVOID Data,
116 IN ULONG MessageType,
118);
119
120VOID
121NTAPI
125 IN ULONG LockFlags
126);
127
128//
129// Module-external utlity functions
130//
131VOID
132NTAPI
135);
136
137//
138// Initialization functions
139//
140CODE_SEG("INIT")
142NTAPI
144 VOID
145);
146
148NTAPI
152
153
154//
155// Global data inside the Process Manager
156//
162extern ULONG LpcpTraceLevel;
163
164//
165// Inlined Functions
166//
167#include "lpc_x.h"
UINT CALLBACK ClientThread(_Inout_ PVOID Parameter)
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
static const WCHAR Message[]
Definition: register.c:74
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
CPPORT Port[4]
Definition: headless.c:35
@ ProcessHandleCount
Definition: winternl.h:876
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
ULONG LpcpMaxMessageSize
Definition: port.c:18
VOID NTAPI LpcpFreeToPortZone(IN PLPCP_MESSAGE Message, IN ULONG LockFlags)
Definition: close.c:52
VOID NTAPI LpcpDeletePort(IN PVOID ObjectBody)
Definition: close.c:302
KGUARDED_MUTEX LpcpLock
Definition: port.c:20
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
struct _LPCP_DATA_INFO LPCP_DATA_INFO
VOID NTAPI LpcpSaveDataInfoMessage(IN PLPCP_PORT_OBJECT Port, IN PLPCP_MESSAGE Message, IN ULONG LockFlags)
Definition: reply.c:62
ULONG LpcpNextCallbackId
Definition: lpc.h:158
POBJECT_TYPE LpcPortObjectType
Definition: port.c:17
ULONG LpcpTraceLevel
Definition: port.c:21
VOID NTAPI LpcExitThread(IN PETHREAD Thread)
Definition: close.c:19
PAGED_LOOKASIDE_LIST LpcpMessagesLookaside
Definition: port.c:19
NTSTATUS NTAPI LpcpInitializePortQueue(IN PLPCP_PORT_OBJECT Port)
Definition: create.c:19
struct _LPCP_DATA_INFO * PLPCP_DATA_INFO
BOOLEAN NTAPI LpcpValidateClientPort(PETHREAD ClientThread, PLPCP_PORT_OBJECT Port)
Definition: port.c:90
BOOLEAN NTAPI LpcInitSystem(VOID)
Definition: port.c:37
ULONG LpcpNextMessageId
Definition: port.c:22
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_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:3004
ULONG ACCESS_MASK
Definition: nt_native.h:40
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
ULONG NumberOfEntries
Definition: lpc.h:69
PVOID BaseAddress
Definition: lpc.h:72
struct _LPCP_DATA_INFO::@1769 Entries[1]
ULONG DataLength
Definition: lpc.h:73
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST PAGED_LOOKASIDE_LIST
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1165
_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:20