- Implement NtListenPort as a wrapper around NtReplyWaitReceivePort that only listens for connection requests. SMSS can now do this.

svn path=/trunk/; revision=24668
This commit is contained in:
Alex Ionescu 2006-10-30 14:32:18 +00:00
parent 850c098196
commit fa1547f01d
2 changed files with 25 additions and 3 deletions

View file

@ -23,8 +23,30 @@ NTAPI
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;
}

View file

@ -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