Author: ion
Date: Mon Oct 30 17:32:18 2006
New Revision: 24668
URL:
http://svn.reactos.org/svn/reactos?rev=24668&view=rev
Log:
- Implement NtListenPort as a wrapper around NtReplyWaitReceivePort that only listens for
connection requests. SMSS can now do this.
Modified:
trunk/reactos/ntoskrnl/lpc/ntlpc/listen.c
trunk/reactos/ntoskrnl/lpc/ntlpc/lpc.h
Modified: trunk/reactos/ntoskrnl/lpc/ntlpc/listen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/lpc/ntlpc/listen.…
==============================================================================
--- trunk/reactos/ntoskrnl/lpc/ntlpc/listen.c (original)
+++ trunk/reactos/ntoskrnl/lpc/ntlpc/listen.c Mon Oct 30 17:32:18 2006
@@ -23,8 +23,30 @@
NtListenPort(IN HANDLE PortHandle,
OUT PPORT_MESSAGE ConnectMessage)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ NTSTATUS Status;
+ PAGED_CODE();
+ LPCTRACE(LPC_LISTEN_DEBUG, "Handle: %lx\n", PortHandle);
+
+ /* Wait forever for a connection request. */
+ for (;;)
+ {
+ /* Do the wait */
+ Status = NtReplyWaitReceivePort(PortHandle,
+ NULL,
+ NULL,
+ ConnectMessage);
+
+ /* Accept only LPC_CONNECTION_REQUEST requests. */
+ if ((Status != STATUS_SUCCESS) ||
+ (LpcpGetMessageType(ConnectMessage) == LPC_CONNECTION_REQUEST))
+ {
+ /* Break out */
+ break;
+ }
+ }
+
+ /* Return status */
+ return Status;
}
Modified: trunk/reactos/ntoskrnl/lpc/ntlpc/lpc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/lpc/ntlpc/lpc.h?r…
==============================================================================
--- trunk/reactos/ntoskrnl/lpc/ntlpc/lpc.h (original)
+++ trunk/reactos/ntoskrnl/lpc/ntlpc/lpc.h Mon Oct 30 17:32:18 2006
@@ -51,7 +51,7 @@
// Gets the message type, removing the kernel-mode flag
//
#define LpcpGetMessageType(x) \
- ((x)->u2.s2.MessageType &~ LPCP_KERNEL_MESSAGE)
+ ((x)->u2.s2.Type &~ LPCP_KERNEL_MESSAGE)
//
// Waits on an LPC semaphore for a receive operation