ReactOS  0.4.13-dev-443-g10f00f8
listen.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
Include dependency graph for listen.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS NTAPI NtListenPort (IN HANDLE PortHandle, OUT PPORT_MESSAGE ConnectMessage)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file listen.c.

Function Documentation

◆ NtListenPort()

NTSTATUS NTAPI NtListenPort ( IN HANDLE  PortHandle,
OUT PPORT_MESSAGE  ConnectMessage 
)

Definition at line 22 of file listen.c.

24 {
26 
27  PAGED_CODE();
28  LPCTRACE(LPC_LISTEN_DEBUG, "Handle: %p\n", PortHandle);
29 
30  /* Wait forever for a connection request */
31  for (;;)
32  {
33  /* Do the wait */
34  Status = NtReplyWaitReceivePort(PortHandle,
35  NULL,
36  NULL,
37  ConnectMessage);
38 
39  _SEH2_TRY
40  {
41  /* Accept only LPC_CONNECTION_REQUEST requests */
42  if ((Status != STATUS_SUCCESS) ||
43  (LpcpGetMessageType(ConnectMessage) == LPC_CONNECTION_REQUEST))
44  {
45  /* Break out */
46  _SEH2_YIELD(break);
47  }
48  }
50  {
52  _SEH2_YIELD(break);
53  }
54  _SEH2_END;
55  }
56 
57  /* Return status */
58  return Status;
59 }
#define LpcpGetMessageType(x)
Definition: lpc_x.h:12
#define LPC_LISTEN_DEBUG
Definition: lpc.h:20
LONG NTSTATUS
Definition: precomp.h:26
#define PAGED_CODE()
Definition: video.h:57
_SEH2_TRY
Definition: create.c:4250
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
NTSTATUS NTAPI NtReplyWaitReceivePort(IN HANDLE PortHandle, OUT PVOID *PortContext OPTIONAL, IN PPORT_MESSAGE ReplyMessage OPTIONAL, OUT PPORT_MESSAGE ReceiveMessage)
Definition: reply.c:743
Status
Definition: gdiplustypes.h:24
_SEH2_END
Definition: create.c:4424
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define LPCTRACE(x, fmt,...)
Definition: lpc.h:49

Referenced by InitLogPort(), LsapRmServerThread(), main(), and ServerThread().