2007-01-10 04:27:40 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Kernel
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
2000-06-04 17:27:39 +00:00
|
|
|
* FILE: ntoskrnl/lpc/port.c
|
2007-01-10 04:27:40 +00:00
|
|
|
* PURPOSE: Local Procedure Call: Port Management
|
|
|
|
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
|
2000-06-04 17:27:39 +00:00
|
|
|
*/
|
|
|
|
|
2007-01-10 04:27:40 +00:00
|
|
|
/* INCLUDES ******************************************************************/
|
2000-06-04 17:27:39 +00:00
|
|
|
|
2004-08-15 16:39:12 +00:00
|
|
|
#include <ntoskrnl.h>
|
2000-06-04 17:27:39 +00:00
|
|
|
#define NDEBUG
|
2007-01-10 06:09:57 +00:00
|
|
|
#include <debug.h>
|
2000-06-04 17:27:39 +00:00
|
|
|
|
|
|
|
/* GLOBALS *******************************************************************/
|
|
|
|
|
2007-01-10 04:27:40 +00:00
|
|
|
POBJECT_TYPE LpcPortObjectType;
|
|
|
|
ULONG LpcpMaxMessageSize;
|
|
|
|
PAGED_LOOKASIDE_LIST LpcpMessagesLookaside;
|
|
|
|
KGUARDED_MUTEX LpcpLock;
|
2007-01-21 22:43:32 +00:00
|
|
|
ULONG LpcpTraceLevel = 0;
|
2007-01-10 04:27:40 +00:00
|
|
|
ULONG LpcpNextMessageId = 1, LpcpNextCallbackId = 1;
|
2000-06-04 17:27:39 +00:00
|
|
|
|
2005-05-15 17:59:33 +00:00
|
|
|
static GENERIC_MAPPING LpcpPortMapping =
|
|
|
|
{
|
|
|
|
STANDARD_RIGHTS_READ,
|
|
|
|
STANDARD_RIGHTS_WRITE,
|
|
|
|
0,
|
|
|
|
PORT_ALL_ACCESS
|
|
|
|
};
|
2001-01-28 17:42:56 +00:00
|
|
|
|
2007-01-10 04:27:40 +00:00
|
|
|
/* PRIVATE FUNCTIONS *********************************************************/
|
2000-06-04 17:27:39 +00:00
|
|
|
|
2007-01-25 17:51:45 +00:00
|
|
|
BOOLEAN
|
2005-09-13 23:48:54 +00:00
|
|
|
NTAPI
|
2007-01-25 17:51:45 +00:00
|
|
|
LpcInitSystem(VOID)
|
2000-06-04 17:27:39 +00:00
|
|
|
{
|
2005-05-15 17:59:33 +00:00
|
|
|
OBJECT_TYPE_INITIALIZER ObjectTypeInitializer;
|
|
|
|
UNICODE_STRING Name;
|
|
|
|
|
2007-01-10 04:27:40 +00:00
|
|
|
/* Setup the LPC Lock */
|
|
|
|
KeInitializeGuardedMutex(&LpcpLock);
|
|
|
|
|
2005-05-15 21:39:10 +00:00
|
|
|
/* Create the Port Object Type */
|
2005-05-15 17:59:33 +00:00
|
|
|
RtlZeroMemory(&ObjectTypeInitializer, sizeof(ObjectTypeInitializer));
|
|
|
|
RtlInitUnicodeString(&Name, L"Port");
|
|
|
|
ObjectTypeInitializer.Length = sizeof(ObjectTypeInitializer);
|
2007-01-10 04:27:40 +00:00
|
|
|
ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(LPCP_PORT_OBJECT);
|
|
|
|
ObjectTypeInitializer.DefaultPagedPoolCharge = sizeof(LPCP_NONPAGED_PORT_QUEUE);
|
2005-05-15 17:59:33 +00:00
|
|
|
ObjectTypeInitializer.GenericMapping = LpcpPortMapping;
|
2007-01-10 04:27:40 +00:00
|
|
|
ObjectTypeInitializer.PoolType = PagedPool;
|
2005-05-15 17:59:33 +00:00
|
|
|
ObjectTypeInitializer.UseDefaultObject = TRUE;
|
|
|
|
ObjectTypeInitializer.CloseProcedure = LpcpClosePort;
|
|
|
|
ObjectTypeInitializer.DeleteProcedure = LpcpDeletePort;
|
2007-01-09 17:18:22 +00:00
|
|
|
ObjectTypeInitializer.ValidAccessMask = PORT_ALL_ACCESS;
|
2007-01-10 04:27:40 +00:00
|
|
|
ObCreateObjectType(&Name,
|
|
|
|
&ObjectTypeInitializer,
|
|
|
|
NULL,
|
|
|
|
&LpcPortObjectType);
|
|
|
|
|
|
|
|
/* Allocate the LPC lookaside list */
|
|
|
|
LpcpMaxMessageSize = LPCP_MAX_MESSAGE_SIZE;
|
|
|
|
ExInitializePagedLookasideList(&LpcpMessagesLookaside,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
LpcpMaxMessageSize,
|
2009-08-24 18:19:53 +00:00
|
|
|
'McpL',
|
2007-01-10 04:27:40 +00:00
|
|
|
32);
|
|
|
|
|
|
|
|
/* We're done */
|
2007-01-25 17:51:45 +00:00
|
|
|
return TRUE;
|
2000-06-04 17:27:39 +00:00
|
|
|
}
|
|
|
|
|
2007-01-10 04:27:40 +00:00
|
|
|
/* PUBLIC FUNCTIONS **********************************************************/
|
2000-06-04 17:27:39 +00:00
|
|
|
|
2007-01-10 04:27:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtImpersonateClientOfPort(IN HANDLE PortHandle,
|
|
|
|
IN PPORT_MESSAGE ClientMessage)
|
2000-06-04 17:27:39 +00:00
|
|
|
{
|
2007-01-10 04:27:40 +00:00
|
|
|
UNIMPLEMENTED;
|
|
|
|
return STATUS_NOT_IMPLEMENTED;
|
2000-06-04 17:27:39 +00:00
|
|
|
}
|
|
|
|
|
2006-10-23 20:49:52 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtQueryPortInformationProcess(VOID)
|
|
|
|
{
|
|
|
|
/* This is all this function does */
|
|
|
|
return STATUS_UNSUCCESSFUL;
|
|
|
|
}
|
|
|
|
|
2007-01-10 04:27:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtQueryInformationPort(IN HANDLE PortHandle,
|
|
|
|
IN PORT_INFORMATION_CLASS PortInformationClass,
|
|
|
|
OUT PVOID PortInformation,
|
|
|
|
IN ULONG PortInformationLength,
|
|
|
|
OUT PULONG ReturnLength)
|
|
|
|
{
|
|
|
|
UNIMPLEMENTED;
|
|
|
|
return STATUS_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
2000-06-04 17:27:39 +00:00
|
|
|
/* EOF */
|