ReactOS 0.4.16-dev-106-g10b08aa
lpc_x.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LpcpGetMessageType(x)    ((x)->u2.s2.Type &~ LPC_KERNELMODE_MESSAGE)
 
#define LpcpReceiveWait(s, w)
 
#define LpcpReplyWait(s, w)
 
#define LpcpConnectWait(s, w)
 
#define LpcpCompleteWait(s)
 

Functions

static __inline PLPCP_MESSAGE LpcpAllocateFromPortZone (VOID)
 
FORCEINLINE PLPCP_MESSAGE LpcpGetMessageFromThread (IN PETHREAD Thread)
 
FORCEINLINE PLPCP_PORT_OBJECT LpcpGetPortFromThread (IN PETHREAD Thread)
 
FORCEINLINE VOID LpcpSetPortToThread (IN PETHREAD Thread, IN PLPCP_PORT_OBJECT Port)
 
FORCEINLINE PLPCP_DATA_INFO LpcpGetDataInfoFromMessage (PPORT_MESSAGE Message)
 

Macro Definition Documentation

◆ LpcpCompleteWait

#define LpcpCompleteWait (   s)
Value:
{ \
/* Release the semaphore */ \
LPCTRACE(LPC_SEND_DEBUG, "Release: %p\n", s); \
KeReleaseSemaphore(s, 1, 1, FALSE); \
}
#define FALSE
Definition: types.h:117
GLdouble s
Definition: gl.h:2039
#define LPC_SEND_DEBUG
Definition: lpc.h:23

Definition at line 88 of file lpc_x.h.

◆ LpcpConnectWait

#define LpcpConnectWait (   s,
  w 
)
Value:
{ \
LPCTRACE(LPC_CONNECT_DEBUG, "Wait: %p\n", s); \
w, \
FALSE, \
NULL); \
LPCTRACE(LPC_CONNECT_DEBUG, "Wait done: %lx\n", Status);\
{ \
/* We were preempted by an APC */ \
{ \
/* It's still signaled, so wait on it */ \
KeWaitForSingleObject(s, \
FALSE, \
NULL); \
} \
} \
}
#define NULL
Definition: types.h:112
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
Status
Definition: gdiplustypes.h:25
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
#define LPC_CONNECT_DEBUG
Definition: lpc.h:19
#define KernelMode
Definition: asm.h:34
#define STATUS_USER_APC
Definition: ntstatus.h:78
LONG NTAPI KeReadStateSemaphore(IN PKSEMAPHORE Semaphore)
Definition: semphobj.c:41
#define STATUS_SUCCESS
Definition: shellext.h:65
@ WrExecutive
Definition: ketypes.h:422
@ Executive
Definition: ketypes.h:415

Definition at line 60 of file lpc_x.h.

◆ LpcpGetMessageType

#define LpcpGetMessageType (   x)     ((x)->u2.s2.Type &~ LPC_KERNELMODE_MESSAGE)

Definition at line 12 of file lpc_x.h.

◆ LpcpReceiveWait

#define LpcpReceiveWait (   s,
  w 
)
Value:
{ \
LPCTRACE(LPC_REPLY_DEBUG, "Wait: %p\n", s); \
w, \
FALSE, \
NULL); \
LPCTRACE(LPC_REPLY_DEBUG, "Wait done: %lx\n", Status); \
}
#define LPC_REPLY_DEBUG
Definition: lpc.h:21
@ WrLpcReceive
Definition: ketypes.h:431

Definition at line 18 of file lpc_x.h.

◆ LpcpReplyWait

#define LpcpReplyWait (   s,
  w 
)
Value:
{ \
LPCTRACE(LPC_SEND_DEBUG, "Wait: %p\n", s); \
w, \
FALSE, \
NULL); \
LPCTRACE(LPC_SEND_DEBUG, "Wait done: %lx\n", Status); \
{ \
/* We were preempted by an APC */ \
{ \
/* It's still signaled, so wait on it */ \
KeWaitForSingleObject(s, \
FALSE, \
NULL); \
} \
} \
}
@ WrLpcReply
Definition: ketypes.h:432

Definition at line 32 of file lpc_x.h.

Function Documentation

◆ LpcpAllocateFromPortZone()

static __inline PLPCP_MESSAGE LpcpAllocateFromPortZone ( VOID  )
static

Definition at line 100 of file lpc_x.h.

