Definition of LPC_DEBUG_MESSAGE added in napi/lpc.h.
[reactos.git] / reactos / include / napi / lpc.h
1 #ifndef __INCLUDE_NAPI_LPC_H
2 #define __INCLUDE_NAPI_LPC_H
3
4 #include <ntos/security.h>
5
6 #define MAX_MESSAGE_DATA (0x130)
7
8 #define UNUSED_MSG_TYPE (0x0)
9 #define LPC_REQUEST (0x1)
10 #define LPC_REPLY (0x2)
11 #define LPC_DATAGRAM (0x3)
12 #define LPC_LOST_REPLY (0x4)
13 #define LPC_PORT_CLOSED (0x5)
14 #define LPC_CLIENT_DIED (0x6)
15 #define LPC_EXCEPTION (0x7)
16 #define LPC_DEBUG_EVENT (0x8)
17 #define LPC_ERROR_EVENT (0x9)
18 #define LPC_CONNECTION_REQUEST (0xa)
19 #define LPC_CONNECTION_REFUSED (0xb)
20
21 typedef struct _LPC_SECTION_WRITE
22 {
23 ULONG Length;
24 HANDLE SectionHandle;
25 ULONG SectionOffset;
26 ULONG ViewSize;
27 PVOID ViewBase;
28 PVOID TargetViewBase;
29 } LPC_SECTION_WRITE, *PLPC_SECTION_WRITE;
30
31 typedef struct _LPC_SECTION_READ
32 {
33 ULONG Length;
34 ULONG ViewSize;
35 PVOID ViewBase;
36 } LPC_SECTION_READ, *PLPC_SECTION_READ;
37
38 typedef struct _LPC_MESSAGE_HEADER
39 {
40 USHORT DataSize;
41 USHORT MessageSize;
42 USHORT MessageType;
43 USHORT VirtualRangesOffset;
44 CLIENT_ID Cid;
45 ULONG MessageId;
46 ULONG SharedSectionSize;
47 } LPC_MESSAGE_HEADER, *PLPC_MESSAGE_HEADER;
48
49 typedef struct _LPC_TERMINATION_MESSAGE
50 {
51 LPC_MESSAGE_HEADER Header;
52 TIME CreationTime;
53 } LPC_TERMINATION_MESSAGE, *PLPC_TERMINATION_MESSAGE;
54
55 typedef struct _LPC_DEBUG_MESSAGE
56 {
57 LPC_MESSAGE_HEADER Header;
58 ULONG EventCode;
59 ULONG Status;
60 union {
61 struct {
62 EXCEPTION_RECORD ExceptionRecord;
63 ULONG FirstChance;
64 } Exception;
65 struct {
66 ULONG Reserved;
67 PVOID StartAddress;
68 } CreateThread;
69 struct {
70 ULONG Reserved;
71 HANDLE FileHandle;
72 PVOID Base;
73 ULONG PointerToSymbolTable;
74 ULONG NumberOfSymbols;
75 ULONG Reserved2;
76 PVOID EntryPoint;
77 } CreateProcess;
78 struct {
79 ULONG ExitCode;
80 } ExitThread;
81 struct {
82 ULONG ExitCode;
83 } ExitProcess;
84 struct {
85 HANDLE FileHandle;
86 PVOID Base;
87 ULONG PointerToSymbolTable;
88 ULONG NumberOfSymbols;
89 } LoadDll;
90 struct {
91 PVOID Base;
92 } UnloadDll;
93 #ifdef ANONYMOUSUNIONS
94 };
95 #else
96 } u;
97 #endif
98 } LPC_DEBUG_MESSAGE, * PLPC_DEBUG_MESSAGE;
99
100 typedef LPC_MESSAGE_HEADER LPC_MESSAGE, *PLPC_MESSAGE;
101
102 typedef struct _LPC_MAX_MESSAGE
103 {
104 LPC_MESSAGE_HEADER Header;
105 BYTE Data[MAX_MESSAGE_DATA];
106 } LPC_MAX_MESSAGE, *PLPC_MAX_MESSAGE;
107
108 #define PORT_MESSAGE_TYPE(m) (USHORT)((m).Header.MessageType)
109
110 NTSTATUS STDCALL NtAcceptConnectPort (PHANDLE PortHandle,
111 HANDLE NamedPortHandle,
112 PLPC_MESSAGE ServerReply,
113 BOOLEAN AcceptIt,
114 PLPC_SECTION_WRITE WriteMap,
115 PLPC_SECTION_READ ReadMap);
116
117 NTSTATUS STDCALL NtCompleteConnectPort (HANDLE PortHandle);
118
119 NTSTATUS STDCALL NtConnectPort(PHANDLE PortHandle,
120 PUNICODE_STRING PortName,
121 PSECURITY_QUALITY_OF_SERVICE SecurityQos,
122 PLPC_SECTION_WRITE SectionInfo,
123 PLPC_SECTION_READ MapInfo,
124 PULONG MaxMessageSize,
125 PVOID ConnectInfo,
126 PULONG ConnectInfoLength);
127
128 NTSTATUS STDCALL NtReplyWaitReplyPort (HANDLE PortHandle,
129 PLPC_MESSAGE ReplyMessage);
130
131 NTSTATUS STDCALL NtCreatePort(PHANDLE PortHandle,
132 POBJECT_ATTRIBUTES ObjectAttributes,
133 ULONG MaxConnectInfoLength,
134 ULONG MaxDataLength,
135 ULONG NPMessageQueueSize OPTIONAL);
136
137 NTSTATUS STDCALL NtCreateWaitablePort(PHANDLE PortHandle,
138 POBJECT_ATTRIBUTES ObjectAttributes,
139 ULONG MaxConnectInfoLength,
140 ULONG MaxDataLength,
141 ULONG NPMessageQueueSize OPTIONAL);
142
143 NTSTATUS STDCALL NtImpersonateClientOfPort (HANDLE PortHandle,
144 PLPC_MESSAGE ClientMessage);
145
146 NTSTATUS STDCALL NtListenPort (HANDLE PortHandle,
147 PLPC_MESSAGE LpcMessage);
148
149 NTSTATUS STDCALL NtQueryInformationPort (HANDLE PortHandle,
150 CINT PortInformationClass,
151 PVOID PortInformation,
152 ULONG PortInformationLength,
153 PULONG ReturnLength);
154 NTSTATUS STDCALL NtReplyPort (HANDLE PortHandle,
155 PLPC_MESSAGE LpcReply);
156 NTSTATUS STDCALL NtReplyWaitReceivePort (HANDLE PortHandle,
157 PULONG PortId,
158 PLPC_MESSAGE MessageReply,
159 PLPC_MESSAGE MessageRequest);
160 NTSTATUS STDCALL NtRequestPort (HANDLE PortHandle,
161 PLPC_MESSAGE LpcMessage);
162
163 NTSTATUS STDCALL NtRequestWaitReplyPort (HANDLE PortHandle,
164 PLPC_MESSAGE LpcReply,
165 PLPC_MESSAGE LpcRequest);
166
167 NTSTATUS STDCALL NtReadRequestData (HANDLE PortHandle,
168 PLPC_MESSAGE Message,
169 ULONG Index,
170 PVOID Buffer,
171 ULONG BufferLength,
172 PULONG ReturnLength);
173
174 NTSTATUS STDCALL NtWriteRequestData (HANDLE PortHandle,
175 PLPC_MESSAGE Message,
176 ULONG Index,
177 PVOID Buffer,
178 ULONG BufferLength,
179 PULONG ReturnLength);
180
181
182 #endif /* __INCLUDE_NAPI_LPC_H */