ReactOS 0.4.16-dev-303-g11d5cb8
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#ifndef NTOS_MODE_USER
29
30//
31// Kernel Exported Object Types
32//
34
35#endif // !NTOS_MODE_USER
36
37//
38// Internal helper macro
39//
40#define N_ROUND_UP(x,s) \
41 (((ULONG)(x)+(s)-1) & ~((ULONG)(s)-1))
42
43//
44// Port Object Access Masks
45//
46#define PORT_CONNECT 0x1
47#define PORT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
48 SYNCHRONIZE | \
49 PORT_CONNECT)
50
51//
52// Port Object Flags
53//
54#define LPCP_CONNECTION_PORT 0x00000001
55#define LPCP_UNCONNECTED_PORT 0x00000002
56#define LPCP_COMMUNICATION_PORT 0x00000003
57#define LPCP_CLIENT_PORT 0x00000004
58#define LPCP_PORT_TYPE_MASK 0x0000000F
59#define LPCP_PORT_DELETED 0x10000000
60#define LPCP_WAITABLE_PORT 0x20000000
61#define LPCP_NAME_DELETED 0x40000000
62#define LPCP_SECURITY_DYNAMIC 0x80000000
63
64//
65// LPC Message Types
66//
67typedef enum _LPC_TYPE
68{
83
84//
85// Information Classes for NtQueryInformationPort
86//
88{
91
92#ifdef NTOS_MODE_USER
93
94//
95// Maximum message size that can be sent through an LPC Port without a section
96//
97#ifdef _WIN64
98#define PORT_MAXIMUM_MESSAGE_LENGTH 512
99#else
100#define PORT_MAXIMUM_MESSAGE_LENGTH 256
101#endif
102
103//
104// Portable LPC Types for 32/64-bit compatibility
105//
106#ifdef USE_LPC6432
107#define LPC_CLIENT_ID CLIENT_ID64
108#define LPC_SIZE_T ULONGLONG
109#define LPC_PVOID ULONGLONG
110#define LPC_HANDLE ULONGLONG
111#else
112#define LPC_CLIENT_ID CLIENT_ID
113#define LPC_SIZE_T SIZE_T
114#define LPC_PVOID PVOID
115#define LPC_HANDLE HANDLE
116#endif
117
118//
119// LPC Port Message
120//
121typedef struct _PORT_MESSAGE
122{
123 union
124 {
125 struct
126 {
129 } s1;
131 } u1;
132 union
133 {
134 struct
135 {
136 CSHORT Type;
138 } s2;
140 } u2;
141 union
142 {
144 double DoNotUseThisField;
145 };
147 union
148 {
151 };
153
154//
155// Local and Remove Port Views
156//
157typedef struct _PORT_VIEW
158{
166
167typedef struct _REMOTE_PORT_VIEW
168{
173
174//
175// LPC Kernel-Mode Message Structures defined for size only
176//
177typedef struct _LPCP_MESSAGE
178{
179 UCHAR Data[0x14];
182
183typedef struct _LPCP_CONNECTION_MESSAGE
184{
185 UCHAR Data[0x2C];
187
188#else
189
190//
191// LPC Paged and Non-Paged Port Queues
192//
194{
198
199typedef struct _LPCP_PORT_QUEUE
200{
205
206//
207// LPC Port Object
208//
209typedef struct _LPCP_PORT_OBJECT
210{
223 union
224 {
227 };
233
234//
235// LPC Kernel-Mode Message Structures
236//
237typedef struct _LPCP_MESSAGE
238{
239 union
240 {
242 struct
243 {
246 };
247 };
253
255{
261
262#endif
263
264//
265// Client Died LPC Message
266//
267typedef struct _CLIENT_DIED_MSG
268{
272
273//
274// Maximum total Kernel-Mode LPC Message Structure Size
275//
276#define LPCP_MAX_MESSAGE_SIZE \
277 N_ROUND_UP(PORT_MAXIMUM_MESSAGE_LENGTH + \
278 sizeof(LPCP_MESSAGE) + \
279 sizeof(LPCP_CONNECTION_MESSAGE), 16)
280
281//
282// Maximum actual LPC Message Length
283//
284#define LPC_MAX_MESSAGE_LENGTH \
285 (LPCP_MAX_MESSAGE_SIZE - \
286 FIELD_OFFSET(LPCP_MESSAGE, Request))
287
288//
289// Maximum actual size of LPC Message Data
290//
291#define LPC_MAX_DATA_LENGTH \
292 (LPC_MAX_MESSAGE_LENGTH - \
293 sizeof(PORT_MESSAGE) - \
294 sizeof(LPCP_CONNECTION_MESSAGE))
295
296#endif // _LPCTYPES_H
#define NTSYSAPI
Definition: ntoskrnl.h:12
struct _PORT_MESSAGE_HEADER PORT_MESSAGE
struct _PORT_MESSAGE_HEADER * PPORT_MESSAGE
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:88
@ PortNoInformation
Definition: lpctypes.h:89
struct _LPCP_PORT_QUEUE LPCP_PORT_QUEUE
_LPC_TYPE
Definition: lpctypes.h:68
@ LPC_LOST_REPLY
Definition: lpctypes.h:73
@ LPC_EXCEPTION
Definition: lpctypes.h:76
@ LPC_ERROR_EVENT
Definition: lpctypes.h:78
@ LPC_DEBUG_EVENT
Definition: lpctypes.h:77
@ LPC_CLIENT_DIED
Definition: lpctypes.h:75
@ LPC_REQUEST
Definition: lpctypes.h:70
@ LPC_CONNECTION_REFUSED
Definition: lpctypes.h:80
@ LPC_DATAGRAM
Definition: lpctypes.h:72
@ LPC_REPLY
Definition: lpctypes.h:71
@ LPC_PORT_CLOSED
Definition: lpctypes.h:74
@ LPC_CONNECTION_REQUEST
Definition: lpctypes.h:79
@ LPC_NEW_MESSAGE
Definition: lpctypes.h:69
@ LPC_MAXIMUM
Definition: lpctypes.h:81
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:269
LARGE_INTEGER CreateTime
Definition: lpctypes.h:270
Definition: typedefs.h:120
PLPCP_PORT_OBJECT ClientPort
Definition: lpctypes.h:257
REMOTE_PORT_VIEW ServerView
Definition: lpctypes.h:259
PVOID PortContext
Definition: lpctypes.h:250
PORT_MESSAGE Request
Definition: lpctypes.h:251
LIST_ENTRY Entry
Definition: lpctypes.h:241
PETHREAD RepliedToThread
Definition: lpctypes.h:249
PLPCP_PORT_OBJECT SenderPort
Definition: lpctypes.h:248
ULONG Reserved0
Definition: lpctypes.h:245
SINGLE_LIST_ENTRY FreeEntry
Definition: lpctypes.h:244
struct _LPCP_PORT_OBJECT * BackPointer
Definition: lpctypes.h:196
PEPROCESS MappingProcess
Definition: lpctypes.h:226
LIST_ENTRY LpcReplyChainHead
Definition: lpctypes.h:221
SECURITY_QUALITY_OF_SERVICE SecurityQos
Definition: lpctypes.h:219
PETHREAD ClientThread
Definition: lpctypes.h:218
LPCP_PORT_QUEUE MsgQueue
Definition: lpctypes.h:213
LIST_ENTRY LpcDataInfoChainHead
Definition: lpctypes.h:222
struct _LPCP_PORT_OBJECT * ConnectedPort
Definition: lpctypes.h:212
ULONG MaxMessageLength
Definition: lpctypes.h:228
struct _LPCP_PORT_OBJECT * ConnectionPort
Definition: lpctypes.h:211
PVOID ClientSectionBase
Definition: lpctypes.h:215
PEPROCESS ServerProcess
Definition: lpctypes.h:225
SECURITY_CLIENT_CONTEXT StaticSecurity
Definition: lpctypes.h:220
CLIENT_ID Creator
Definition: lpctypes.h:214
KEVENT WaitEvent
Definition: lpctypes.h:231
PVOID ServerSectionBase
Definition: lpctypes.h:216
ULONG MaxConnectionInfoLength
Definition: lpctypes.h:229
PLPCP_NONPAGED_PORT_QUEUE NonPagedPortQueue
Definition: lpctypes.h:201
LIST_ENTRY ReceiveHead
Definition: lpctypes.h:203
PKSEMAPHORE Semaphore
Definition: lpctypes.h:202
union _PORT_MESSAGE::@4153 u2
double DoNotUseThisField
struct _PORT_MESSAGE::@4152::@4158 s1
LPC_SIZE_T ClientViewSize
LPC_CLIENT_ID ClientId
struct _PORT_MESSAGE::@4153::@4159 s2
union _PORT_MESSAGE::@4152 u1
LPC_PVOID ViewBase
LPC_HANDLE SectionHandle
LPC_PVOID ViewRemoteBase
ULONG SectionOffset
LPC_SIZE_T ViewSize
Definition: ntbasedef.h:636
uint32_t ULONG
Definition: typedefs.h:59
short CSHORT
Definition: umtypes.h:127
unsigned char UCHAR
Definition: xmlstorage.h:181