101{
103
104 /* Allocate a message from the port zone while holding the lock */
106 Message = (PLPCP_MESSAGE)ExAllocateFromPagedLookasideList(&LpcpMessagesLookaside);
107 if (!Message)
108 {
109 /* Fail, and let caller cleanup */
111 return NULL;
112 }
113
114 /* Initialize it */
116 Message->RepliedToThread = NULL;
117 Message->Request.u2.ZeroInit = 0;
118
119 /* Release the lock */
121 return Message;
122}
static const WCHAR Message[]
Definition: register.c:74
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
VOID FASTCALL KeReleaseGuardedMutex(IN OUT PKGUARDED_MUTEX GuardedMutex)
Definition: gmutex.c:53
VOID FASTCALL KeAcquireGuardedMutex(IN PKGUARDED_MUTEX GuardedMutex)
Definition: gmutex.c:42
KGUARDED_MUTEX LpcpLock
Definition: port.c:20
PAGED_LOOKASIDE_LIST LpcpMessagesLookaside
Definition: port.c:19
struct _LPCP_MESSAGE * PLPCP_MESSAGE

Referenced by LpcRequestPort(), LpcRequestWaitReplyPort(), NtReplyPort(), NtReplyWaitReceivePortEx(), NtRequestPort(), NtRequestWaitReplyPort(), and NtSecureConnectPort().

◆ LpcpGetDataInfoFromMessage()

FORCEINLINE PLPCP_DATA_INFO LpcpGetDataInfoFromMessage ( PPORT_MESSAGE  Message)

Definition at line 170 of file lpc_x.h.

171{
172 return (PLPCP_DATA_INFO)((PUCHAR)Message + Message->u2.s2.DataInfoOffset);
173}
unsigned char * PUCHAR
Definition: typedefs.h:53

Referenced by LpcpCopyRequestData(), LpcpVerifyMessageDataInfo(), and NtRequestWaitReplyPort().

◆ LpcpGetMessageFromThread()

FORCEINLINE PLPCP_MESSAGE LpcpGetMessageFromThread ( IN PETHREAD  Thread)

Definition at line 129 of file lpc_x.h.

130{
131 /* Check if the port flag is set */
132 if (((ULONG_PTR)Thread->LpcReplyMessage) & LPCP_THREAD_FLAG_IS_PORT)
133 {
134 /* The pointer is actually a port, not a message, so return NULL */
135 return NULL;
136 }
137
138 /* Otherwise, this is a message. Return the pointer */
139 return (PLPCP_MESSAGE)((ULONG_PTR)Thread->LpcReplyMessage & ~LPCP_THREAD_FLAGS);
140}
#define ULONG_PTR
Definition: config.h:101
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
#define LPCP_THREAD_FLAG_IS_PORT
Definition: lpc.h:55
#define LPCP_THREAD_FLAGS
Definition: lpc.h:57
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by LpcExitThread(), LpcpDestroyPortQueue(), LpcpFreeConMsg(), LpcRequestWaitReplyPort(), NtAcceptConnectPort(), NtCompleteConnectPort(), NtReplyPort(), NtReplyWaitReceivePortEx(), and NtRequestWaitReplyPort().

◆ LpcpGetPortFromThread()

FORCEINLINE PLPCP_PORT_OBJECT LpcpGetPortFromThread ( IN PETHREAD  Thread)

Definition at line 144 of file lpc_x.h.

145{
146 /* Check if the port flag is set */
147 if (((ULONG_PTR)Thread->LpcReplyMessage) & LPCP_THREAD_FLAG_IS_PORT)
148 {
149 /* The pointer is actually a port, return it */
150 return (PLPCP_PORT_OBJECT)((ULONG_PTR)Thread->LpcWaitingOnPort &
152 }
153
154 /* Otherwise, this is a message. There is nothing to return */
155 return NULL;
156}

Referenced by LpcpValidateClientPort().

◆ LpcpSetPortToThread()

FORCEINLINE VOID LpcpSetPortToThread ( IN PETHREAD  Thread,
IN PLPCP_PORT_OBJECT  Port 
)

Definition at line 160 of file lpc_x.h.

162{
163 /* Set the port object */
164 Thread->LpcWaitingOnPort = (PVOID)(((ULONG_PTR)Port) |
166}
CPPORT Port[4]
Definition: headless.c:35
void * PVOID
Definition: typedefs.h:50

Referenced by LpcRequestWaitReplyPort(), and NtRequestWaitReplyPort().