@implemented and @unimplemented comments for ntoskrnl/lpc/*.c
[reactos.git] / reactos / ntoskrnl / lpc / port.c
1 /* $Id: port.c,v 1.12 2003/07/10 20:42:53 royce Exp $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/lpc/port.c
6 * PURPOSE: Communication mechanism
7 * PROGRAMMER: David Welch (welch@cwcom.net)
8 * UPDATE HISTORY:
9 * Created 22/05/98
10 *
11 * 2000-06-04 (ea)
12 * ntoskrnl/nt/port.c moved in ntoskrnl/lpc/port.c
13 */
14
15 /* INCLUDES *****************************************************************/
16
17 #include <limits.h>
18
19 #include <ddk/ntddk.h>
20 #include <internal/ob.h>
21 #include <internal/port.h>
22 #include <internal/dbg.h>
23 #include <internal/pool.h>
24
25 #define NDEBUG
26 #include <internal/debug.h>
27
28
29 /* GLOBALS *******************************************************************/
30
31 POBJECT_TYPE ExPortType = NULL;
32 ULONG EiNextLpcMessageId = 0;
33
34 static GENERIC_MAPPING ExpPortMapping = {
35 STANDARD_RIGHTS_READ,
36 STANDARD_RIGHTS_WRITE,
37 0,
38 PORT_ALL_ACCESS};
39
40 /* FUNCTIONS *****************************************************************/
41
42
43 NTSTATUS NiInitPort (VOID)
44 {
45 ExPortType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
46
47 RtlInitUnicodeStringFromLiteral(&ExPortType->TypeName,L"Port");
48
49 ExPortType->Tag = TAG('L', 'P', 'R', 'T');
50 ExPortType->MaxObjects = ULONG_MAX;
51 ExPortType->MaxHandles = ULONG_MAX;
52 ExPortType->TotalObjects = 0;
53 ExPortType->TotalHandles = 0;
54 ExPortType->PagedPoolCharge = 0;
55 ExPortType->NonpagedPoolCharge = sizeof(EPORT);
56 ExPortType->Mapping = &ExpPortMapping;
57 ExPortType->Dump = NULL;
58 ExPortType->Open = NULL;
59 ExPortType->Close = NiClosePort;
60 ExPortType->Delete = NiDeletePort;
61 ExPortType->Parse = NULL;
62 ExPortType->Security = NULL;
63 ExPortType->QueryName = NULL;
64 ExPortType->OkayToClose = NULL;
65 ExPortType->Create = NiCreatePort;
66 ExPortType->DuplicationNotify = NULL;
67
68 EiNextLpcMessageId = 0;
69
70 return(STATUS_SUCCESS);
71 }
72
73
74 /**********************************************************************
75 * NAME INTERNAL
76 * NiInitializePort
77 *
78 * DESCRIPTION
79 * Initialize the EPORT object attributes. The Port
80 * object enters the inactive state.
81 *
82 * ARGUMENTS
83 * Port Pointer to an EPORT object to initialize.
84 *
85 * RETURN VALUE
86 * STATUS_SUCCESS if initialization succedeed. An error code
87 * otherwise.
88 *
89 * @implemented
90 */
91 NTSTATUS STDCALL
92 NiInitializePort (IN OUT PEPORT Port)
93 {
94 memset (Port, 0, sizeof(EPORT));
95 KeInitializeSpinLock (& Port->Lock);
96 KeInitializeSemaphore( &Port->Semaphore, 0, LONG_MAX );
97 Port->OtherPort = NULL;
98 Port->QueueLength = 0;
99 Port->ConnectQueueLength = 0;
100 Port->State = EPORT_INACTIVE;
101 InitializeListHead (& Port->QueueListHead);
102 InitializeListHead (& Port->ConnectQueueListHead);
103
104 return (STATUS_SUCCESS);
105 }
106
107
108 /* MISCELLANEA SYSTEM SERVICES */
109
110
111 /**********************************************************************
112 * NAME SYSTEM
113 * NtImpersonateClientOfPort@8
114 *
115 * DESCRIPTION
116 *
117 * ARGUMENTS
118 * PortHandle,
119 * ClientMessage
120 *
121 * RETURN VALUE
122 *
123 * @unimplemented
124 */
125 NTSTATUS STDCALL
126 NtImpersonateClientOfPort (HANDLE PortHandle,
127 PLPC_MESSAGE ClientMessage)
128 {
129 UNIMPLEMENTED;
130 }
131
132
133
134 /* EOF */