2 * PROJECT: ReactOS Native Headers
3 * FILE: include/ndk/lpctypes.h
4 * PURPOSE: Definitions for Local Procedure Call Types not defined in DDK/IFS
5 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
12 /* DEPENDENCIES **************************************************************/
14 /* EXPORTED DATA *************************************************************/
16 /* ENUMERATIONS **************************************************************/
18 typedef enum _LPC_TYPE
30 LPC_CONNECTION_REQUEST
,
31 LPC_CONNECTION_REFUSED
,
35 /* TYPES *********************************************************************/
39 #if defined(USE_LPC6432)
40 #define LPC_CLIENT_ID CLIENT_ID64
41 #define LPC_SIZE_T ULONGLONG
42 #define LPC_PVOID ULONGLONG
43 #define LPC_HANDLE ULONGLONG
45 #define LPC_CLIENT_ID CLIENT_ID
46 #define LPC_SIZE_T SIZE_T
47 #define LPC_PVOID PVOID
48 #define LPC_HANDLE HANDLE
51 typedef struct _PORT_MESSAGE
67 CSHORT DataInfoOffset
;
73 LPC_CLIENT_ID ClientId
;
74 double DoNotUseThisField
;
79 LPC_SIZE_T ClientViewSize
;
82 } PORT_MESSAGE
, *PPORT_MESSAGE
;
84 typedef struct _PORT_VIEW
87 LPC_HANDLE SectionHandle
;
91 LPC_PVOID ViewRemoteBase
;
92 } PORT_VIEW
, *PPORT_VIEW
;
94 typedef struct _REMOTE_PORT_VIEW
99 } REMOTE_PORT_VIEW
, *PREMOTE_PORT_VIEW
;
101 typedef struct _LPCP_MESSAGE
104 PORT_MESSAGE Request
;
107 typedef struct _LPCP_CONNECTION_MESSAGE
110 } LPCP_CONNECTION_MESSAGE
;
112 /* Kernel-Mode Structures */
115 typedef struct _LPCP_NONPAGED_PORT_QUEUE
117 KSEMAPHORE Semaphore
;
118 struct _LPCP_PORT_OBJECT
*BackPointer
;
119 } LPCP_NONPAGED_PORT_QUEUE
, *PLPCP_NONPAGED_PORT_QUEUE
;
121 typedef struct _LPCP_PORT_QUEUE
123 PLPCP_NONPAGED_PORT_QUEUE NonPagedPortQueue
;
124 KSEMAPHORE Semaphore
;
125 LIST_ENTRY ReceiveHead
;
126 } LPCP_PORT_QUEUE
, *PLPCP_PORT_QUEUE
;
128 typedef struct _LPCP_PORT_OBJECT
132 struct _LPCP_PORT_OBJECT
*ConnectionPort
;
133 struct _LPCP_PORT_OBJECT
*ConnectedPort
;
134 LPCP_PORT_QUEUE MsgQueue
;
136 PVOID ClientSectionBase
;
137 PVOID ServerSectionBase
;
139 ULONG MaxMessageLength
;
140 ULONG MaxConnectionInfoLength
;
141 PETHREAD ClientThread
;
142 SECURITY_QUALITY_OF_SERVICE SecurityQos
;
143 SECURITY_CLIENT_CONTEXT StaticSecurity
;
144 LIST_ENTRY LpcReplyChainHead
;
145 LIST_ENTRY LpcDataInfoChainHead
;
146 } LPCP_PORT_OBJECT
, *PLPCP_PORT_OBJECT
;
148 typedef struct _LPCP_MESSAGE
155 SINGLE_LIST_ENTRY FreeEntry
;
159 PLPCP_PORT_OBJECT SenderPort
;
160 PETHREAD RepliedToThread
;
162 PORT_MESSAGE Request
;
163 } LPCP_MESSAGE
, *PLPCP_MESSAGE
;
165 typedef struct _LPCP_CONNECTION_MESSAGE
167 PORT_VIEW ClientView
;
168 PLPCP_PORT_OBJECT ClientPort
;
170 REMOTE_PORT_VIEW ServerView
;
171 } LPCP_CONNECTION_MESSAGE
, *PLPCP_CONNECTION_MESSAGE
;
174 /* CONSTANTS *****************************************************************/
176 #define PORT_MAXIMUM_MESSAGE_LENGTH 256
178 #define LPCP_MAX_MESSAGE_SIZE \
179 ROUND_UP(PORT_MAXIMUM_MESSAGE_LENGTH + \
180 sizeof(LPCP_MESSAGE) + \
181 sizeof(LPCP_CONNECTION_MESSAGE), 16)
183 #define LPC_MAX_MESSAGE_LENGTH \
184 (LPCP_MAX_MESSAGE_SIZE - \
185 FIELD_OFFSET(LPCP_MESSAGE, Request))
187 #define LPC_MAX_DATA_LENGTH \
188 (LPC_MAX_MESSAGE_LENGTH - \
189 sizeof(PORT_MESSAGE) - \
190 sizeof(LPCP_CONNECTION_MESSAGE))