ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

port.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:         ReactOS Kernel
00003  * LICENSE:         GPL - See COPYING in the top level directory
00004  * FILE:            ntoskrnl/lpc/port.c
00005  * PURPOSE:         Local Procedure Call: Port Management
00006  * PROGRAMMERS:     Alex Ionescu (alex.ionescu@reactos.org)
00007  */
00008 
00009 /* INCLUDES ******************************************************************/
00010 
00011 #include <ntoskrnl.h>
00012 #define NDEBUG
00013 #include <debug.h>
00014 
00015 /* GLOBALS *******************************************************************/
00016 
00017 POBJECT_TYPE LpcPortObjectType;
00018 ULONG LpcpMaxMessageSize;
00019 PAGED_LOOKASIDE_LIST LpcpMessagesLookaside;
00020 KGUARDED_MUTEX LpcpLock;
00021 ULONG LpcpTraceLevel = 0;
00022 ULONG LpcpNextMessageId = 1, LpcpNextCallbackId = 1;
00023 
00024 static GENERIC_MAPPING LpcpPortMapping = 
00025 {
00026     STANDARD_RIGHTS_READ,
00027     STANDARD_RIGHTS_WRITE,
00028     0,
00029     PORT_ALL_ACCESS
00030 };
00031 
00032 /* PRIVATE FUNCTIONS *********************************************************/
00033 
00034 BOOLEAN
00035 NTAPI
00036 INIT_FUNCTION
00037 LpcInitSystem(VOID)
00038 {
00039     OBJECT_TYPE_INITIALIZER ObjectTypeInitializer;
00040     UNICODE_STRING Name;
00041 
00042     /* Setup the LPC Lock */
00043     KeInitializeGuardedMutex(&LpcpLock);
00044 
00045     /* Create the Port Object Type */
00046     RtlZeroMemory(&ObjectTypeInitializer, sizeof(ObjectTypeInitializer));
00047     RtlInitUnicodeString(&Name, L"Port");
00048     ObjectTypeInitializer.Length = sizeof(ObjectTypeInitializer);
00049     ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(LPCP_PORT_OBJECT);
00050     ObjectTypeInitializer.DefaultPagedPoolCharge = sizeof(LPCP_NONPAGED_PORT_QUEUE);
00051     ObjectTypeInitializer.GenericMapping = LpcpPortMapping;
00052     ObjectTypeInitializer.PoolType = PagedPool;
00053     ObjectTypeInitializer.UseDefaultObject = TRUE;
00054     ObjectTypeInitializer.CloseProcedure = LpcpClosePort;
00055     ObjectTypeInitializer.DeleteProcedure = LpcpDeletePort;
00056     ObjectTypeInitializer.ValidAccessMask = PORT_ALL_ACCESS;
00057     ObCreateObjectType(&Name,
00058                        &ObjectTypeInitializer,
00059                        NULL,
00060                        &LpcPortObjectType);
00061 
00062     /* Allocate the LPC lookaside list */
00063     LpcpMaxMessageSize = LPCP_MAX_MESSAGE_SIZE;
00064     ExInitializePagedLookasideList(&LpcpMessagesLookaside,
00065                                    NULL,
00066                                    NULL,
00067                                    0,
00068                                    LpcpMaxMessageSize,
00069                                    'McpL',
00070                                    32);
00071 
00072     /* We're done */
00073     return TRUE;
00074 }
00075 
00076 /* PUBLIC FUNCTIONS **********************************************************/
00077 
00078 NTSTATUS
00079 NTAPI
00080 NtImpersonateClientOfPort(IN HANDLE PortHandle,
00081                           IN PPORT_MESSAGE ClientMessage)
00082 {
00083     UNIMPLEMENTED;
00084     return STATUS_NOT_IMPLEMENTED;
00085 }
00086 
00087 NTSTATUS
00088 NTAPI
00089 NtQueryPortInformationProcess(VOID)
00090 {
00091     /* This is all this function does */
00092     return STATUS_UNSUCCESSFUL;
00093 }
00094 
00095 NTSTATUS
00096 NTAPI
00097 NtQueryInformationPort(IN HANDLE PortHandle,
00098                        IN PORT_INFORMATION_CLASS PortInformationClass,
00099                        OUT PVOID PortInformation,
00100                        IN ULONG PortInformationLength,
00101                        OUT PULONG ReturnLength)
00102 {
00103     UNIMPLEMENTED;
00104     return STATUS_NOT_IMPLEMENTED;
00105 }
00106 
00107 /* EOF */

Generated on Sun May 27 2012 04:21:36 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.