Cleanup isn't necessary after calling the driver in NtQueryDirectoryFile.
[reactos.git] / reactos / ntoskrnl / lpc / listen.c
index bcd8bda..901c816 100644 (file)
@@ -1,24 +1,20 @@
-/* $Id: listen.c,v 1.2 2000/10/22 16:36:51 ekohl Exp $
- * 
+/* $Id$
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            ntoskrnl/lpc/listen.c
  * PURPOSE:         Communication mechanism
- * PROGRAMMER:      David Welch (welch@cwcom.net)
- * UPDATE HISTORY:
- *                  Created 22/05/98
+ *
+ * PROGRAMMERS:     David Welch (welch@cwcom.net)
  */
 
-/* INCLUDES *****************************************************************/
-
-#include <ddk/ntddk.h>
-#include <internal/ob.h>
-#include <internal/port.h>
-#include <internal/dbg.h>
+/* INCLUDES ******************************************************************/
 
+#include <ntoskrnl.h>
 #define NDEBUG
 #include <internal/debug.h>
 
+/* FUNCTIONS *****************************************************************/
 
 /**********************************************************************
  * NAME                                                        EXPORTED
  *     request message queued by NtConnectPort() in PortHandle.
  *
  * NOTE
- *     
  */
-EXPORTED
-NTSTATUS
-STDCALL
-NtListenPort (
-       IN      HANDLE          PortHandle,
-       IN      PLPC_MESSAGE    ConnectMsg
-       )
+/*EXPORTED*/ NTSTATUS STDCALL
+NtListenPort (IN       HANDLE          PortHandle,
+             IN        PPORT_MESSAGE   ConnectMsg)
 {
-       NTSTATUS        Status;
+  NTSTATUS     Status;
 
-       /*
-        * Wait forever for a connection request.
-        */
-       for (;;)
+  /*
+   * Wait forever for a connection request.
+   */
+  for (;;)
+    {
+      Status = NtReplyWaitReceivePort(PortHandle,
+                                     NULL,
+                                     NULL,
+                                     ConnectMsg);
+      /*
+       * Accept only LPC_CONNECTION_REQUEST requests.
+       * Drop any other message.
+       */
+      if (!NT_SUCCESS(Status) ||
+         LPC_CONNECTION_REQUEST == ConnectMsg->u2.s2.Type)
        {
-               Status = NtReplyWaitReceivePort (
-                               PortHandle,
-                               NULL,
-                               NULL,
-                               ConnectMsg
-                               );
-               /*
-                * Accept only LPC_CONNECTION_REQUEST requests.
-                * Drop any other message.
-                */
-               if (    !NT_SUCCESS(Status)
-                       || (LPC_CONNECTION_REQUEST == ConnectMsg->MessageType)
-                       )
-               {
-                       DPRINT("Got message (type %x)\n", LPC_CONNECTION_REQUEST);
-                       break;
-               }
-               DPRINT("Got message (type %x)\n", ConnectMsg->MessageType);
+         DPRINT("Got message (type %x)\n", LPC_CONNECTION_REQUEST);
+         break;
        }
+      DPRINT("Got message (type %x)\n", ConnectMsg->u2.s2.Type);
+    }
 
-       return (Status);
+  return (Status);
 }