The Local Inter-Process Communication
(LPC, often also referred to as Local Procedure Call or Lightweight Procedure Call) is an internal, undocumented
inter-process communication
In computer science, interprocess communication (IPC) is the sharing of data between running Process (computing), processes in a computer system. Mechanisms for IPC may be provided by an operating system. Applications which use IPC are often cat ...
facility provided by the
Microsoft
Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
Windows NT
Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft as part of its Windows product line, the first version of which, Windows NT 3.1, was released on July 27, 1993. Original ...
kernel
Kernel may refer to:
Computing
* Kernel (operating system), the central component of most operating systems
* Kernel (image processing), a matrix used for image convolution
* Compute kernel, in GPGPU programming
* Kernel method, in machine learnin ...
for lightweight
IPC
IPC may refer to:
Businesses and organizations Arts and media
* Intellectual Property Committee, a coalition of US corporations with intellectual property interests
* International Panorama Council, an international network of specialists in ...
between
process
A process is a series or set of activities that interact to produce a result; it may occur once-only or be recurrent or periodic.
Things called a process include:
Business and management
* Business process, activities that produce a specific s ...
es on the same computer. As of
Windows Vista
Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
, LPC has been rewritten as Asynchronous Local Inter-Process Communication
[ (ALPC, often also Advanced Local Procedure Call) in order to provide a high-speed scalable communication mechanism required to efficiently implement ]User-Mode Driver Framework
User-Mode Driver Framework (UMDF) is a device-driver development platform first introduced with Microsoft's Windows Vista operating system, and is also available for Windows XP. It facilitates the creation of drivers for certain classes of device ...
(UMDF), whose user-mode parts require an efficient communication channel with UMDF's components in the executive
Executive ( exe., exec., execu.) may refer to:
Role or title
* Executive, a senior management role in an organization
** Chief executive officer (CEO), one of the highest-ranking corporate officers (executives) or administrators
** Executive dir ...
.
The (A)LPC interface is part of Windows NT's undocumented Native API
The Native API is a lightweight application programming interface (API) used by Windows NT's kernel and user mode applications. This API is used in the early stages of Windows NT startup process, when other components and APIs are still unavail ...
, and as such is not available to applications for direct use. However, it can be used indirectly in the following instances:
* when using the Microsoft RPC API to communicate locally, i.e. between the processes on the same machine
* by calling Windows APIs that are implemented with (A)LPC (see below)
Implementation
(A)LPC is implemented using kernel "port" objects, which are securable (with ACLs, allowing e.g. only specific SIDs to use them) and allow identification of the process on the other side of the connection. Individual messages are also securable: applications can set per-message SIDs, and also test for changes of the security context in the token associated with the (A)LPC message.
The typical communication scenario between the server and the client is as follows:
# A server process first creates a ''named server connection port'' object, and waits for clients to connect.
# A client requests a connection to that named port by sending a connect message.
# If the server accepts the connection, two ''unnamed'' ports are created:
#* ''client communication port'' - used by client threads to communicate with a particular server
#* ''server communication port'' - used by the server to communicate with a particular client; one such port per client is created
# The client receives a handle to the client communication port, and server receives a handle to the server communication port, and the inter-process communication channel is established.
(A)LPC supports the following three modes of message exchange between the server and client:
* For short messages (fewer than 256 bytes) the kernel copies the message buffers between processes, from the address space
In computing, an address space defines a range of discrete addresses, each of which may correspond to a network host, peripheral device, disk sector, a memory cell or other logical or physical entity.
For software programs to save and retrieve ...
of the sending process to the system address space, and from there to the receiving process' address space.
* For messages longer than 256 bytes a shared memory section must be used to transfer data, which the (A)LPC service maps between the sending and receiving processes. First the sender places data into the shared memory, and then sends a notification (e.g. a small message, using the first method of (A)LPC) to the receiving process pointing to the sent data in the shared memory section.
* Server can directly read and write data from the client's address space, when the amount of data is too large to fit in a shared section.
ALPC has a performance advantage over the former LPC interface, as it can be configured to use I/O completion ports instead of synchronous request/reply mechanism that LPC exclusively uses. This enables ALPC ports high-speed communication which automatically balances the number of messages and threads. Additionally, ALPC messages can be batched together so as to minimize user-mode/kernel-mode switches.
Known usage
(A)LPC is used heavily in communication between internal subsystems in Windows NT. The Win32 subsystem uses (A)LPC heavily for communication between client and the subsystem server (CSRSS
The Client/Server Runtime Subsystem, or csrss.exe, is a component of the Windows NT family of operating systems that provides the user mode side of the Win32 subsystem. In modern versions of Windows, it is primarily involved with process and threa ...
). Quick LPC was introduced in version 3.51 of Windows NT to make these calls faster. This method was largely abandoned in version 4.0 in favor of moving the performance critical server portions into kernel mode (win32k.sys).
The Local Security Authority Subsystem Service
Local Security Authority Subsystem Service (LSASS) is a process in Microsoft Windows operating systems that is responsible for enforcing the security policy on the system. It verifies users logging on to a Windows computer or server, handles pas ...
(LSASS), Session Manager
The Session Manager Subsystem, or smss.exe, is a component of the Microsoft Windows NT family of operating systems, starting in Windows NT 3.1. It is executed during the startup process of those operating systems.
Session initialization
The Se ...
(SMSS), and Service Control Manager
Service Control Manager (SCM) is a special system process under the Windows NT family of operating systems, which starts, stops and interacts with Windows service processes. It is located in the %SystemRoot%\System32\services.exe executable. Servic ...
all use (A)LPC ports directly to communicate with client processes. Winlogon
Winlogon (Windows Logon) is the component of Microsoft Windows operating systems that is responsible for handling the secure attention sequence, loading the user profile on logon, creates the desktops for the window station, and optionally locki ...
and the Security Reference Monitor use it to communicate with the LSASS process.
As mentioned, Microsoft RPC can use (A)LPC as a transport when the client and server are both on the same machine. Many services that are designed to communicate only on the local computer use (A)LPC as the only transport through RPC. The implementation of remote OLE
OLE, Ole or Olé may refer to:
* Olé, a cheering expression used in Spain
* Ole (name), a male given name, includes a list of people named Ole
* Overhead lines equipment, used to transmit electrical energy to trams, trolleybuses or trains
Co ...
and DCOM in many cases uses (A)LPC for local communication as well.
See also
* Doors
A door is a hinged or otherwise movable barrier that allows ingress (entry) into and egress (exit) from an enclosure. The created opening in the wall is a ''doorway'' or ''portal''. A door's essential and primary purpose is to provide secu ...
* Remote procedure call
In distributed computing, a remote procedure call (RPC) is when a computer program causes a procedure (subroutine) to execute in a different address space (commonly on another computer on a shared computer network), which is written as if it were a ...
Notes
References
*
*
External links
* {{webarchive , url=https://web.archive.org/web/20080612141354/http://www.windowsitlibrary.com/Content/356/08/toc.html , date=June 12, 2008 , title=Local Procedure Call — Includes explanation of undocumented functions
LPC Communication
Windows communication and services
Inter-process communication