3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/lpc/listen.c
6 * PURPOSE: Communication mechanism
7 * PROGRAMMER: David Welch (welch@cwcom.net)
12 /* INCLUDES ******************************************************************/
16 #include <internal/debug.h>
18 /* FUNCTIONS *****************************************************************/
20 /**********************************************************************
25 * Listen on a named port and wait for a connection attempt.
28 * PortHandle [IN] LPC port to listen on.
30 * ConnectMsg [IN] User provided storage for a
31 * possible connection request LPC message.
34 * STATUS_SUCCESS if a connection request is received
35 * successfully; otherwise an error code.
37 * The buffer ConnectMessage is filled with the connection
38 * request message queued by NtConnectPort() in PortHandle.
42 /*EXPORTED*/ NTSTATUS STDCALL
43 NtListenPort (IN HANDLE PortHandle
,
44 IN PLPC_MESSAGE ConnectMsg
)
49 * Wait forever for a connection request.
53 Status
= NtReplyWaitReceivePort(PortHandle
,
58 * Accept only LPC_CONNECTION_REQUEST requests.
59 * Drop any other message.
61 if (!NT_SUCCESS(Status
) ||
62 LPC_CONNECTION_REQUEST
== ConnectMsg
->MessageType
)
64 DPRINT("Got message (type %x)\n", LPC_CONNECTION_REQUEST
);
67 DPRINT("Got message (type %x)\n", ConnectMsg
->MessageType
);