Added mapping of access rights
[reactos.git] / reactos / ntoskrnl / lpc / port.c
1 /* $Id: port.c,v 1.4 2001/01/28 17:38:12 ekohl 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
24 #define NDEBUG
25 #include <internal/debug.h>
26
27
28 /* GLOBALS *******************************************************************/
29
30 POBJECT_TYPE ExPortType = NULL;
31 ULONG EiNextLpcMessageId = 0;
32
33 static GENERIC_MAPPING ExpPortMapping = {
34 STANDARD_RIGHTS_READ,
35 STANDARD_RIGHTS_WRITE,
36 0,
37 PORT_ALL_ACCESS};
38
39 /* FUNCTIONS *****************************************************************/
40
41
42 NTSTATUS NiInitPort (VOID)
43 {
44 ExPortType = ExAllocatePool(NonPagedPool,sizeof(OBJECT_TYPE));
45
46 RtlInitUnicodeString(&ExPortType->TypeName,L"Port");
47
48 ExPortType->MaxObjects = ULONG_MAX;
49 ExPortType->MaxHandles = ULONG_MAX;
50 ExPortType->TotalObjects = 0;
51 ExPortType->TotalHandles = 0;
52 ExPortType->PagedPoolCharge = 0;
53 ExPortType->NonpagedPoolCharge = sizeof(EPORT);
54 ExPortType->Mapping = &ExpPortMapping;
55 ExPortType->Dump = NULL;
56 ExPortType->Open = NULL;
57 ExPortType->Close = NiClosePort;
58 ExPortType->Delete = NiDeletePort;
59 ExPortType->Parse = NULL;
60 ExPortType->Security = NULL;
61 ExPortType->QueryName = NULL;
62 ExPortType->OkayToClose = NULL;
63 ExPortType->Create = NiCreatePort;
64
65 EiNextLpcMessageId = 0;
66
67 return(STATUS_SUCCESS);
68 }
69
70
71 /**********************************************************************
72 * NAME INTERNAL
73 * NiInitializePort
74 *
75 * DESCRIPTION
76 * Initialize the EPORT object attributes. The Port
77 * object enters the inactive state.
78 *
79 * ARGUMENTS
80 * Port Pointer to an EPORT object to initialize.
81 *
82 * RETURN VALUE
83 * STATUS_SUCCESS if initialization succedeed. An error code
84 * otherwise.
85 */
86 NTSTATUS
87 STDCALL
88 NiInitializePort (
89 IN OUT PEPORT Port
90 )
91 {
92 memset (Port, 0, sizeof(EPORT));
93 KeInitializeSpinLock (& Port->Lock);
94 KeInitializeEvent (& Port->Event, SynchronizationEvent, FALSE);
95 Port->OtherPort = NULL;
96 Port->QueueLength = 0;
97 Port->ConnectQueueLength = 0;
98 Port->State = EPORT_INACTIVE;
99 InitializeListHead (& Port->QueueListHead);
100 InitializeListHead (& Port->ConnectQueueListHead);
101
102 return (STATUS_SUCCESS);
103 }
104
105
106 /* MISCELLANEA SYSTEM SERVICES */
107
108
109 /**********************************************************************
110 * NAME SYSTEM
111 * NtImpersonateClientOfPort@8
112 *
113 * DESCRIPTION
114 *
115 * ARGUMENTS
116 * PortHandle,
117 * ClientMessage
118 *
119 * RETURN VALUE
120 *
121 */
122 NTSTATUS
123 STDCALL
124 NtImpersonateClientOfPort (
125 HANDLE PortHandle,
126 PLPC_MESSAGE ClientMessage
127 )
128 {
129 UNIMPLEMENTED;
130 }
131
132
133
134 /* EOF */