1 /* $Id: listen.c,v 1.4 2002/09/07 15:12:58 chorns Exp $
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 ******************************************************************/
17 #include <internal/debug.h>
20 /* FUNCTIONS *****************************************************************/
22 /**********************************************************************
27 * Listen on a named port and wait for a connection attempt.
30 * PortHandle [IN] LPC port to listen on.
32 * ConnectMsg [IN] User provided storage for a
33 * possible connection request LPC message.
36 * STATUS_SUCCESS if a connection request is received
37 * successfully; otherwise an error code.
39 * The buffer ConnectMessage is filled with the connection
40 * request message queued by NtConnectPort() in PortHandle.
46 NtListenPort (IN HANDLE PortHandle
,
47 IN PLPC_MESSAGE ConnectMsg
)
52 * Wait forever for a connection request.
56 Status
= NtReplyWaitReceivePort(PortHandle
,
61 * Accept only LPC_CONNECTION_REQUEST requests.
62 * Drop any other message.
64 if (!NT_SUCCESS(Status
) ||
65 LPC_CONNECTION_REQUEST
== ConnectMsg
->MessageType
)
67 DPRINT("Got message (type %x)\n", LPC_CONNECTION_REQUEST
);
70 DPRINT("Got message (type %x)\n", ConnectMsg
->MessageType
);