2007-01-10 04:27:40 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Kernel
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
2009-12-12 12:23:55 +00:00
|
|
|
* FILE: ntoskrnl/include/internal/lpc.h
|
2007-01-10 04:27:40 +00:00
|
|
|
* PURPOSE: Internal header for the Local Procedure Call
|
|
|
|
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
|
|
|
|
*/
|
|
|
|
|
|
|
|
//
|
|
|
|
// Define this if you want debugging support
|
|
|
|
//
|
2009-06-01 06:21:12 +00:00
|
|
|
#define _LPC_DEBUG_ 0x00
|
2007-01-10 04:27:40 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// These define the Debug Masks Supported
|
|
|
|
//
|
|
|
|
#define LPC_CREATE_DEBUG 0x01
|
|
|
|
#define LPC_CLOSE_DEBUG 0x02
|
|
|
|
#define LPC_CONNECT_DEBUG 0x04
|
|
|
|
#define LPC_LISTEN_DEBUG 0x08
|
|
|
|
#define LPC_REPLY_DEBUG 0x10
|
|
|
|
#define LPC_COMPLETE_DEBUG 0x20
|
|
|
|
#define LPC_SEND_DEBUG 0x40
|
|
|
|
|
|
|
|
//
|
|
|
|
// Debug/Tracing support
|
|
|
|
//
|
|
|
|
#if _LPC_DEBUG_
|
|
|
|
#ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented
|
|
|
|
#define LPCTRACE(x, ...) \
|
|
|
|
{ \
|
|
|
|
DbgPrintEx("%s [%.16s] - ", \
|
|
|
|
__FUNCTION__, \
|
|
|
|
PsGetCurrentProcess()->ImageFileName); \
|
|
|
|
DbgPrintEx(__VA_ARGS__); \
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define LPCTRACE(x, ...) \
|
|
|
|
if (x & LpcpTraceLevel) \
|
|
|
|
{ \
|
|
|
|
DbgPrint("%s [%.16s:%lx] - ", \
|
|
|
|
__FUNCTION__, \
|
|
|
|
PsGetCurrentProcess()->ImageFileName, \
|
|
|
|
PsGetCurrentThreadId()); \
|
|
|
|
DbgPrint(__VA_ARGS__); \
|
|
|
|
}
|
|
|
|
#endif
|
2009-06-01 06:21:12 +00:00
|
|
|
#else
|
2011-08-01 22:59:44 +00:00
|
|
|
#define LPCTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__)
|
2006-10-30 14:17:37 +00:00
|
|
|
#endif
|
2005-05-09 01:38:29 +00:00
|
|
|
|
2007-01-22 08:07:24 +00:00
|
|
|
//
|
|
|
|
// LPC Port/Message Flags
|
|
|
|
//
|
|
|
|
#define LPCP_THREAD_FLAG_IS_PORT 1
|
|
|
|
#define LPCP_THREAD_FLAG_NO_IMPERSONATION 2
|
|
|
|
#define LPCP_THREAD_FLAGS (LPCP_THREAD_FLAG_IS_PORT | \
|
|
|
|
LPCP_THREAD_FLAG_NO_IMPERSONATION)
|
|
|
|
|
2013-09-02 21:09:56 +00:00
|
|
|
//
|
|
|
|
// LPC Locking Flags
|
|
|
|
//
|
2013-09-02 22:19:41 +00:00
|
|
|
#define LPCP_LOCK_HELD 1
|
2013-09-02 21:09:56 +00:00
|
|
|
#define LPCP_LOCK_RELEASE 2
|
|
|
|
|
2007-01-10 04:27:40 +00:00
|
|
|
//
|
|
|
|
// Internal Port Management
|
|
|
|
//
|
|
|
|
VOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2005-09-13 23:48:54 +00:00
|
|
|
LpcpClosePort(
|
2006-05-10 17:47:44 +00:00
|
|
|
IN PEPROCESS Process OPTIONAL,
|
|
|
|
IN PVOID Object,
|
|
|
|
IN ACCESS_MASK GrantedAccess,
|
|
|
|
IN ULONG ProcessHandleCount,
|
|
|
|
IN ULONG SystemHandleCount
|
2005-09-13 23:48:54 +00:00
|
|
|
);
|
2000-06-04 17:32:44 +00:00
|
|
|
|
2005-09-13 23:48:54 +00:00
|
|
|
VOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2007-01-10 04:27:40 +00:00
|
|
|
LpcpDeletePort(
|
|
|
|
IN PVOID ObjectBody
|
|
|
|
);
|
2004-10-31 20:27:08 +00:00
|
|
|
|
2007-01-10 04:27:40 +00:00
|
|
|
NTSTATUS
|
2006-07-09 18:54:13 +00:00
|
|
|
NTAPI
|
2007-01-10 04:27:40 +00:00
|
|
|
LpcpInitializePortQueue(
|
|
|
|
IN PLPCP_PORT_OBJECT Port
|
|
|
|
);
|
2000-06-04 17:32:44 +00:00
|
|
|
|
2005-09-13 23:48:54 +00:00
|
|
|
VOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2007-01-10 04:27:40 +00:00
|
|
|
LpcpFreeToPortZone(
|
|
|
|
IN PLPCP_MESSAGE Message,
|
2013-09-02 21:09:56 +00:00
|
|
|
IN ULONG LockFlags
|
2005-09-13 23:48:54 +00:00
|
|
|
);
|
2000-06-04 17:32:44 +00:00
|
|
|
|
2005-09-13 23:48:54 +00:00
|
|
|
VOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2007-01-10 04:27:40 +00:00
|
|
|
LpcpMoveMessage(
|
|
|
|
IN PPORT_MESSAGE Destination,
|
|
|
|
IN PPORT_MESSAGE Origin,
|
|
|
|
IN PVOID Data,
|
|
|
|
IN ULONG MessageType,
|
|
|
|
IN PCLIENT_ID ClientId
|
2005-09-13 23:48:54 +00:00
|
|
|
);
|
2000-06-04 17:32:44 +00:00
|
|
|
|
2005-09-13 23:48:54 +00:00
|
|
|
VOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2007-01-10 04:27:40 +00:00
|
|
|
LpcpSaveDataInfoMessage(
|
|
|
|
IN PLPCP_PORT_OBJECT Port,
|
2007-01-18 09:44:49 +00:00
|
|
|
IN PLPCP_MESSAGE Message,
|
2013-09-02 21:09:56 +00:00
|
|
|
IN ULONG LockFlags
|
2005-09-13 23:48:54 +00:00
|
|
|
);
|
2000-06-04 17:32:44 +00:00
|
|
|
|
2007-01-10 04:27:40 +00:00
|
|
|
//
|
|
|
|
// Module-external utlity functions
|
|
|
|
//
|
|
|
|
VOID
|
2006-09-06 12:19:00 +00:00
|
|
|
NTAPI
|
2007-01-10 04:27:40 +00:00
|
|
|
LpcExitThread(
|
|
|
|
IN PETHREAD Thread
|
2005-09-13 23:48:54 +00:00
|
|
|
);
|
2000-06-04 17:32:44 +00:00
|
|
|
|
2007-01-10 04:27:40 +00:00
|
|
|
//
|
|
|
|
// Initialization functions
|
|
|
|
//
|
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(
|
2007-01-10 04:27:40 +00:00
|
|
|
VOID
|
2005-09-13 23:48:54 +00:00
|
|
|
);
|
2000-04-03 21:54:42 +00:00
|
|
|
|
2007-01-10 04:27:40 +00:00
|
|
|
//
|
|
|
|
// Global data inside the Process Manager
|
|
|
|
//
|
|
|
|
extern POBJECT_TYPE LpcPortObjectType;
|
|
|
|
extern ULONG LpcpNextMessageId, LpcpNextCallbackId;
|
|
|
|
extern KGUARDED_MUTEX LpcpLock;
|
|
|
|
extern PAGED_LOOKASIDE_LIST LpcpMessagesLookaside;
|
|
|
|
extern ULONG LpcpMaxMessageSize;
|
|
|
|
extern ULONG LpcpTraceLevel;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Inlined Functions
|
|
|
|
//
|
|
|
|
#include "lpc_x.h"
|