ReactOS 0.4.17-dev-573-g8315b8c
lpctypes.h
Go to the documentation of this file.
1/*++ NDK Version: 0098
2
3Copyright (c) Alex Ionescu. All rights reserved.
4
5Header Name:
6
7 lpctypes.h
8
9Abstract:
10
11 Type definitions for the Local Procedure Call.
12
13Author:
14
15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
16
17--*/
18
19#ifndef _LPCTYPES_H
20#define _LPCTYPES_H
21
22//
23// Dependencies
24//
25#include <umtypes.h>
26//#include <pstypes.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#ifndef NTOS_MODE_USER
33
34//
35// Kernel Exported Object Types
36//
38
39#endif // !NTOS_MODE_USER
40
41//
42// Internal helper macro
43//
44#define N_ROUND_UP(x,s) \
45 (((ULONG)(x)+(s)-1) & ~((ULONG)(s)-1))
46
47//
48// Port Object Access Masks
49//
50#define PORT_CONNECT 0x1
51#define PORT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
52 SYNCHRONIZE | \
53 PORT_CONNECT)
54
55//
56// Port Object Flags
57//
58#define LPCP_CONNECTION_PORT 0x00000001
59#define LPCP_UNCONNECTED_PORT 0x00000002
60#define LPCP_COMMUNICATION_PORT 0x00000003
61#define LPCP_CLIENT_PORT 0x00000004
62#define LPCP_PORT_TYPE_MASK 0x0000000F
63#define LPCP_PORT_DELETED 0x10000000
64#define LPCP_WAITABLE_PORT 0x20000000
65#define LPCP_NAME_DELETED 0x40000000
66#define LPCP_SECURITY_DYNAMIC 0x80000000
67
68//
69// LPC Message Types
70//
71typedef enum _LPC_TYPE
72{
87
88//
89// Information Classes for NtQueryInformationPort
90//
92{
95
96#ifdef NTOS_MODE_USER
97
98//
99// Maximum message size that can be sent through an LPC Port without a section
100//
101#ifdef _WIN64
102#define PORT_MAXIMUM_MESSAGE_LENGTH 512
103#else
104#define PORT_MAXIMUM_MESSAGE_LENGTH 256
105#endif
106
107//
108// Portable LPC Types for 32/64-bit compatibility
109//
110#ifdef USE_LPC6432
111#define LPC_CLIENT_ID CLIENT_ID64
112#define LPC_SIZE_T ULONGLONG
113#define LPC_PVOID ULONGLONG
114#define LPC_HANDLE ULONGLONG
115#else
116#define LPC_CLIENT_ID CLIENT_ID
117#define LPC_SIZE_T SIZE_T
118#define LPC_PVOID PVOID
119#define LPC_HANDLE HANDLE
120#endif
121
122//
123// LPC Port Message
124//
125typedef struct _PORT_MESSAGE
126{
127 union
128 {
129 struct
130 {
133 } s1;
135 } u1;
136 union
137 {
138 struct
139 {
140 CSHORT Type;
142 } s2;
144 } u2;
145 union
146 {
148 double DoNotUseThisField;
149 };
151 union
152 {
155 };
157
158//
159// Local and Remove Port Views
160//
161typedef struct _PORT_VIEW
162{
170
171typedef struct _REMOTE_PORT_VIEW
172{
177
178//
179// LPC Kernel-Mode Message Structures defined for size only
180//
181typedef struct _LPCP_MESSAGE
182{
183 UCHAR Data[0x14];
186
187typedef struct _LPCP_CONNECTION_MESSAGE
188{
189 UCHAR Data[0x2C];
191
192#else
193
194//
195// LPC Paged and Non-Paged Port Queues
196//
198{
202
203typedef struct _LPCP_PORT_QUEUE
204{
209
210//
211// LPC Port Object
212//
213typedef struct _LPCP_PORT_OBJECT
214{
227 union
228 {
231 };
237
238//
239// LPC Kernel-Mode Message Structures
240//
241typedef struct _LPCP_MESSAGE
242{
243 union
244 {
246 struct
247 {
250 };
251 };
257
259{
265
266#endif
267
268//
269// Client Died LPC Message
270//
271typedef struct _CLIENT_DIED_MSG
272{
276
277//
278// Maximum total Kernel-Mode LPC Message Structure Size
279//
280#define LPCP_MAX_MESSAGE_SIZE \
281 N_ROUND_UP(PORT_MAXIMUM_MESSAGE_LENGTH + \
282 sizeof(LPCP_MESSAGE) + \
283 sizeof(LPCP_CONNECTION_MESSAGE), 16)
284
285//
286// Maximum actual LPC Message Length
287//
288#define LPC_MAX_MESSAGE_LENGTH \
289 (LPCP_MAX_MESSAGE_SIZE - \
290 FIELD_OFFSET(LPCP_MESSAGE, Request))
291
292//
293// Maximum actual size of LPC Message Data
294//
295#define LPC_MAX_DATA_LENGTH \
296 (LPC_MAX_MESSAGE_LENGTH - \
297 sizeof(PORT_MESSAGE) - \
298 sizeof(LPCP_CONNECTION_MESSAGE))
299
300#ifdef __cplusplus
301}
302#endif
303
304#endif // _LPCTYPES_H
#define NTSYSAPI
Definition: ntoskrnl.h:12
struct _LPCP_NONPAGED_PORT_QUEUE * PLPCP_NONPAGED_PORT_QUEUE
struct _LPCP_MESSAGE * PLPCP_MESSAGE
struct _LPCP_PORT_OBJECT * PLPCP_PORT_OBJECT
POBJECT_TYPE NTSYSAPI LpcPortObjectType
Definition: port.c:17
struct _CLIENT_DIED_MSG * PCLIENT_DIED_MSG
struct _LPCP_MESSAGE LPCP_MESSAGE
struct _LPCP_NONPAGED_PORT_QUEUE LPCP_NONPAGED_PORT_QUEUE
struct _CLIENT_DIED_MSG CLIENT_DIED_MSG
struct _LPCP_CONNECTION_MESSAGE * PLPCP_CONNECTION_MESSAGE
struct _LPCP_PORT_OBJECT LPCP_PORT_OBJECT
struct _LPCP_CONNECTION_MESSAGE LPCP_CONNECTION_MESSAGE
struct _LPCP_PORT_QUEUE * PLPCP_PORT_QUEUE
_PORT_INFORMATION_CLASS
Definition: lpctypes.h:92
@ PortNoInformation
Definition: lpctypes.h:93
struct _LPCP_PORT_QUEUE LPCP_PORT_QUEUE
_LPC_TYPE
Definition: lpctypes.h:72
@ LPC_LOST_REPLY
Definition: lpctypes.h:77
@ LPC_EXCEPTION
Definition: lpctypes.h:80
@ LPC_ERROR_EVENT
Definition: lpctypes.h:82
@ LPC_DEBUG_EVENT
Definition: lpctypes.h:81
@ LPC_CLIENT_DIED
Definition: lpctypes.h:79
@ LPC_REQUEST
Definition: lpctypes.h:74
@ LPC_CONNECTION_REFUSED
Definition: lpctypes.h:84
@ LPC_DATAGRAM
Definition: lpctypes.h:76
@ LPC_REPLY
Definition: lpctypes.h:75
@ LPC_PORT_CLOSED
Definition: lpctypes.h:78
@ LPC_CONNECTION_REQUEST
Definition: lpctypes.h:83
@ LPC_NEW_MESSAGE
Definition: lpctypes.h:73
@ LPC_MAXIMUM
Definition: lpctypes.h:85
enum _LPC_TYPE LPC_TYPE
enum _PORT_INFORMATION_CLASS PORT_INFORMATION_CLASS
#define LPC_PVOID
#define LPC_SIZE_T
struct _REMOTE_PORT_VIEW * PREMOTE_PORT_VIEW
struct _PORT_VIEW PORT_VIEW
struct _PORT_VIEW * PPORT_VIEW
#define LPC_HANDLE
struct _REMOTE_PORT_VIEW REMOTE_PORT_VIEW
#define LPC_CLIENT_ID
PORT_MESSAGE h
Definition: lpctypes.h:273
LARGE_INTEGER CreateTime
Definition: lpctypes.h:274
Definition: typedefs.h:120
PLPCP_PORT_OBJECT ClientPort
Definition: lpctypes.h:261
REMOTE_PORT_VIEW ServerView
Definition: lpctypes.h:263
PVOID PortContext
Definition: lpctypes.h:254
PORT_MESSAGE Request
Definition: lpctypes.h:255
LIST_ENTRY Entry
Definition: lpctypes.h:245
PETHREAD RepliedToThread
Definition: lpctypes.h:253
PLPCP_PORT_OBJECT SenderPort
Definition: lpctypes.h:252
ULONG Reserved0
Definition: lpctypes.h:249
SINGLE_LIST_ENTRY FreeEntry
Definition: lpctypes.h:248
struct _LPCP_PORT_OBJECT * BackPointer
Definition: lpctypes.h:200
PEPROCESS MappingProcess
Definition: lpctypes.h:230
LIST_ENTRY LpcReplyChainHead
Definition: lpctypes.h:225
SECURITY_QUALITY_OF_SERVICE SecurityQos
Definition: lpctypes.h:223
PETHREAD ClientThread
Definition: lpctypes.h:222
LPCP_PORT_QUEUE MsgQueue
Definition: lpctypes.h:217
LIST_ENTRY LpcDataInfoChainHead
Definition: lpctypes.h:226
struct _LPCP_PORT_OBJECT * ConnectedPort
Definition: lpctypes.h:216
ULONG MaxMessageLength
Definition: lpctypes.h:232
struct _LPCP_PORT_OBJECT * ConnectionPort
Definition: lpctypes.h:215
PVOID ClientSectionBase
Definition: lpctypes.h:219
PEPROCESS ServerProcess
Definition: lpctypes.h:229
SECURITY_CLIENT_CONTEXT StaticSecurity
Definition: lpctypes.h:224
CLIENT_ID Creator
Definition: lpctypes.h:218
KEVENT WaitEvent
Definition: lpctypes.h:235
PVOID ServerSectionBase
Definition: lpctypes.h:220
ULONG MaxConnectionInfoLength
Definition: lpctypes.h:233
PLPCP_NONPAGED_PORT_QUEUE NonPagedPortQueue
Definition: lpctypes.h:205
LIST_ENTRY ReceiveHead
Definition: lpctypes.h:207
PKSEMAPHORE Semaphore
Definition: lpctypes.h:206
double DoNotUseThisField
union _PORT_MESSAGE::@4648 u1
struct _PORT_MESSAGE::@4649::@4655 s2
LPC_SIZE_T ClientViewSize
union _PORT_MESSAGE::@4649 u2
LPC_CLIENT_ID ClientId
struct _PORT_MESSAGE::@4648::@4654 s1
LPC_PVOID ViewBase
LPC_HANDLE SectionHandle
LPC_PVOID ViewRemoteBase
ULONG SectionOffset
LPC_SIZE_T ViewSize
Definition: ntbasedef.h:640
unsigned char UCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
short CSHORT
Definition: umtypes.h:127
struct _PORT_MESSAGE_HEADER PORT_MESSAGE
struct _PORT_MESSAGE_HEADER * PPORT_MESSAGE