1 /* 2 * PROJECT: ReactOS Kernel 3 * LICENSE: GPL - See COPYING in the top level directory 4 * FILE: ntoskrnl/lpc/listen.c 5 * PURPOSE: Local Procedure Call: Listening 6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) 7 */ 8 9 /* INCLUDES ******************************************************************/ 10 11 #include <ntoskrnl.h> 12 #define NDEBUG 13 #include <debug.h> 14 15 /* PUBLIC FUNCTIONS **********************************************************/ 16 17 /* 18 * @implemented 19 */ 20 NTSTATUS 21 NTAPI 22 NtListenPort(IN HANDLE PortHandle, 23 OUT PPORT_MESSAGE ConnectMessage) 24 { 25 NTSTATUS Status; 26 PAGED_CODE(); 27 LPCTRACE(LPC_LISTEN_DEBUG, "Handle: %lx\n", PortHandle); 28 29 /* Wait forever for a connection request. */ 30 for (;;) 31 { 32 /* Do the wait */ 33 Status = NtReplyWaitReceivePort(PortHandle, 34 NULL, 35 NULL, 36 ConnectMessage); 37 38 /* Accept only LPC_CONNECTION_REQUEST requests. */ 39 if ((Status != STATUS_SUCCESS) || 40 (LpcpGetMessageType(ConnectMessage) == LPC_CONNECTION_REQUEST)) 41 { 42 /* Break out */ 43 break; 44 } 45 } 46 47 /* Return status */ 48 return Status; 49 } 50 51 52 /* EOF */ 53