00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
#ifndef _LPC_
00024
#define _LPC_
00025
00026
00027
00028
00029
00030 BOOLEAN
00031
LpcInitSystem( VOID );
00032
00033
VOID
00034
LpcExitThread(
00035
PETHREAD Thread
00036 );
00037
00038
VOID
00039
LpcDumpThread(
00040
PETHREAD Thread,
00041 IN
POB_DUMP_CONTROL Control OPTIONAL
00042 );
00043
00044
NTKERNELAPI
00045
NTSTATUS
00046
LpcRequestPort(
00047 IN PVOID PortAddress,
00048 IN PPORT_MESSAGE RequestMessage
00049 );
00050
00051
NTSTATUS
00052
LpcRequestWaitReplyPort(
00053 IN PVOID PortAddress,
00054 IN PPORT_MESSAGE RequestMessage,
00055 OUT PPORT_MESSAGE ReplyMessage
00056 );
00057
00058
00059
00060
00061
00062
00063
00064 extern ULONG
LpcCallOperationCount;
00065 extern ULONG
LpcCallBackOperationCount;
00066 extern ULONG
LpcDatagramOperationCount;
00067
00068
00069
00070
00071 typedef struct _LPCP_NONPAGED_PORT_QUEUE {
00072 KSEMAPHORE Semaphore;
00073
00074 struct _LPCP_PORT_OBJECT *
BackPointer;
00075 }
LPCP_NONPAGED_PORT_QUEUE, *
PLPCP_NONPAGED_PORT_QUEUE;
00076
00077 typedef struct _LPCP_PORT_QUEUE {
00078 PLPCP_NONPAGED_PORT_QUEUE NonPagedPortQueue;
00079 PKSEMAPHORE Semaphore;
00080
00081 LIST_ENTRY
ReceiveHead;
00082 }
LPCP_PORT_QUEUE, *
PLPCP_PORT_QUEUE;
00083
00084 #define LPCP_ZONE_ALIGNMENT 16
00085 #define LPCP_ZONE_ALIGNMENT_MASK ~(LPCP_ZONE_ALIGNMENT-1)
00086
00087
00088
00089
00090
00091 #define LPCP_ZONE_MAX_POOL_USAGE (8*PAGE_SIZE)
00092 typedef struct _LPCP_PORT_ZONE {
00093 KEVENT FreeEvent;
00094
00095 ULONG
MaxPoolUsage;
00096 ULONG
GrowSize;
00097 ZONE_HEADER Zone;
00098 }
LPCP_PORT_ZONE, *
PLPCP_PORT_ZONE;
00099
00100
00101
00102
00103
00104 typedef struct _LPCP_PORT_OBJECT {
00105 ULONG
Length;
00106 ULONG
Flags;
00107 struct _LPCP_PORT_OBJECT *
ConnectionPort;
00108 struct _LPCP_PORT_OBJECT *
ConnectedPort;
00109 LPCP_PORT_QUEUE MsgQueue;
00110 CLIENT_ID
Creator;
00111 PVOID
ClientSectionBase;
00112 PVOID
ServerSectionBase;
00113 PVOID
PortContext;
00114 ULONG
MaxMessageLength;
00115 ULONG
MaxConnectionInfoLength;
00116 PETHREAD ClientThread;
00117 SECURITY_QUALITY_OF_SERVICE
SecurityQos;
00118 SECURITY_CLIENT_CONTEXT StaticSecurity;
00119 LIST_ENTRY
LpcReplyChainHead;
00120 LIST_ENTRY
LpcDataInfoChainHead;
00121 PEPROCESS ServerProcess;
00122 ULONG
Reserved;
00123 KEVENT WaitEvent ;
00124 }
LPCP_PORT_OBJECT, *
PLPCP_PORT_OBJECT;
00125
00126
00127
00128
00129
00130 #define PORT_TYPE 0x0000000F
00131 #define SERVER_CONNECTION_PORT 0x00000001
00132 #define UNCONNECTED_COMMUNICATION_PORT 0x00000002
00133 #define SERVER_COMMUNICATION_PORT 0x00000003
00134 #define CLIENT_COMMUNICATION_PORT 0x00000004
00135 #define PORT_WAITABLE 0x20000000
00136 #define PORT_NAME_DELETED 0x40000000
00137 #define PORT_DYNAMIC_SECURITY 0x80000000
00138 #define PORT_DELETED 0x10000000
00139
00140 typedef struct _LPCP_MESSAGE {
00141
union {
00142 LIST_ENTRY
Entry;
00143
struct {
00144 SINGLE_LIST_ENTRY
FreeEntry;
00145 ULONG
Reserved0;
00146 };
00147 };
00148 USHORT Reserved1;
00149 USHORT ZoneIndex;
00150 ULONG
Reserved;
00151 PETHREAD RepliedToThread;
00152
00153 PVOID
PortContext;
00154 PORT_MESSAGE
Request;
00155 }
LPCP_MESSAGE, *
PLPCP_MESSAGE;
00156
00157
#if DEVL
00158
00159
00160
00161
00162
#define LPCP_ZONE_MESSAGE_ALLOCATED (USHORT)0x8000
00163
#endif
00164
00165
00166
00167
00168
00169
00170 typedef struct _LPCP_CONNECTION_MESSAGE {
00171 PORT_VIEW
ClientView;
00172 PLPCP_PORT_OBJECT ClientPort;
00173 PVOID
SectionToMap;
00174 REMOTE_PORT_VIEW
ServerView;
00175 }
LPCP_CONNECTION_MESSAGE, *
PLPCP_CONNECTION_MESSAGE;
00176
00177
00178
#endif // _LPC_