46{
51 ULONG ConnectionInfoLength;
60
62
64 "Context: %p. Message: %p. Accept: %lx. Views: %p/%p\n",
65 PortContext,
67 AcceptConnection,
68 ClientView,
69 ServerView);
70
71
73 {
75 {
76
78
79
82 ConnectionInfoLength = CapturedReplyMessage.u1.s1.DataLength;
83
84
86
87
88
89
90 if (ServerView)
91 {
93 CapturedServerView = *(
volatile PORT_VIEW*)ServerView;
94
95
96 if (CapturedServerView.
Length !=
sizeof(CapturedServerView))
97 {
98
100 }
101 }
102
103
104 if (ClientView)
105 {
107
108
110 {
111
113 }
114 }
115 }
117 {
118
120 }
122 }
123 else
124 {
126 ConnectionInfoLength = CapturedReplyMessage.u1.s1.DataLength;
127
128
129 if (ServerView)
130 {
131
132 if (ServerView->Length != sizeof(*ServerView))
133 {
134
136 }
137 CapturedServerView = *ServerView;
138 }
139
140
141 if (ClientView)
142 {
143
144 if (ClientView->Length != sizeof(*ClientView))
145 {
146
148 }
149 }
150 }
151
152
154 &ClientProcess,
157
158
160
161
165 {
166
171 }
172
173
176
177
180
181
183 {
184
189 }
190
191
194
195
198
199
201 {
202
204 }
205
206
207 Message->Request.u1.s1.DataLength = (
CSHORT)ConnectionInfoLength +
210 Message->Request.u1.s1.DataLength;
211
212
214 Message->Request.u2.s2.DataInfoOffset = 0;
217 Message->Request.ClientViewSize = 0;
218
220 {
222 }
224 {
227 }
229
230
231 if (!AcceptConnection)
232 {
233 DPRINT1(
"LPC connection was refused\n");
235 }
236
237
244 0,
245 0,
248
249
256
257
259
260
264
265
268
269
274
275
276 if (ClientSectionToMap)
277 {
278
280
281
285 0,
286 0,
290 0,
292
293
296 {
297
299 ClientSectionBase;
300
301
304 }
305 else
306 {
307
311 "View base, offset, size: %p %lx %p\n",
316 }
317 }
318
319
320 if (ServerView)
321 {
322
325 }
326
327
329
330
334 0,
338 {
339
342 }
343
344
346 {
347
348 if (ClientView)
349 {
350
353 }
354
355
357 }
359 {
360
365 }
367
369 "Handle: %p. Messages: %p/%p. Ports: %p/%p/%p\n",
372 ConnectMessage,
375 ConnectionPort);
376
377
380
381
385
386
388
389
391
393
395
396
398 {
405 }
406
407
409 "Status: %lx. Thread: %p. Process: [%.16s]\n",
416}
static const INTERNET_PORT ServerPort
UINT CALLBACK ClientThread(_Inout_ PVOID Parameter)
VOID NTAPI LpcpPrepareToWakeClient(IN PETHREAD Thread)
#define NT_SUCCESS(StatCode)
static const WCHAR Message[]
static const WCHAR Cleanup[]
#define PsGetCurrentThread()
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
_Outptr_ PFLT_PORT * ClientPort
VOID FASTCALL KeReleaseGuardedMutex(IN OUT PKGUARDED_MUTEX GuardedMutex)
VOID FASTCALL KeAcquireGuardedMutex(IN PKGUARDED_MUTEX GuardedMutex)
#define EXCEPTION_EXECUTE_HANDLER
POBJECT_TYPE LpcPortObjectType
#define LPCTRACE(x, fmt,...)
#define LPC_COMPLETE_DEBUG
#define LpcpCompleteWait(s)
FORCEINLINE PLPCP_MESSAGE LpcpGetMessageFromThread(IN PETHREAD Thread)
#define LPCP_COMMUNICATION_PORT
struct _LPCP_MESSAGE LPCP_MESSAGE
struct _LPCP_CONNECTION_MESSAGE * PLPCP_CONNECTION_MESSAGE
#define KeGetPreviousMode()
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER SectionOffset
#define UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSTATUS NTAPI PsLookupProcessThreadByCid(IN PCLIENT_ID Cid, OUT PEPROCESS *Process OPTIONAL, OUT PETHREAD *Thread)
#define STATUS_REPLY_MESSAGE_MISMATCH
NTSTATUS NTAPI ObCloseHandle(IN HANDLE Handle, IN KPROCESSOR_MODE AccessMode)
NTSTATUS NTAPI ObInsertObject(IN PVOID Object, IN PACCESS_STATE AccessState OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG ObjectPointerBias, OUT PVOID *NewObject OPTIONAL, OUT PHANDLE Handle)
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_YIELD(__stmt)
#define ProbeForWriteHandle(Ptr)
NTSTATUS NTAPI MmMapViewOfSection(IN PVOID SectionObject, IN PEPROCESS Process, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
PLPCP_PORT_OBJECT ClientPort
ULONG MaxConnectionInfoLength
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_PARAMETER
BOOL WINAPI ReplyMessage(_In_ LRESULT)
#define ObDereferenceObject
#define ObReferenceObject
#define PsGetCurrentProcess
_In_ KPROCESSOR_MODE PreviousMode