51 ULONG ConnectionInfoLength;
64 "Context: %p. Message: %p. Accept: %lx. Views: %p/%p\n",
82 ConnectionInfoLength = CapturedReplyMessage.u1.s1.DataLength;
93 CapturedServerView = *(
volatile PORT_VIEW*)ServerView;
96 if (CapturedServerView.
Length !=
sizeof(CapturedServerView))
126 ConnectionInfoLength = CapturedReplyMessage.u1.s1.DataLength;
132 if (ServerView->Length !=
sizeof(*ServerView))
137 CapturedServerView = *ServerView;
144 if (ClientView->Length !=
sizeof(*ClientView))
207 Message->Request.u1.s1.DataLength = (
CSHORT)ConnectionInfoLength +
210 Message->Request.u1.s1.DataLength;
214 Message->Request.u2.s2.DataInfoOffset = 0;
217 Message->Request.ClientViewSize = 0;
231 if (!AcceptConnection)
233 DPRINT1(
"LPC connection was refused\n");
253 ServerPort->MaxMessageLength = ConnectionPort->MaxMessageLength;
271 ClientSectionToMap = ConnectMessage->SectionToMap;
272 ConnectMessage->SectionToMap =
NULL;
276 if (ClientSectionToMap)
279 SectionOffset.QuadPart = ConnectMessage->ClientView.SectionOffset;
288 &ConnectMessage->ClientView.ViewSize,
294 ConnectMessage->ClientView.SectionOffset =
SectionOffset.LowPart;
298 ConnectMessage->ClientView.ViewRemoteBase =
ServerPort->
311 "View base, offset, size: %p %lx %p\n",
313 ConnectMessage->ClientView.ViewSize,
351 ClientView->ViewBase = ConnectMessage->ClientView.ViewRemoteBase;
352 ClientView->ViewSize = ConnectMessage->ClientView.ViewSize;
369 "Handle: %p. Messages: %p/%p. Ports: %p/%p/%p\n",
409 "Status: %lx. Thread: %p. Process: [%.16s]\n",
412 ClientProcess->ImageFileName);
454 if (!
Port->ClientThread)
static const INTERNET_PORT ServerPort
UINT CALLBACK ClientThread(_Inout_ PVOID Parameter)
VOID NTAPI LpcpPrepareToWakeClient(IN PETHREAD Thread)
NTSTATUS NTAPI NtAcceptConnectPort(OUT PHANDLE PortHandle, IN PVOID PortContext OPTIONAL, IN PPORT_MESSAGE ReplyMessage, IN BOOLEAN AcceptConnection, IN OUT PPORT_VIEW ServerView OPTIONAL, OUT PREMOTE_PORT_VIEW ClientView OPTIONAL)
NTSTATUS NTAPI NtCompleteConnectPort(IN HANDLE PortHandle)
#define NT_SUCCESS(StatCode)
static const WCHAR Message[]
static const WCHAR Cleanup[]
#define RemoveEntryList(Entry)
#define IsListEmpty(ListHead)
#define PsGetCurrentThread()
#define InitializeListHead(ListHead)
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
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
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
#define LPCP_PORT_TYPE_MASK
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_INVALID_PORT_HANDLE
#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)
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
#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)
PULONG MinorVersion OPTIONAL
ULONG LpcExitThreadCalled
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