Implemented LPC sections
[reactos.git] / reactos / ntoskrnl / lpc / complete.c
1 /* $Id: complete.c,v 1.5 2001/12/02 23:34:42 dwelch Exp $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/lpc/complete.c
6 * PURPOSE: Communication mechanism
7 * PROGRAMMER: David Welch (welch@cwcom.net)
8 * UPDATE HISTORY:
9 * Created 22/05/98
10 */
11
12 /* INCLUDES ******************************************************************/
13
14 #include <ddk/ntddk.h>
15 #include <internal/ob.h>
16 #include <internal/port.h>
17 #include <internal/dbg.h>
18
19 #define NDEBUG
20 #include <internal/debug.h>
21
22 /* FUNCTIONS *****************************************************************/
23
24 /***********************************************************************
25 * NAME EXPORTED
26 * NtCompleteConnectPort@4
27 *
28 *
29 */
30 EXPORTED NTSTATUS STDCALL
31 NtCompleteConnectPort (HANDLE PortHandle)
32 {
33 NTSTATUS Status;
34 PEPORT OurPort;
35
36 DPRINT("NtCompleteConnectPort(PortHandle %x)\n", PortHandle);
37
38 Status = ObReferenceObjectByHandle (PortHandle,
39 PORT_ALL_ACCESS,
40 ExPortType,
41 UserMode,
42 (PVOID*)&OurPort,
43 NULL);
44 if (!NT_SUCCESS(Status))
45 {
46 return (Status);
47 }
48
49 OurPort->State = EPORT_CONNECTED_SERVER;
50
51 KeReleaseSemaphore(&OurPort->OtherPort->Semaphore, IO_NO_INCREMENT, 1,
52 FALSE);
53
54 ObDereferenceObject (OurPort);
55
56 return (STATUS_SUCCESS);
57 }
58
59
60 /* EOF */