36 if (LpcMessage->u2.s2.Type)
66 if (((
ULONG)LpcMessage->u1.s1.TotalLength >
Port->MaxMessageLength) ||
67 ((
ULONG)LpcMessage->u1.s1.TotalLength <= (
ULONG)LpcMessage->u1.s1.DataLength))
95 QueuePort =
Port->ConnectedPort;
102 Message->PortContext = QueuePort->PortContext;
103 ConnectionPort = QueuePort =
Port->ConnectionPort;
114 ConnectionPort = QueuePort =
Port->ConnectionPort;
130 QueuePort = PortObject;
139 Message->Request.CallbackId = 0;
142 Thread->LpcReplyMessageId = 0;
195 "Port: %p. Messages: %p/%p. Type: %lx\n",
232 LpcRequest->u2.s2.Type = MessageType;
235 if (((
ULONG)LpcRequest->u1.s1.TotalLength >
Port->MaxMessageLength) ||
236 ((
ULONG)LpcRequest->u1.s1.TotalLength <= (
ULONG)LpcRequest->u1.s1.DataLength))
277 QueuePort =
Port->ConnectedPort;
286 ReplyPort = QueuePort;
293 ConnectionPort = QueuePort =
Port->ConnectionPort;
305 ConnectionPort = QueuePort =
Port->ConnectionPort;
320 QueuePort = ReplyPort =
Port;
330 Message->Request.CallbackId = 0;
367 Thread->LpcReplyMessageId = 0;
387 "Reply Messages: %p/%p\n",
426 "Port: %p. Status: %d\n",
460 CapturedLpcRequest = *(
volatile PORT_MESSAGE*)LpcRequest;
471 CapturedLpcRequest = *LpcRequest;
475 "Handle: %p. Message: %p. Type: %lx\n",
481 MessageType = CapturedLpcRequest.u2.s2.Type |
LPC_DATAGRAM;
488 (
ULONG)CapturedLpcRequest.u1.s1.TotalLength)
504 if (((
ULONG)CapturedLpcRequest.u1.s1.TotalLength >
Port->MaxMessageLength) ||
505 ((
ULONG)CapturedLpcRequest.u1.s1.TotalLength <= (
ULONG)CapturedLpcRequest.u1.s1.DataLength))
550 QueuePort =
Port->ConnectedPort;
564 ConnectionPort = QueuePort =
Port->ConnectionPort;
576 ConnectionPort = QueuePort =
Port->ConnectionPort;
604 Message->Request.CallbackId = 0;
607 Thread->LpcReplyMessageId = 0;
638 "Port: %p. Status: %d\n",
660 if (
Message->u2.s2.DataInfoOffset == 0)
662 *NumberOfDataEntries = 0;
702 ULONG NumberOfDataEntries;
725 CapturedLpcRequest = *(
volatile PORT_MESSAGE*)LpcRequest;
734 DPRINT1(
"LpcpVerifyMessageDataInfo failed\n");
747 CapturedLpcRequest = *LpcRequest;
751 DPRINT1(
"LpcpVerifyMessageDataInfo failed\n");
757 "Handle: %p. Messages: %p/%p. Type: %lx\n",
764 CapturedLpcRequest.u2.s2.Type &= ~0x4000;
775 DPRINT1(
"Not a kernel-mode message!\n");
786 MessageType = CapturedLpcRequest.u2.s2.Type;
789 ASSERT(CapturedLpcRequest.u1.s1.TotalLength >= 0);
793 (
ULONG)CapturedLpcRequest.u1.s1.TotalLength))
796 DPRINT1(
"Invalid message length: %u, %u\n",
797 CapturedLpcRequest.u1.s1.DataLength,
798 CapturedLpcRequest.u1.s1.TotalLength);
812 if (((
ULONG)CapturedLpcRequest.u1.s1.TotalLength >
Port->MaxMessageLength) ||
813 ((
ULONG)CapturedLpcRequest.u1.s1.TotalLength <= (
ULONG)CapturedLpcRequest.u1.s1.DataLength))
816 DPRINT1(
"Invalid message length: %u, %u\n",
817 CapturedLpcRequest.u1.s1.DataLength,
818 CapturedLpcRequest.u1.s1.TotalLength);
828 DPRINT1(
"Failed to allocate a message!\n");
846 if (LpcRequest->u2.s2.DataInfoOffset != 0)
855 DPRINT1(
"NumberOfEntries has changed: %u, %u\n",
888 QueuePort =
Port->ConnectedPort;
892 DPRINT1(
"No connected port\n");
899 ReplyPort = QueuePort;
911 ConnectionPort = QueuePort =
Port->ConnectionPort;
915 DPRINT1(
"No connection port\n");
928 QueuePort = ReplyPort =
Port;
938 Message->Request.CallbackId = 0;
975 Thread->LpcReplyMessageId = 0;
995 "Reply Messages: %p/%p\n",
1017 (
Message->Request.u2.s2.DataInfoOffset))
1042 "Port: %p. Status: %d\n",
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
static const WCHAR Message[]
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define PsGetCurrentThread()
#define KeSetEvent(pEvt, foo, foo2)
#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)
_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
#define KeLeaveCriticalRegion()
#define KeEnterCriticalRegion()
VOID NTAPI LpcpFreeToPortZone(IN PLPCP_MESSAGE Message, IN ULONG LockFlags)
VOID NTAPI LpcpMoveMessage(IN PPORT_MESSAGE Destination, IN PPORT_MESSAGE Origin, IN PVOID Data, IN ULONG MessageType, IN PCLIENT_ID ClientId)
VOID NTAPI LpcpSaveDataInfoMessage(IN PLPCP_PORT_OBJECT Port, IN PLPCP_MESSAGE Message, IN ULONG LockFlags)
POBJECT_TYPE LpcPortObjectType
#define LPCTRACE(x, fmt,...)
#define LPCP_LOCK_RELEASE
#define LpcpReplyWait(s, w)
#define LpcpGetMessageType(x)
FORCEINLINE VOID LpcpSetPortToThread(IN PETHREAD Thread, IN PLPCP_PORT_OBJECT Port)
#define LpcpCompleteWait(s)
FORCEINLINE PLPCP_MESSAGE LpcpGetMessageFromThread(IN PETHREAD Thread)
FORCEINLINE PLPCP_DATA_INFO LpcpGetDataInfoFromMessage(PPORT_MESSAGE Message)
static __inline PLPCP_MESSAGE LpcpAllocateFromPortZone(VOID)
#define LPCP_COMMUNICATION_PORT
#define LPCP_CONNECTION_PORT
struct _LPCP_PORT_OBJECT * PLPCP_PORT_OBJECT
#define LPCP_WAITABLE_PORT
#define LPCP_PORT_TYPE_MASK
#define KeGetPreviousMode()
#define LPC_KERNELMODE_MESSAGE
NTSTATUS NTAPI NtRequestPort(IN HANDLE PortHandle, IN PPORT_MESSAGE LpcRequest)
NTSTATUS NTAPI LpcRequestPort(IN PVOID PortObject, IN PPORT_MESSAGE LpcMessage)
NTSTATUS NTAPI LpcpVerifyMessageDataInfo(_In_ PPORT_MESSAGE Message, _Out_ PULONG NumberOfDataEntries)
NTSTATUS NTAPI NtRequestWaitReplyPort(IN HANDLE PortHandle, IN PPORT_MESSAGE LpcRequest, IN OUT PPORT_MESSAGE LpcReply)
NTSTATUS NTAPI LpcRequestWaitReplyPort(IN PVOID PortObject, IN PPORT_MESSAGE LpcRequest, OUT PPORT_MESSAGE LpcReply)
#define STATUS_THREAD_IS_TERMINATING
#define STATUS_PORT_MESSAGE_TOO_LONG
#define STATUS_PORT_DISCONNECTED
#define STATUS_LPC_REPLY_LOST
BOOLEAN FASTCALL ObReferenceObjectSafe(IN 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)
ULONG LpcExitThreadCalled
struct _LPCP_DATA_INFO::@1794 Entries[1]
LIST_ENTRY LpcReplyChainHead
#define STATUS_INVALID_PARAMETER
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
#define ObDereferenceObject
#define ObReferenceObject
_In_ KPROCESSOR_MODE PreviousMode