- Use correct, documented, LPC Message structures (PORT_VIEW, REMOTE_PORT_VIEW)....
[reactos.git] / reactos / include / ndk / lpctypes.h
1 /*
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)
6 * UPDATE HISTORY:
7 * Created 06/10/04
8 */
9 #ifndef _LPCTYPES_H
10 #define _LPCTYPES_H
11
12 #define LPC_MESSAGE_TYPE(m) ((m).Header.u2.s2.Type)
13
14 /* DEPENDENCIES **************************************************************/
15
16 /* EXPORTED DATA *************************************************************/
17
18 /* CONSTANTS *****************************************************************/
19 #define LPC_MESSAGE_BASE_SIZE 24
20 #define MAX_MESSAGE_DATA (0x130)
21 #define LPC_MAX_DATA_LENGTH 0x104
22 #define LPC_MAX_MESSAGE_LENGTH 0x148
23
24 /* ENUMERATIONS **************************************************************/
25
26 typedef enum _LPC_TYPE
27 {
28 LPC_NEW_MESSAGE,
29 LPC_REQUEST,
30 LPC_REPLY,
31 LPC_DATAGRAM,
32 LPC_LOST_REPLY,
33 LPC_PORT_CLOSED,
34 LPC_CLIENT_DIED,
35 LPC_EXCEPTION,
36 LPC_DEBUG_EVENT,
37 LPC_ERROR_EVENT,
38 LPC_CONNECTION_REQUEST,
39 LPC_CONNECTION_REFUSED,
40 LPC_MAXIMUM
41 } LPC_TYPE;
42
43 /* TYPES *********************************************************************/
44
45 #if defined(USE_LPC6432)
46 #define LPC_CLIENT_ID CLIENT_ID64
47 #define LPC_SIZE_T ULONGLONG
48 #define LPC_PVOID ULONGLONG
49 #define LPC_HANDLE ULONGLONG
50 #else
51 #define LPC_CLIENT_ID CLIENT_ID
52 #define LPC_SIZE_T SIZE_T
53 #define LPC_PVOID PVOID
54 #define LPC_HANDLE HANDLE
55 #endif
56
57 typedef struct _PORT_MESSAGE
58 {
59 union
60 {
61 struct
62 {
63 CSHORT DataLength;
64 CSHORT TotalLength;
65 } s1;
66 ULONG Length;
67 } u1;
68 union
69 {
70 struct
71 {
72 CSHORT Type;
73 CSHORT DataInfoOffset;
74 } s2;
75 ULONG ZeroInit;
76 } u2;
77 union
78 {
79 LPC_CLIENT_ID ClientId;
80 double DoNotUseThisField;
81 };
82 ULONG MessageId;
83 union
84 {
85 LPC_SIZE_T ClientViewSize;
86 ULONG CallbackId;
87 };
88 } PORT_MESSAGE, *PPORT_MESSAGE;
89
90 typedef struct _PORT_VIEW
91 {
92 ULONG Length;
93 LPC_HANDLE SectionHandle;
94 ULONG SectionOffset;
95 LPC_SIZE_T ViewSize;
96 LPC_PVOID ViewBase;
97 LPC_PVOID ViewRemoteBase;
98 } PORT_VIEW, *PPORT_VIEW;
99
100 typedef struct _REMOTE_PORT_VIEW
101 {
102 ULONG Length;
103 LPC_SIZE_T ViewSize;
104 LPC_PVOID ViewBase;
105 } REMOTE_PORT_VIEW, *PREMOTE_PORT_VIEW;
106
107 /* FIXME: USE REAL DEFINITION */
108 typedef struct _LPC_MAX_MESSAGE
109 {
110 PORT_MESSAGE Header;
111 BYTE Data[MAX_MESSAGE_DATA];
112 } LPC_MAX_MESSAGE, *PLPC_MAX_MESSAGE;
113
114 #endif