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